Exchange Token
client.Organizations.ExchangeToken(ctx, organizationID, body) (*TokenResponse, error)
POST/organizations/{organization_id}/token
Exchange user token for organization-scoped M2M token
Parameters
organizationID string
Organization ID or label identifier
minLength1
maxLength255
Returns
Exchange Token
package main
import (
"context"
"fmt"
"github.com/keycardai/keycard-go"
)
func main() {
client := keycard.NewClient(
)
tokenResponse, err := client.Organizations.ExchangeToken(
context.TODO(),
"x",
keycard.OrganizationExchangeTokenParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", tokenResponse.AccessToken)
}
{
"access_token": "access_token",
"token_type": "Bearer",
"expires_in": 3600
}Returns Examples
{
"access_token": "access_token",
"token_type": "Bearer",
"expires_in": 3600
}