# Postman api configuration

**URL:** <https://developer.sailpoint.com/discuss/t/postman-api-configuration/16891>\
**Category:** SHF Discussion and Questions\
**Tags:** apis, identity-security-cloud\
**Created:** [August 30, 2023, 12:36pm UTC](https://developer.sailpoint.com/discuss/t/postman-api-configuration/16891 "2023-08-30T12:36:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajaypathak1](https://avatars.discourse-cdn.com/v4/letter/a/c57346/32.png) [@ajaypathak1](https://developer.sailpoint.com/discuss/u/ajaypathak1)\
**Post date:** [August 30, 2023, 12:36pm UTC](https://developer.sailpoint.com/discuss/t/postman-api-configuration/16891/1 "2023-08-30T12:36:30Z")

</div>

I have configured postman by forking the api from this link.

> [@Official: IdentityNow Postman Workspace](https://developer.sailpoint.com/discuss/t/official-identitynow-postman-workspace/6153):
>
> Update: This guide can now be found in the API docs here: [https://developer.sailpoint.com/idn/api/postman-collections](https://developer.sailpoint.com/idn/api/postman-collections)IdentityNow Postman Workspace Here you will find the official Postman Workspace for IdentityNow APIs. If you have any questions, comments, suggestions, or issues with this workspace or any collections within, let us know here. Getting Started You will forever find the IdentityNow workspace here: [IdentityNow Postman workspace](https://www.postman.com/sailpoint/workspace/identitynow) You can also click these buttons if you just want…

and went thru the steps for configuration. still getting the error when making the api call.

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

---

<div class="post-metadata">

**Author:** ![iamnithesh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamnithesh/32/4884_2.png) [@iamnithesh](https://developer.sailpoint.com/discuss/u/iamnithesh)\
**Post date:** [August 30, 2023, 3:47pm UTC](https://developer.sailpoint.com/discuss/t/postman-api-configuration/16891/2 "2023-08-30T15:47:01Z")

</div>

As you can see in the error message Pre-request script is not able to read your tenant (shown `undefined`).

```auto
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';

```

I would start with tracing `pm.environment.get('tenant')` in the environmet variables. It could a simple error as tenant being misspelt

---

<div class="post-metadata">

**Author:** ![mcheek](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/mcheek/32/23705_2.png) [@mcheek](https://developer.sailpoint.com/discuss/u/mcheek)\
**Post date:** [August 30, 2023, 3:51pm UTC](https://developer.sailpoint.com/discuss/t/postman-api-configuration/16891/3 "2023-08-30T15:51:16Z")

</div>

It’s very common for people to forget to define an environment… and more importantly, actually select the environment from the drop-down after creating it 😀

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [September 19, 2023, 1:11pm UTC](https://developer.sailpoint.com/discuss/t/postman-api-configuration/16891/4 "2023-09-19T13:11:26Z")

</div>

I can see in the screenshot that your tenant is “undefined”. @mcheek is correct, in that you likely did not setup your postman environment correctly. Please follow this guide very closely.

> **[Postman Collections | SailPoint Developer Community](https://developer.sailpoint.com/idn/api/postman-collections#configure-your-environment)**
>
> How to run the APIs in Postman.

---

<div class="post-metadata">

**Author:** ![gladstoneabrahamr](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/gladstoneabrahamr/32/4232_2.png) [@gladstoneabrahamr](https://developer.sailpoint.com/discuss/u/gladstoneabrahamr)\
**Post date:** [September 20, 2023, 5:32pm UTC](https://developer.sailpoint.com/discuss/t/postman-api-configuration/16891/5 "2023-09-20T17:32:48Z")

</div>

In some cases, I get a an error saying

```auto
{
    "error": "JWT validation failed: JWT is expired"
}

```

Not sure how I reach this point, but somewhere my “tokenExpTime” variable gets an empty value and I start seeing this error.

Once I just delete the “tokenExpTime” variable from environment and make another API call. The Pre-request scripts refreshes the token as expected.

Should we update the pre-request script to handle empty strings?

Does anyone else face this issue?

---

<div class="post-metadata">

**Author:** ![mcheek](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/mcheek/32/23705_2.png) [@mcheek](https://developer.sailpoint.com/discuss/u/mcheek)\
**Post date:** [September 20, 2023, 6:08pm UTC](https://developer.sailpoint.com/discuss/t/postman-api-configuration/16891/6 "2023-09-20T18:08:27Z")

</div>

Try updating your collections to the latest version. I believe there was a fix for that at some point

---

<div class="post-metadata">

**Author:** ![gladstoneabrahamr](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/gladstoneabrahamr/32/4232_2.png) [@gladstoneabrahamr](https://developer.sailpoint.com/discuss/u/gladstoneabrahamr)\
**Post date:** [September 20, 2023, 6:13pm UTC](https://developer.sailpoint.com/discuss/t/postman-api-configuration/16891/7 "2023-09-20T18:13:28Z")

</div>

Oh,

Thanks @mcheek , will update and check again. Been a while sine I updated the Postman collections.

---

<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:** [November 19, 2023, 6:14pm UTC](https://developer.sailpoint.com/discuss/t/postman-api-configuration/16891/8 "2023-11-19T18:14:20Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
