# Postman API Calls

**URL:** <https://developer.sailpoint.com/discuss/t/postman-api-calls/9863>\
**Category:** SHF Discussion and Questions\
**Tags:** apis\
**Created:** [March 31, 2023, 7:08pm UTC](https://developer.sailpoint.com/discuss/t/postman-api-calls/9863 "2023-03-31T19:08:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tyler\_mairose](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/tyler_mairose/32/30112_2.png) [@tyler\_mairose](https://developer.sailpoint.com/discuss/u/tyler_mairose)\
**Post date:** [March 31, 2023, 8:54pm UTC](https://developer.sailpoint.com/discuss/t/postman-api-calls/9863/2 "2023-03-31T20:54:47Z")

</div>

Hello @npilley,

Welcome to the Sailpoint Developer Community!

If you are using the latest official postman collections you’ll want to make sure the following information is in place.

Check that the collection environment variables are set correctly. Click on the collection name `IdentityNow V3 APIs` that you have forked and verify that the `domain` and `baseUrl` are set on the Variables Tab.

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/6/6378e01c7358605a8bb2dd0af9dbb624ebf90350.png)

Next, verify that you have the `Authorization` tab using the environment variable `accessToken` for authenticating to our APIs.

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/8/8314b6f7a82440e6c1c0369a5b03f9f28d7e7c30.png)

On the `Pre-request Script` tab verify that you have the latest script for retrieving and storing your accessToken.

```javascript
const domain = pm.environment.get('domain') ? pm.environment.get('domain') : pm.collectionVariables.get('domain')
const tokenUrl = 'https://' + pm.environment.get('tenant') + '.api.' + domain + '.com/oauth/token';
const clientId = pm.environment.get('clientId');
const clientSecret = pm.environment.get('clientSecret');

const getTokenRequest = {
    method: 'POST',
    url: tokenUrl,
    body: {
        mode: 'formdata',
        formdata: [{
                key: 'grant_type',
                value: 'client_credentials'
            },
            {
                key: 'client_id',
                value: clientId
            },
            {
                key: 'client_secret',
                value: clientSecret
            }
        ]
    }
};

var moment = require('moment');
if (!pm.environment.has('tokenExpTime')) {
    pm.environment.set('tokenExpTime', moment());
}

if (moment(pm.environment.get('tokenExpTime')) <= moment()) {
    var time = moment();
    time.add(12, 'hours');
    pm.environment.set('tokenExpTime', time);
    pm.sendRequest(getTokenRequest, (err, response) => {
        const jsonResponse = response.json();
        const newAccessToken = jsonResponse.access_token;
        pm.environment.set('accessToken', newAccessToken);
    });

}

```

Finally, you will need an environment like the one you have included in your post with only the following values.

| Environment Variable | Required | Description |
| --- | --- | --- |
| tenant | \* | This is your IdentityNow tenant, typically your company’s name. |
| clientId | \* | This is the client ID for the API client or personal access token. |
| clientSecret | \* | This is the client secret for the API client or personal access token. |
| domain | | This field is optional and is only needed for a select few who may have a domain in their API URL that differs from “identitynow”. |

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/1/1bea2f5d6ec3608733587af7db799da0bcd25496.png)

Please let us know if you still experience issues!

---

_[View the full topic](https://developer.sailpoint.com/discuss/t/postman-api-calls/9863)._
