Files
developer.sailpoint.com/docs/tools/sdk/go/getting-started.md
darrell-thobe-sp 2cd5ccfc81 Prettified Code!
2024-04-18 10:31:05 +00:00

1.8 KiB

id, title, pagination_label, sidebar_label, sidebar_position, sidebar_class_name, keywords, description, slug, tags
id title pagination_label sidebar_label sidebar_position sidebar_class_name keywords description slug tags
go-sdk-getting-started Getting started with the Go SDK Go SDK Getting Started 1 gosdk
go
golang
sdk
start
Learn how to use the Golang SDK in this guide. /tools/sdk/go/getting-started
SDK
Software Development Kit

Once your SDK is installed and configured, you can start accessing the SDK's different functionalities. This guide will walk through some examples of this functionality. To learn how to install and configure the Golang SDK, refer to Installation and Configuration.

List Transforms

Create a file in your project called sdk.go with the following content:

package main

import (
 "context"
 "fmt"
 "os"

 sailpoint "github.com/sailpoint-oss/golang-sdk"
)

func main() {

 ctx := context.TODO()
 configuration := sailpoint.NewDefaultConfiguration()
 apiClient := sailpoint.NewAPIClient(configuration)

 resp, r, err := apiClient.V3.TransformsApi.ListTransforms(ctx).Execute()
 if err != nil {
  fmt.Fprintf(os.Stderr, "Error when calling `TransformsApi.ListTransforms``: %v\n", err)
  fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
 }
 fmt.Fprintf(os.Stdout, "All Transforms from `TransformsApi.ListTransforms`: %v\n", resp)

}

To run the code, run this command:

go run sdk.go

You can make changes to the API you are calling by changing this line:

resp, r, err := apiClient.V3.TransformsApi.ListTransforms(ctx).Execute()
  • To call a different version of the APIs, change V3 to Beta, V2, or CC.
  • To call a different API collection, change TransformsApi to another collection, like SourcesApi, for example.
  • To call a different endpoint, change ListTransforms to another endpoint, like GetTransform, for example.