In article video

Tokens are valid for up to 1 hour so you’ll need to get a new one a few times during the day. Sessions, however, have a much longer lifetime and are valid until you log out in the browser.

Create a new request that will obtain a fresh token and save it to an environment variable.

  1. The request should POST to https://kinja.com/api/profile/token/create, the request body can be empty.
  2. On the Headers tab add a new Cookie header with the value KinjaSession={{KinjaSession}}. Postman will substitute {{KinjaSession}} with the environment variable you saved.
  3. On the Tests tab paste the script below. Postman will run this JavaScript code after the request completes to extract the token from the response and save it in the KinjaToken environment variable.
Advertisement

Tokens are valid for up to 1 hour so you’ll need to get a new one a few times during the day. Sessions, however, have a much longer lifetime and are valid until you log out in the browser.

Create a new request that will obtain a fresh token and save it to an environment variable.

  1. The request should POST to https://kinja.com/api/profile/token/create, the request body can be empty.
  2. On the Headers tab add a new Cookie header with the value KinjaSession={{KinjaSession}}. Postman will substitute {{KinjaSession}} with the environment variable you saved.
  3. On the Tests tab paste the script below. Postman will run this JavaScript code after the request completes to extract the token from the response and save it in the KinjaToken environment variable.

Share This Story