Symptom
In CPI you are using SuccessFactors Adapter to perform an OData API request to your SuccessFactors system:
In the OData API request you use $filter operation and filter for a value which contains a special character:
- Example: odata/v2/FODivision?$filter=externalCode eq 'R&D'
The process fails with error: com.sap.gateway.core.ip.component.odata.exception.OsciException: : 400 : HTTP/1.1
Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.
Environment
- SAP Cloud Platform Integration
- SuccessFactors Adapter
- SAP SuccessFactors HCM
- OData API
Cause
The special characters used in the $filter operation are not properly encoded which results in a malformed API request reaching SuccessFactors:
- URL Encoded: https://api68sales.successfactors.com/odata/v2/FODivision?%24filter=externalCode%20eq%20%27R
- URL Decoded: https://api68sales.successfactors.com/odata/v2/FODivision?$filter=externalCode eq 'R
The request is not properly formed due to the lack of encoding of the special character: &
Resolution
The special character value must be double-encoded in order to be received in correct format:
- & --> %26 --> %2526
This will result in the correct $filter value being received by SuccessFactors OData API which can then be processed and responded to correctly:
See Also
Similar can be seen with CPI's HTTPS adapter only in that case triple encoding is needed, see here for reference:
- 3131448 - HTTP Receiver adapter discards encoding of special characters in address
Keywords
KBA , LOD-HCI-PI-CON-OD , OData Adapters , LOD-SF-INT-CPI , Standard SF to 3rd Party CPI (HCI) Content , LOD-SF-INT-ODATA , OData API Framework , How To
Product
Attachments
Pasted image.png |
Pasted image.png |
Pasted image.png |