Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
carlcimino
Luminary
Luminary

Rest Connector with SAP Concur

Hello I am trying to connect to SAP Concur (Travel & Expense Mgmt system) via REST connector.  SAP Concur uses OAuth 2.0 authentication so I know I have to use one rest connection to access the token and pass it to a variable and then a 2nd rest connection that uses the info stored to variable.  I have used Postman to walk through the POST and GET steps and it works fine there (1st Screen shot).  However when I enter the information into Qlik Connector I get a 400 error (screen shot below).  Has anyone successfully implemented this?  I see a number of discussions on the topic but it seems to be a common frustration.

Postman SuccessfulPostman Successful

10-29-2019 10-42-16 AM.jpg

Labels (2)
3 Replies
carlcimino
Luminary
Luminary
Author

I have learned that in order for this to work there are a couple caveats that were not well documented.

For the first rest connection to get the authorization token:

1) The body portion of the POST connection has to be URL encoded.

2) The query header(s) must be exactly as they worked in postman or other API accessing software

3) You have to store the token to variable using peek() and use a trace() function to expand the variable and be able to copy/paste it into your 2nd rest connection.

For the second rest connection using GET to utilize the token from the first rest connection:

1) The first time setting up the second rest connection you have to manually copy and paste the token into the query headers.

10-31-2019 10-15-33 AM.jpg

2) Click the select data icon and pick the tables from root you want to bring in and click insert script.

10-31-2019 9-00-48 AM.jpg

3) After qlik inserts the script you have to alter the From portion to include your variable by including a clause that says  WITH CONNECTION.

FROM JSON (wrap on) "root" PK "__KEY_root"
WITH CONNECTION (
HTTPHEADER "Authorization" "Bearer $(vAccessTokenValue)"
);

4) You should be able to load this data repeatedly once you have it set up the first time. 

5) So far I have not found a way to "inject" the variable into the second Rest connection should I want to click the select data icon and create a different load script.  The problem here is if your token has expired you will need to re-run the 1st query, copy/paste the updated variable value into the 2nd connection and then click the select data icon.

Hope some of these pointers help.  I also attached the Qlik documentation on this that was lacking for folks that are not familiar with using APIs/JSON/Rest connections.

alantam12
Partner - Contributor
Partner - Contributor

Were you able to pull all records from the Expense Entries?  I am having trouble as it only fetches me 25 records.

carlcimino
Luminary
Luminary
Author

No we were not successful and abandoned the effort via Qlik.  The solution was to have our IT/data provisioning team set up a daily ingestion process to bring the data into our Azure SQLDW.  We then attached Qlik to the Azure dataset.