Closed nilayanand closed 1 week ago
package main import ( "fmt" "os" "github.com/onelogin/onelogin-go-sdk/v4/pkg/onelogin" "github.com/onelogin/onelogin-go-sdk/v4/pkg/onelogin/models" ) func main() { os.Setenv("ONELOGIN_CLIENT_ID", "client_id") os.Setenv("ONELOGIN_CLIENT_SECRET", "client secret") os.Setenv("ONELOGIN_SUBDOMAIN", "subdomain") os.Setenv("ONELOGIN_TIMEOUT", "15") ol, err := onelogin.NewOneloginSDK() if err != nil { fmt.Println("Unable to initialize client:", err) return } users := []int{1234} // replace 1234 with actual user id apiResp, err := ol.AddRoleUsers(4321, users) // replace 4321 with actual role id if err != nil { fmt.Println("Failed to add users to role:", err) return } fmt.Println("Response:", apiResp) }
DEVEX-1619 Fix adding admins and users for roles api call
Test using following Golang code