Articles in this section

Configure the path to token field in the HTTP response header

Some APIs require you to retrieve an access token from the headers of the response returned by the initial request.

For example:

  1. You make an initial call to a /login endpoint with your username and password to get an access token.

  2. Upon making that API call, you get the access token returned in the response header.

  3. You then use the returned access token for subsequent API requests.

The handlebar expression you create needs to return the access token. integrator.io allows you to do this in a variety of ways depending on how the access token is returned in the header.

NOTE: All of the returned response headers are set to lowercase. Because of this, all your handlebar expressions will need to reference the header field in lowercase even if you see something different within Postman.

Response header key Response header value Handlebar helper
Authorization
eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiII8P43aZQX0bdjfQ39CCiZ6ZiLWM
{{{responseHeaders.authorization}}}
a4.png
Authorization
Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI3MTMzZjIwNy03YmVlLTQzZiLWM
{{{split responseHeaders.authorization ' ' 1}}}
a5.png
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.