When performing the UPSERT operation to update a field, getting required field error in the response:
<d:message>date1 required, date2 required, country required, for templateId 123, with the index 0</d:message>
SAP SuccessFactors Recruiting Management
Reproducing the Issue
You are performing a upsert operation to update single field 'Id' of the application. This is just an example.
- Use a method to perform upsert operation (e.g. POSTMAN)
- Insert the url: https://api(DATA CENTER).successfactors.com/odata/v2/upsert (this url should be based on your instance data center)
- Provide API username and password
- Insert the values you wish to update
- Receive the error message: FieldID is required [...], with the index 0
For entities JobApplication and Candidate (please note that this refers to the Candidate entity, not CandidateLight), it's required to pass all the information of all required fields.
When we are using upsert operation, it is required/mandatory to pass value/data for all the required fields of the template even if we just want to update a single field.
In the JobApplication and Candidate entities, there is no way to bypass the required information as we can do with JobRequisition's isDraft option. However, it is possible, for Candidate Profiles, to bypass the required fields by using, instead, the CandidateLight entity. More details about this functionality can be found here: 2569249 - How to insert a candidate without providing all the required basic fields Odata - RCM.
OData API, Upsert operation, Upsert, Required field with index error, candidate, application, jobapplication, candidatelight. , KBA , LOD-SF-RCM-API , Webservices & APIs , Problem