SAP Knowledge Base Article - Public

2173792 - How to use Google Rest client to run Odata API

Symptom

Environment

Google Rest Client

Resolution

This extension of Google client can help us in creating a similar situation (In most cases) that can assist our understanding of the OData API issue and hence help in resolving them.

Pre-requisites are:

  • Necessary permissions required to run the OData API calls which are configured in Provisioning and in customer instance. (Please refer to Odata API guides/handbooks that explain the configuration)
  • Google Chrome browser with ‘Rest” Add-on.

How do we begin once we have the rest client added to Google chrome browser?

Setting up the Authorization

Let’s assume the below Successfactors salesdemo system logon information:

Company Name – CandyShop

Username – Admin

Password – Chocolate!

Send authentication with the http header by parameter “Authorization” base64 encode string should be of the format username@company:password

Ie, in this case - Admin@CandyShop:Chocolate!  Preceded with the word “Basic” and a space in front of it.

Base64 encoder available in notepad++ as plugin (and also via several online Base64 encode tools)

 

1.png

We get the string as QWRtaW5AQ2FuZHlTaG9wOkNob2NvbGF0ZSE=

Now the header should look like:

Authorization: Basic QWRtaW5AQ2FuZHlTaG9wOkNob2NvbGF0ZSE=

Http operation (Query,Upsert,Update etc) can be specified in the tab as shown in the below picture. In this example, we use Query (GET) operation.

r2.jpg

We can test the API tool as shown in the below examples:

An example Query URL -

 https://salesdemo4.successfactors.com:443/odata/v2/PerPersonal?$filter=personIdExternal%20eq%20'rus5'

  • From the above request URL, We observe – We are fetching all the information of the employee with their personIdExternal = rus5 , from the Odata API entity = PerPersonal
  • Click “Send” at the bottom.

     r3.jpg

       Second Example – (Using Navigations)

https://salesdemo4.successfactors.com:443/odata/v2/PerPersonal?$format=json&$filter=personNav/emailNav/emailAddress%20eq%20'ajohnston@successfactors.com'&$select=firstName

From the Query, We understand that,

Json Format is used, Filter the employee who has their email = ajohnston@successfactors.com and fetch their First name.

Response Obtained

 

 

 r4.jpg 

See Also

Rest stands for Representational state transfer. We can utilize this to run Odata API calls.

For additional info on the extension – Referhttp://en.wikipedia.org/wiki/Representational_state_transfer

Downloading the application

https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo

Keywords

Using Rest client, Google Rest introduction, working with rest api , KBA , LOD-SF-INT , Integrations , How To

Product

SAP SuccessFactors HCM Core all versions