Using Postman for large Successfactor updates with CSV

We recently had an issue with Successfactors Recruitment where applicants in a particular status were not picked up by the candidate purge process leaving client liable for breaching data privacy. To correct the issue, we tried a few things such as using the SFAPI to update status(the behaviour inconsistent), and also the Integration Center which worked to a degree. Ultimately , we opted to use Postman and thought we’d document the process if it helps someone else. Some of the instructions here are pretty basic, so if you’re familiar with the concepts, please skip ahead.

1. You’ll need to download postman.
https://www.getpostman.com/

2. Ensure the login ID has sufficient ODATA privileges

3. Create a new collection.
When you start postman you should be presented with a wizard. A collection is just a set of requests you’ll be sending to the server.

4. Give your new collection a name and set the authorisation
Under the authorisation section, Select type “Basic Auth”. Set your username and password. Your username should be your ODATA login name and Instance ID. Please be aware, the login IDs are case-sensitive.

5. Create a new Post request
Click the little plus button and create the details of your ODATA Upsert. You’ll need to know which data entity you’re inserting into also the URL for your data center. To learn more about the data entity, you can use the “ODATA API Data dictionary” from your BizX instance. To obtain your data center details, use the sap note 2215682 . We’re using the UPSERT call below which also tells the system we’d like the response in JSON format :-
https://<<YOUR DATA CENTER>.successfactors.eu/odata/v2/upsert?$format=json
At this point, the calls are set up but does nothing. We should save. Remember to select the collection you created when saving.

5.1 Testing your connection details without Inserting.(Optional)
Create a new request, but this type a “Get” request. Use the URL below :-https://<<YOUR DATA CENTER>>.successfactors.com/odata/v2/$metadata

6.  Adding Header and Body Details
Select your request and choose the Header option. The REST header can contain some control information which we’ll pass to the system.

  • Accept – application/json
  • Content – Type-application/json; charset=utf-8

Now Select the Body option and ensure the raw radio button has been checked, the below is JSON formatted data which we’ll be sending to the system. This becomes a lot easier to understand when you first try to make a “GET” call to the entity you’re attempting to insert into. Please note the fields in the double brackets. These are your variables which come from the CSV you’re attempting to upload into.

{ "__metadata": 
    { "uri": "JobApplication('{{AppliID}}L')" 
    }, 
    "applicationId":"{{AppliID}}", 
    "appStatusSetItemId": "202" , 
    }
}

7. Adding Validation
Postman has the option of using Scripts the provide validation from. There are some pre made code snippets but these do not suit our needs. We used an existing code snippet and modified it to our expected return code.

pm.test("Update code", function () {
var jsonData = pm.response.json();
pm.expect(jsonData.d[0].httpCode).to.eql(204);
});

8. We execute our script
We’ve tested our connectivity, we have the data we want to UPSERT and we have our validation. We should now be able to run a script to insert data using a CSV file. Select your collection and click the run option.

Select your CSV file, ensuring the Headers match up with the variables you’ve created in the Body as those are the values that are going to be replaced. Click run, and you should be presented with the results.

We hoped this was easy to understand as Successfactors has provided a lot of tools to enable your business to operate without outside expertise. If you have any queries, we’d love to hear from you, as they say

–  “To teach is to learn twice”