Pass POST Response to GET Headers

Hello Outsystems Community,


I am looking to integrate data from an external site using APIs as a means to use as a 'pseudo-database' for an app of mine. I am still new to the world of APIs but I'm learning nevertheless.

I currently have two calls to a consume REST API, one being a POST request to get the token for the subsequent API calls and a GET request to get all the users of the integration, and eventually populate a pre-defined entity or table with users of a specific username.

My question is: I have the POST request's response stored in a session variable named 'APIToken'. Currently, my GET request can be accessed through the Request header: "Authorization" and response header with "Bearer{APIToken}". Though currently I have to type the token in manually in order for it to work. How do I pass the session variable I created through the POST requests into the Reponse Header for the GET request?

Cody Zehner wrote:

Hello Outsystems Community,


I am looking to integrate data from an external site using APIs as a means to use as a 'pseudo-database' for an app of mine. I am still new to the world of APIs but I'm learning nevertheless.

I currently have two calls to a consume REST API, one being a POST request to get the token for the subsequent API calls and a GET request to get all the users of the integration, and eventually populate a pre-defined entity or table with users of a specific username.

My question is: I have the POST request's response stored in a session variable named 'APIToken'. Currently, my GET request can be accessed through the Request header: "Authorization" and response header with "Bearer{APIToken}". Though currently I have to type the token in manually in order for it to work. How do I pass the session variable I created through the POST requests into the Reponse Header for the GET request?

Hi,

Can you share the request Structure for the Same?


assif_tiger wrote:

Cody Zehner wrote:

Hello Outsystems Community,


I am looking to integrate data from an external site using APIs as a means to use as a 'pseudo-database' for an app of mine. I am still new to the world of APIs but I'm learning nevertheless.

I currently have two calls to a consume REST API, one being a POST request to get the token for the subsequent API calls and a GET request to get all the users of the integration, and eventually populate a pre-defined entity or table with users of a specific username.

My question is: I have the POST request's response stored in a session variable named 'APIToken'. Currently, my GET request can be accessed through the Request header: "Authorization" and response header with "Bearer{APIToken}". Though currently I have to type the token in manually in order for it to work. How do I pass the session variable I created through the POST requests into the Reponse Header for the GET request?

Hi,

Can you share the request Structure for the Same?



For the POST call? Request: Content-Type, Response: application_xwwwformurlencoded.

The URL I am calling looks like this: {host}/api/public/v1/oauth2/token?grant_type=client_credentials. Let me know if that answers your inquiry.

Thank you for your reply, assif_tiger. I think this will work for what I need!