SAP Knowledge Base Article - Public

2866011 - How to Add Job Requisition Assessment via ODATA API - Recruiting Management

Symptom

This article describes the steps on how to add the assessment data in an existing requisition 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.

1.The assessment property called assessment is under the JobRequisition entity in ODATA.

assessmentkb1.png

 

2. If you click on the JobRequisitionAssessment, you will see the properties under this entity.

assessmentkb2.png

 

3. The assessment property under the JobRequisition entity is upsertable as a whole but you cannot upsert using the entity JobRequisitionAssessment as the base entity. You always have to upsert using assessment under the JobRequisition entity.

4. This is a single upsert request on an existing requisition with no assessment value yet. This is a sample API request that shows how to upsert assessment details on an existing JobRequisition with no assessment data yet.

Request URL: https://apisalesdemo4.successfactors.com/odata/v2/upsert

{
"jobReqId": "2662",
"__metadata": {
   "type": "SFOData.JobRequisition",
   "uri": "https://apisalesdemo4.successfactors.com/odata/v2/JobRequisition"
},
"assessment": {"__metadata": {
              "uri": "https://apisalesdemo4.successfactors.com/odata/v2/JobRequisitionAssessment",
              "type": "SFOData.JobRequisitionAssessment"
},
              "emailTemplateId": 121,
              "appStatusSetItemId": 3,
              "assessmentPackageCode": "1482",
              "vendorCode": "PYMETRICS"
}}

5. Description of the fields in the Upsert Request above. Elements of the jobReqId property.

{
"jobReqId": "2662",
"__metadata": {
   "type": "SFOData.JobRequisition",
   "uri": "https://apisalesdemo4.successfactors.com/odata/v2/JobRequisition"
},

a. jobReqId: The Job Requisition ID where you want to add the assessment details.

b. type: The entity being upserted. The assessment details should be upserted using "SFOData.JobRequisition" as JobRequisitionAssessment entity is not upsertable.

c. uri: The request URL changes depending on where your instance resides (DC 4, DC 12, etc) and whether your instance is a production instance or a preview instance. Check KBA 2215682 for the list of API URLs. The uri ends with /JobRequisition.

6. Description of the fields in the Upsert Request above. Elements of the assessment property.

"assessment": {"__metadata": {
              "uri": "https://apisalesdemo4.successfactors.com/odata/v2/JobRequisitionAssessment",
              "type": "SFOData.JobRequisitionAssessment"
},
              "emailTemplateId": 121,
              "appStatusSetItemId": 3,
              "assessmentPackageCode": "1482",
              "vendorCode": "PYMETRICS"
}

a. assessment: This is the property under the JobRequisition in ODATA API Data Dictionary that holds assessment information.

b. uri: The request URL changes depending on where your instance resides (DC 4, DC 12, etc) and whether your instance is a production instance or a preview instance. Check KBA 2215682 for the list of API URLs. The uri ends with /JobRequisitionAssessment.

c. type: The entity being upserted. It should be set as "SFOData.JobRequisitionAssessment" as we are calling JobRequisitionAssessment through the assessment property under JobRequisition entity.
    
d. emailTemplateId: The email template to be used for the emails sent to the candidate when they reach the Assessment status. This can be found in Admin Center > Edit Applicant Status Configration.

e. appStatusSetItemId: The ID of the candidate status where assessment will be triggered. This can be found in Admin Center > Edit Applicant Status Configration.

f. assessmentPackageCode: The package ID used for the assessment request. This can be found in Provisioning > Import/Export Assessment Vendor Packages.

g. vendorCode: The vendor code activated for assessment requests.  This can be found in Admin Center > Manage Assessment Vendors.

7. The request above will return a Response saying Job Requisition has been updated successfully.

        <content type="application/xml">
            <m:properties>
                <d:key m:null="true"></d:key>
                <d:status>OK</d:status>
                <d:editStatus>UPDATED</d:editStatus>
                <d:message>Job Requisition has been updated successfully</d:message>
                <d:index m:type="Edm.Int32">0</d:index>
                <d:httpCode m:type="Edm.Int32">204</d:httpCode>
                <d:inlineResults m:type="Bag(SFOData.UpsertResult)"></d:inlineResults>
            </m:properties>
        </content>

Note: Some of the API tags above are truncated for brevity.

8. UI Verification of the upserted request.

ask6.png

9. Please note that making a similar upsert request on the same requisition will not update or overwrite the previous assessment details but will only add to it.

ask7.png

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

2863929 - Exposing Assessment details via Job Requisition ODATA API - Recruiting Management

Keywords

Assessment, Assessment Integration, Third-party Vendor, Recruiting Management, RCM, Integration, API, JobRequisitionAssessment, ODATA , KBA , LOD-SF-RCM-API , Webservices & APIs , How To

Product

SAP SuccessFactors Recruiting all versions