2482108 - How to use POSTMAN to perform upsert operation

SAP Knowledge Base Article - Public

2482108 - How to use POSTMAN to perform upsert operation

Symptom

Environment

SuccessFactors BizX  - Recruiting Management(RCM)

Resolution

1. Open the Postman

 postman.PNG

2. Change the http method to “POST”:

Post1.PNG

3. Insert the url: “https://api4.successfactors.com/odata/v2/upsert” . Note: url should be based on the instance's Data Center

post2.PNG

4. Click on “Authorization” tab

post3.PNG

5. Choose “Basic Auth”

post4.PNG

6. Insert API username and password:

post username password.png

7. Click on “Body” tab

post6.PNG

8. Click on “raw” option buttom:

post7.PNG

9. Insert the xml code below on text box: 

Note it is just an example for upsert operation. Here I am updating, application template field 'Id' with a data [Test 45]

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

 xml:base="https://api4.successfactors.com:443/odata/v2/">          

                    <entry>

                                        <id>https://api4.successfactors.com:443/odata/v2/JobApplication(123L)</id>

                                        <content type="application/xml">

                                                            <m:properties>

                                                                                <d:comentIdCreation>[Test 45]Id has been requested</d:comentIdCreation>

                                                            </m:properties>

                                       </content>

                    </entry>

</feed>

10. Change the content type from “Text” to “XML (application/xml)”.

post8.png

11. Click on “Headers” tab:

post9.PNG

12. Change the Content-Type value from “application/xml” to “application/atom+xml”:

post12.PNG

13. Click on “Send”:

post10.PNG

14: The response will be show on bottom of the page:

post11.png

15. Error response received from test above:

<?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 m:null="true"></d:key>

                <d:status>ERROR</d:status>

                <d:editStatus m:null="true"></d:editStatus>

                <d:message>date1 required for external candidate, date2 required for external candidate, country required for external candidate, for templateId 123,  with the index 0</d:message>

                <d:index m:type="Edm.Int32">0</d:index>

                <d:httpCode m:type="Edm.Int32">500</d:httpCode>

                <d:inlineResults m:type="Bag(SFOData.UpsertResult)"></d:inlineResults>

            </m:properties>

        </content>

    </entry>

</feed>

16. As we are performing upsert operation, make sure to pass data for the all required fields of the template. If we pass data for all required fields in request, we will not a above error in the response.

17. This is how we can perform upsert operation using Postman.

Keywords

Postman Upsert operation Odata API , KBA , LOD-SF-RCM-API , Webservices & APIs , How To

Product

SAP SuccessFactors Recruiting all versions