A template project for the SailPoint Go SDK. It is initialized using the SailPoint CLI and provides working examples of common Identity Security Cloud API calls using the Go SDK.
- Go version 1.18 or above (download)
- SailPoint CLI installed and configured (installation guide)
- A SailPoint Identity Security Cloud tenant
- A Personal Access Token (PAT) with a client ID and client secret (creating a PAT)
Use the SailPoint CLI to create a new project from this template:
sail sdk init golang go-exampleThis creates the following project structure:
go-example/
├── go.mod
├── go.sum
└── sdk.go
cd go-examplego mod tidyThe SDK needs credentials to authenticate with your SailPoint tenant. Generate a config.json file using the CLI:
sail sdk init configThis creates a config.json in the project directory using your currently configured CLI credentials. The file looks like this:
{
"ClientId": "your-client-id",
"ClientSecret": "your-client-secret",
"BaseURL": "https://[tenant].api.identitynow.com"
}If you have multiple environments configured in the CLI, specify which one to use:
sail sdk init config --env devrelTip: Add
config.jsonto your.gitignoreso credentials are not committed to version control.
go run sdk.goThe sdk.go file contains several example functions demonstrating common SDK operations:
| Function | Description |
|---|---|
getBeta |
Lists accounts using the Beta API |
getResults |
Lists accounts using the V3 API |
getSearchResults |
Performs an identity search using PaginateSearchApi |
getTransformResults |
Lists transforms using the V3 API |
getAllPaginatedResults |
Demonstrates automatic pagination with PaginateWithDefaults |
By default, the main function calls getBeta. You can uncomment or swap in any of the other functions to try different API calls.
- Change the endpoint — swap
ListAccountsfor another method likeGetAccountorListSources. - Change the API collection — swap
AccountsAPIfor another collection likeTransformsAPIorSourcesAPI. - Change the API version — swap
V3forBeta,V2, orCCto access different API versions.