Spend Management Blogs by SAP
Stay current on SAP Ariba for direct and indirect spend, SAP Fieldglass for workforce management, and SAP Concur for travel and expense with blog posts by SAP.
cancel
Showing results for 
Search instead for 
Did you mean: 
josie_n
Product and Topic Expert
Product and Topic Expert

Part 3 – Calling Download Connectors Using a Token

In this article we will show you how to call a download connector using the token that we have obtained previously on Part 1.

 

HINT: Before doing any upload or download REST call you need to get a token first; in our example we use the Get Token request. And don’t forget to check if your environment is selected before calling the get token request.

To do that, just select any of your collection’s requests and check on the upper right of the screen if your environment is being used. On the example below the environment is not selected.

josie_n_0-1712081312892.png

Click on the dropdown list and select the environment you have created on Part 1 of this article.

josie_n_1-1712081379565.png

We will need the environment variables to get and pass the token, and to do our other connector calls.

 

Pre-Requisites

Before setting up your download request make sure that you have your download connector tuned on. This can be done using the Connector Wizard on Configuration Manager.

 

Creating a Download Request

Click on the three dots on you collection name and chose New Request.

josie_n_2-1712081534310.png

Next a new window will open to add a Name and the URL. Give a name for you request and for the URL field we will use the base URL variable we have created, add /api/vc/connector/ , and at the end of it the custom connector name. After filling all fields click on Create.

josie_n_3-1712081643388.png

 

Once more we will fill the request tab with information needed to perform a request.

  1. Query – On this tab we will add any parameters needed for the connector call. The connector we are using requires a date parameter. For SAP Fieldglass connector every time we need to pass parameters we will user parameter __p1 (double underscore p1).

Click on Add Param and enter __p1 and the date, then click on the Save button.

josie_n_4-1712081790356.png

2 . Auth - Here we will set the authentication type and pass the token obtained on Get Token request using the environment variables. Click on the dropdown list and select the authentication type Bearer Token. A field will show to add the token variable. Then click on Save.

josie_n_5-1712081960427.png

 

Testing

Now that we are all set, let’s test our request.

First, let’s authenticate and get a token. Click on your Get Token request on the left panel or select the Get Token tab and then click on Send Request.

josie_n_6-1712082383331.png

If the request is successful, the token data will appear on the response body and will be transferred to our accessToken variable.

josie_n_7-1712082427936.png

Then select you download request tab and let’s check if whether the token was transferred correctly. Click on the Auth tab and hover over mouse over the accessToken variable. The token value must be shown.

josie_n_8-1712082694328.png

Then click on Send Request to download data.

josie_n_9-1712082750508.png

Usebruno will make the request and if it is successful the data will show on the right side of the screen. On our example the request was successful (200) and the log is shown.

josie_n_10-1712082783803.png

 

Now you know how to call SAP Fieldglass connectors using an API client.

 

And If you missed the other articles: 

Part 1 - Getting a Token.

Part 2 – Calling Upload Connectors Using a Token