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

The payload follows this format. The uri under the interviewer field differs per Data Center.

POST URL: https://url/odata/v2/upsert for example, https://apisalesdemo4.successfactors.com:443/odata/v2/upsert. The URL specified here is the API URL not your instance URL (see the reference KBA below).

{
"__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 that you want to upsert to the system, while the other field values, such as source and templateType, should stay as is.

Request Breakdown

1. 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"
 }
}

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

kb.png

3. 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"
 }
}

4. 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"
 }
}

5. 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"
 }
}

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

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"
 }
}

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

2215682 - Successfactors API URLs for different Data Centers

Keywords

Interviewers, API, ODATA , KBA , LOD-SF-RCM-API , Webservices & APIs , How To

Product

SAP SuccessFactors Recruiting all versions