SAP Knowledge Base Article - Public

2848649 - How to Add interviewers via ODATA API - Recruiting Management

Symptom

This article describes how you can add interviewers for a Job Application via ODATA API.

"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 SuccessFactors Recruiting Management (RCM)

Resolution

API WARNING: API upserts is a powerful tool to help you automate manual tasks and edit data that is not possible or difficult to do in the UI. However, this can also lead to unintentional data changes if mishandled. Make sure you understand how to use the ODATA API Data Dictionary and the integration tools in general. If possible, test first with your preview environment and with only a subset of your data to see whether you are getting the intended results. 

Moreover, creating scripts is like creating your system's configuration, they are outside support scope (and are typically requests for partners) but if you have issues that are possible defects, please feel free to reach out to Support.

The following payload allows you to add interviewers in your job application and it follows this format.

POST: URL (according to KBA 2215682)/odata/v2/upsert

{
"__metadata": {
 "uri": "JobApplicationInterview",
 "type": "SFOData.JobApplicationInterview"
 },
"templateType": "JOB_REQ",
"source": "INTERNAL",
"applicationId": "appId",
"interviewer": {
"__metadata": {
  "uri": "url/odata/v2/User('userId')",
  "type": "SFOData.User"
  },
 "userId": "userId"
 }
}

Note: The field values in red has to be replaced with the actual values from your system, while the other field values, such as source and templateType, should stay as is.

Request Breakdown

1. The Request has to be POST and the URL to use should be defined as follows:

Format: URL (according to KBA 2215682)/odata/v2/upsert
Example: https://apisalesdemo4.successfactors.com/odata/v2/upsert

2. Use the entity JobApplicationInterview.

{
"__metadata": {
 "uri": "JobApplicationInterview",
 "type": "SFOData.JobApplicationInterview"
 },
"templateType": "JOB_REQ",
"source": "INTERNAL",
"applicationId": "appId",
"interviewer": {
"__metadata": {
  "uri": "url/odata/v2/User('userId')",
  "type": "SFOData.User"
  },
 "userId": "userId"
 }
}

3. All the fields in the payload are the required fields defined for the JobApplicationInterview entity according to the ODATA API Data Dictionary.

kb.png

4. Add the User ID of the interviewer. This information comes from the User Data File (Employee Export).

{
"__metadata": {
 "uri": "JobApplicationInterview",
 "type": "SFOData.JobApplicationInterview"
 },
"templateType": "JOB_REQ",
"source": "INTERNAL",
"applicationId": "appId",
"interviewer": {
"__metadata": {
  "uri": "url/odata/v2/User('userId')",
  "type": "SFOData.User"
  },
 "userId": "userId"
 }
}

5. Keep the following information as is.

{
"__metadata": {
 "uri": "JobApplicationInterview",
 "type": "SFOData.JobApplicationInterview"
 },
"templateType": "JOB_REQ",
"source": "INTERNAL",
"applicationId": "appId",
"interviewer": {
"__metadata": {
  "uri": "url/odata/v2/User('userId')",
  "type": "SFOData.User"
  },
 "userId": "userId"
 }
}

6. Add the application ID of the candidate who will be interviewed.

{
"__metadata": {
 "uri": "JobApplicationInterview",
 "type": "SFOData.JobApplicationInterview"
 },
"templateType": "JOB_REQ",
"source": "INTERNAL",
"applicationId": "appId",
"interviewer": {
"__metadata": {
  "uri": "url/odata/v2/User('userId')",
  "type": "SFOData.User"
  },
 "userId": "userId"
 }
}

7. Note: Please make sure that the candidate is already in the Interview status when doing this request.

8. Sample Request

POST: https://apisalesdemo4.successfactors.com:443/odata/v2/upsert

{
"__metadata": {
 "uri": "JobApplicationInterview",
 "type": "SFOData.JobApplicationInterview"
 },
"templateType": "JOB_REQ",
"source": "INTERNAL",
"applicationId": "1633",
"interviewer": {
 "__metadata": {
  "uri": "https://apisalesdemo4.successfactors.com:443/odata/v2/User('82094')",
  "type": "SFOData.User"
  },
 "userId": "82094"
 }
}

9. Sample Response

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
<entry>
<content type="application/xml">
<m:properties>
<d:key>JobApplicationInterview/applicationInterviewId=661</d:key>
<d:status>OK</d:status>
<d:editStatus>INSERTED</d:editStatus>
<d:message m:null="true"></d:message>
<d:index m:type="Edm.Int32">0</d:index>
<d:httpCode m:type="Edm.Int32">201</d:httpCode>
<d:inlineResults m:type="Bag(SFOData.UpsertResult)"></d:inlineResults>
</m:properties>
</content>
</entry>
</feed>

See Also

2885326 - How to use Postman on performing ODATA API Requests - Recruiting Management
2817669 - ODATA API Data Dictionary - Recruiting Management
2215682 - Successfactors API URLs for different Data Centers

ODATA API Reference Guide

Keywords

ODATA, API, JobApplicationInterview, Upsert, Insert, Recruiting Management, RCM, Integration , KBA , LOD-SF-RCM-API , Webservices & APIs , How To

Product

SAP SuccessFactors Recruiting all versions