0

How to fetch data from API_2 which needs the authentication session from another POST API in API Query Profile?

Suppose I have an API_2 which can only extract data when it has access from the authentication API. In Python we create a requests session and call the authentication API using a POST method along with some body and cookies. Once the session object is initialized, we use that object to call API_2 using a GET or POST method as required.

My question is how to do this in Matillion API Query Profile. I am able to get the response from the Authentication API by setting up the endpoint in API Query Profile 1. But i am not able to fetch any data from API_2 while setting it up in another API Query Profile 2. (FYI. I have joined the output from API Query Profile 1 to API Query Profile 2, since both the profiles are in the same job) Most probably it is because the API Query Profile 2 is not connected to the authenticated session while I am creating a new endpoint in the API Query Profile 2.

How can i do this matillion?

1 Answer 1

0

The authentication API should return a session token which is then used in API2 for further API calls. You can store the session token in a job variable using the Python component, then use the session token in the API query component for further API calls.

Sign up to request clarification or add additional context in comments.

1 Comment

How to access the session token? Is some way possible through the RSD files?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.