Skip to content

Instantly share code, notes, and snippets.

@prashanth-sams
Last active August 29, 2017 12:27
Show Gist options
  • Select an option

  • Save prashanth-sams/c47036bc6534dae9ad216d2801ae5e92 to your computer and use it in GitHub Desktop.

Select an option

Save prashanth-sams/c47036bc6534dae9ad216d2801ae5e92 to your computer and use it in GitHub Desktop.
Postman API

Response Body

{
  "data": {
    "type": "access_token",
    "id": "",
    "attributes": {
      "token_type": "Bearer",
      "access_token": "xxxxxxxxxxxxxxxxx"
    }
  }
}

Tests

var jsonData = JSON.parse(responseBody);
postman.setEnvironmentVariable("app_token", jsonData.data.attributes.access_token);
postman.setEnvironmentVariable("app_token_type", jsonData.data.attributes.token_type);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment