VS Code with sailpoint-api-client - Unable to fetch access token

This might be a simple issue but note I am brand new to VSCode and connecting, etc to a SailPoint tenant that is new to my company

VS Code - 1.86.2
Windows 10

Q: Where do I configure it so I can pass along the clientID/clientSecret values in my code.

NOTE: I have already setup and test a PAT for this environment that works in Postman and also in VS Code with the SailPoint IdentityNow extension. I have copied my 2 files (index.ts & part1.ts)


import * as part1 from './part1'

const main = async () => {
    const data = await part1.getAccounts()




import { AccountsApi, Configuration } from "sailpoint-api-client"

// List all accounts
export const getAccounts = async () => {

    let apiConfig = new Configuration()
    let api = new AccountsApi(apiConfig)

    const val = await api.listAccounts()

    return val.data


Running a simple project written in TypeScript and receiving an error:
PS C:\VSCode Projects\API Reporting\api-reporting-examples-main> npm start

[email protected] start
ts-node src/index.ts

Unable to fetch access token. Aborting.
C:\VSCode Projects\API Reporting\api-reporting-examples-main\node_modules\sailpoint-api-client\configuration.ts:240
throw new Error(error);
Error: Error: getaddrinfo ENOTFOUND {tenant}.api.identitynow.com
at Configuration. (C:\VSCode Projects\API Reporting\api-reporting-examples-main\node_modules\sailpoint-api-client\configuration.ts:240:19)
at step (C:\VSCode Projects\API Reporting\api-reporting-examples-main\node_modules\sailpoint-api-client\dist\configuration.js:56:23)
at Object.throw (C:\VSCode Projects\API Reporting\api-reporting-examples-main\node_modules\sailpoint-api-client\dist\configuration.js:37:53)
at rejected (C:\VSCode Projects\API Reporting\api-reporting-examples-main\node_modules\sailpoint-api-client\dist\configuration.js:29:65)
at processTicksAndRejections (node:internal/process/task_queues:95:5)

Hi Scott,

Please follow these directions on installing and configuring the TypeScript SDK. It will discuss how to create a configuration file that will contain your clientId and clientSecret so the SDK can generate an access token.

1 Like

Hi Colin,

I have the typeScript SDK installed. I installed it after I already had Visual Studio Code installed with the SailPoint IdentityNow extension installed.

So I am not sure how to get Visual Studio Code to recognize the clientID, etc.

When it hits this line:
import { AccountsApi, Configuration } from “sailpoint-api-client”

Do I have to modify the “sailpoint-api-client” configuration to input the clientID/clientSecret? If so, where is that configuration?

Visual Studio Code is a code editor, and regardless of what code editor you use you must follow the steps outlined in this doc to create the config.json file in your project directory for the SDK to authenticate.

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