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.
Click on the dropdown list and select the environment you have created on Part 1 of this article.
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.
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.
Once more we will fill the request tab with information needed to perform a request.
Click on Add Param and enter __p1 and the date, then click on the Save button.
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.
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.
If the request is successful, the token data will appear on the response body and will be transferred to our accessToken variable.
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.
Then click on Send Request to download data.
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.
Now you know how to call SAP Fieldglass connectors using an API client.
And If you missed the other articles:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
14 | |
5 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |