Symptom
You have inserted a record in the following MDF Foundation Object entities via OData API without specifying a value in externalCode and the Upsert performed returns 'HTTP response code: 500' but the status and message tag shows empty hence user cannot identify what is causing the error.
OData API Entity |
Foundation Object |
FOBusinessUnit |
Business Unit |
FOCompany |
Company |
FOCostCenter |
Cost Center |
FODepartment |
Department |
FODivision |
Division |
FOJobCode |
Job Code |
FOJobFunction |
Job Function |
FOPayGroup |
Pay Group |
Environment
SAP SuccessFactors HXM Suite
- SAP SuccessFactors HXM Suite OData API
Reproducing the Issue
Use Case: Upsert a record in FOCompany entity (using Postman)
1. Create New Request.
2. Set the Option to POST and form your URL.
Format: URL (according to KBA 2215682)/odata/v2/upsert
Example: https://apisalesdemo4.successfactors.com/odata/v2/upsert
3. Set Authorization to Basic Auth
4. Populate the username and password fields.
Username follows the following format: Username@CompanyID
Note: The user should have ODATA permissions in Manage Permission Roles > [Role] > Recruiting Permissions.
5. Go to the Body Tab and populate the body with the UPSERT request for FOCompany. Make sure the format is in JSON.
6. Click on Send.
7. In the API response, you will notice that Upsert request has failed (Error Code 500) but it does not indicate which exact record caused the error.
Searching the Upsert Call in OData API Audit Log
If you check the Session ID generated from the API call in OData API Audit Logs, the execution status shows "Success" where in fact data added did not reflect to the system.
"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."
Cause
Known Issue
Product Enhancement
Resolution
A fix for this behavior is currently being planned for the next releases, with estimated plans for 2H 2021 (b2111) but please note that these are just plans that can be changed.
To avoid this behavior, please ensure to include the business keys in the body payload for the chosen API entity as this is required for Upsert calls. Identifying all the business keys for an OData API entity can be found in the Business Key column section of OData API Data Dictionary.
See Also
Please refer to the guide for Employee Central OData API entities.
Keywords
OData API Framework, Upsert, Insert, MDF Foundation Objects, Missing error message in response payload, missing status in response payload, Foundation Objects Import via API, FOBusinessUnit, FOCompany, FOCostCenter, FODepartment, FODivision, FOJobCode, FOJobFunction, FOPayGroup, externalCode empty, 500 error code, KBA, Known Issue , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , Integrations , Product Enhancement