Skip to main content
Solved

POST request body REST connection


We have an API in which we have to pass a POST request with a request body to obtain the data. In Qlik Sense and Postman we have a basic connection established. However, there you can easily specify that the call should be a POST and you can also easily fetch the request body. In the CDATA REST connector in TX, we do not know where to fetch this request body in the connection. 

The demo endpoint we are trying to connect is:

https://api.mews-demo.com/api/connector/v1/configuration/get

with the request body:

{

"ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",

"AccessToken": "7059D2C25BF64EA681ACAB3A00B859CC-D91BFF2B1E3047A3E0DEC1D57BE1382",

"Client": "NameOfYourCompanyOrApplication"

}

Any help would be appreciated.

Best answer by wouter.goslinga

Hi Jeroen,

Did you read this thread: 

 

Perhaps you can modify your RSD file like this, probably you have to put the JSON string with the token in the following place:
 

 

View original
Did this topic help you find an answer to your question?

9 replies

wouter.goslinga
TimeXtender Xpert
Forum|alt.badge.img+2

Hi Jeroen,

It looks like as if you need to set up OAUTH2 to obtain a token to connect to the API. Can you show your data source connection settings?


  • Author
  • Participant
  • 13 replies
  • May 23, 2023

Hi Wouter, thanks for your reply.

We already have all the tokens we need. We do not need a get and/or refresh token, since the tokens we have do not expire. They are fixed and set to a specfic user. By providing these in the request body in a POST statement, we will get our desired output. 

In for example QS and Postman this is easy to find. However, we do not know where to put these in the CDATA connector. 


wouter.goslinga
TimeXtender Xpert
Forum|alt.badge.img+2

Hi Jeroen,

Did you read this thread: 

 

Perhaps you can modify your RSD file like this, probably you have to put the JSON string with the token in the following place:
 

 


Thomas Lind
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 1017 replies
  • May 23, 2023

While the above may be a possible solution. It may also be possible using the normal OAuth setup in the REST provider to make it work.

The client could be a OAuth Parameter field and then it could work without using any RSD files.


  • Author
  • Participant
  • 13 replies
  • May 23, 2023

@wouter.goslinga Thanks!, finally getting some results using the following rsd. However, this will require us to write the metadata for every table.

@Thomas Lind Will have a look at your suggestion too.

 


Thomas Lind
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 1017 replies
  • May 23, 2023

Hi @JeroenS 

You can pull the values from the setup by using something like

[_connection._clienttoken]


wouter.goslinga
TimeXtender Xpert
Forum|alt.badge.img+2

@JeroenS maybe you can do the following:

  • turn on logging for the datasource
  • find the get call in the log and see how the json string is parsed in the connection string
  • add this as a custom connection string parameter in the data source

  • Author
  • Participant
  • 13 replies
  • June 8, 2023

What I did to retrieve the metadata:

-Run the request in Postman

-Save the output as .json

-Read it in TimeXtender with schema generation

-Copy the metadata into our RSD


Thomas Lind
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 1017 replies
  • June 8, 2023
JeroenS wrote:

What I did to retrieve the metadata:

-Run the request in Postman

-Save the output as .json

-Read it in TimeXtender with schema generation

-Copy the metadata into our RSD

That is how I do it as well.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings