SAP Knowledge Base Article - Public

3114140 - OData API HTTP 500 Error when using h4 tags

Symptom

  • You have create tickets via OData API with a formatted text (ServiceRequestTextCollection with Typecode 10004)
  • When using special tags like h4, the ODATA API returns an 500 error: Tag <h4> is not found in the include list::Tag <h4> is not found in the include list.
  • When they create a custom field with type "formatted text" the payload with the "h4" works fine

Environment

SAP Cloud for Customer

Reproducing the Issue

  1. Perform a POST request to the Service Request Text Collection using POSTMAN
    • For example, as a tests use the following sample data:
    • URL: [yourtenant].crm.ondemand.com
    • Odata POST:
      • URL: https://[yourtenant].crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/ServiceRequestCollection('00163E03A0701ED28A8644CF8D83AE76')/ServiceRequestTextCollection
      • Payload:

{
    "TypeCode" : "10011",
    "FormattedText":"<h4> test HTML injection </h4>"
}

  1. If you perform the same POST without the <h4> and </h4> tags, the operation is successful

Cause

Working as designed

Resolution

  • The Tag <h4> is not allowed in ServiceRequestTextCollection OData.
  • For a list of available tags that can be used, please refer to the below screen shot
    Allowed_Tags.png

See Also

Keywords

Data Workbench, DWB, Template, Service Request, OData, Service, C4C, missing, Tags, API, HTML, ticket, a, b, br, span, p, strong, sub, sup, tt, u, ul, div, s, li, img, img/ , KBA , LOD-CRM-SRP-API , Ticket API & Odata , How To

Product

SAP Cloud for Customer add-ins all versions ; SAP Cloud for Customer core applications 2108 ; SAP Cloud for Customer core applications all versions