cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How do I extract data from an API, using a post request, with the HTTP Client snap?

terrible_towel
New Contributor II

Hi,

The API owner demands I use a post request first, then get authorized by getting a user token and a cookie token, and only then I can do a get request to retrieve the data. I was able to configure the first part properly, in the screenshot below:

terrible_towel_0-1704214044214.png

This retrieves a header with a token for the user, and the cookie. My question is - what do I do next? how do I configure the next HTTP Client snap in order to retrieve the data with the get request, and what do I choose as an account? should I use the cookies as a token for the account?

Thanks

1 ACCEPTED SOLUTION

Ah - its going to depend on the API itself. Likely NO account is required, since you've got a token you're going to pass in a header.  I did this recently in an example with monday.com that required only a header being passed. For this, I used the "Secured Headers" type HTTP account, no schema (unless yours requires a specific schema), and just put the needed headers under "Additional auth headers". 

HTTP Client Config:

djsiegel_0-1704242498980.png

Secured Headers Account Type configuration:

djsiegel_1-1704242578295.png

 

 

View solution in original post

5 REPLIES 5

How did you handle the secure storage of the initial credentials (client_id, client_secret)?

I've found this to be an impossible task with http client snaps - and hence had to revert to rest snaps for the initial auth - which allows some basic account types to provide the password as `account.password` and `account.username`  in the post body.

For now, i've however not found an alternative for this with http-client.

 

Matthias_0-1704808168030.png