SAP Knowledge Base Article - Public

2848692 - How to Create Job Requisition via ODATA API - Recruiting Management

Symptom

This article describes how you can Create Job 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

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 payload follows this format. This payload is the bare minimum without any other required fields in the requisition template.

1. The templateId is the ID of the Job Requisition template that will be used in creating the requisition. You can find this in provisioning.

REQUEST

{
"templateId":"8",
"__metadata":{

"type": "SFOData.JobRequisition",
"uri": "JobRequisition"

 }
}

Note: The templateId has to be replaced with the actual values that you have in your instance.

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>JobRequisition/jobReqId=2663</d:key>
                <d:status>OK</d:status>
                <d:editStatus>INSERTED</d:editStatus>
                <d:message>Job Requisition has been inserted successfully</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>

2. The newly created requisition ID is 2663.

3. This is another format of the insert request.

REQUEST

{
"templateId":"8",
"__metadata":{

"type": "SFOData.JobRequisition",
"uri": "https://apisalesdemo4.successfactors.com/odata/v2/JobRequisition"

 }
}

Note: The templateId has to be replaced with the actual values that you have in your instance. Also, the uri has to change depending on what Data Center your instance lies on. Please consult KBA 2215682 to know which one to use.

RESPONSE

<?xml version="1.0" encoding="utf-8"?>
<entry 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" xml:base="https://apisalesdemo4.successfactors.com:443/odata/v2/">
    <id>https://apisalesdemo4.successfactors.com:443/odata/v2/JobRequisition(2684L)</id>
    <title type="text"></title>
    <updated>2019-11-22T20:00:22Z</updated>
    <author>
        <name></name>
    </author>
    <link rel="edit" title="JobRequisition" href="JobRequisition(2684L)"></link>
    <category term="SFOData.JobRequisition" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"></category>
    <content type="application/xml">
        <m:properties>
            <d:templateId m:type="Edm.Int64">8</d:templateId>
            <d:jobReqId m:type="Edm.Int64">2684</d:jobReqId>
        </m:properties>
    </content>
</entry>

4. The newly created requisition ID is 2684.

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, JobRequisition, Job Requisition, Upsert, Insert, Recruiting Management, RCM , KBA , LOD-SF-RCM-API , Webservices & APIs , How To

Product

SAP SuccessFactors Recruiting all versions