# 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:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![npilley](https://avatars.discourse-cdn.com/v4/letter/n/f4b2a3/32.png) [@npilley](https://developer.sailpoint.com/discuss/u/npilley)\
**Post date:** [March 31, 2023, 7:08pm UTC](https://developer.sailpoint.com/discuss/t/postman-api-calls/9863/1 "2023-03-31T19:08:35Z")

</div>

Happy Friday all!  
I am not a developer and never claimed to be, but am the admin for IDNow and have been using Postman for about four years now. I keep having issues with the new API calls and I cannot figure out what I’m doing wrong or what I don’t have configured correctly. I followed the API doc about making your first API call and setup my PAT in IDNow. I also setup my new environment variables within Postman. However, I keep getting a 401 error saying that the “JWT is required”. After talking with an ex-SailPoint engineer, he had me remove the access-token and access-expiry values that were being populated during a successful call. That day, I made several successful API calls. Now… It’s a new day and clearing those values out is not working and I need to load a new transform prior to testing next week. Can anyone please tell me WTH am I doing wrong here?!

Thanks!  
Nate

 ![Postman_Issues](https://global.discourse-cdn.com/sailpoint/original/2X/5/5b8e46b10c96c7445306316bd146f74826634704.png)

---

<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!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [July 19, 2023, 2:24pm UTC](https://developer.sailpoint.com/discuss/t/postman-api-calls/9863/3 "2023-07-19T14:24:43Z")

</div>


