Forum Discussion

djsiegel's avatar
djsiegel
Former Employee
2 years ago

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

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:

Secured Headers Account Type configuration:

 

 

2 Replies

  • terrible_towel's avatar
    terrible_towel
    New Contributor II

    You were right, as no account is needed. I played with it a bit and was able to extract the portion in the cookies that was necessary for the auth. Thanks a bunch!

    • Matthias's avatar
      Matthias
      New Contributor III

      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.