Open Navigation

Authorization code

Note: The Tray GraphQL API is a backend API only and calls must be invoked server-side. Client-side Javascript calls to the API should not be made as they will be blocked by CORS. Our demo app (built using https://www.apollographql.com/) is a good illustration of how you can create a UI which presents an End User with their available Solutions while making all API calls server-side.


This mutation is used to generate the one-time authorization code which is required to allow a user to access the Configuration Wizard by appending it to the https://embedded.tray.io/external/solutions/${partnerId}/configure/${solutionInstanceId}?code=${authorizationCode} url.

Required TokenNotes
Masterobtained from the Tray app UI

The mutation accepts the following as inputs:

InputRequiredNotes
userIdYesobtained when creating a user or querying a user
clientMutationIdNoOnly relevant if using the Relay GraphQL client

It can return the following data:

Returned DataNotes
authorizationCodethis is required to activate the Configuration Wizard
clientMutationIdOnly relevant if using the Relay GraphQL client

The following is a mutation which could be used in the GraphQL playground (please see Create Solution Instance for a javascript example)

mutation {
generateAuthorizationCode(input: {userId: "fbb96559-4d48-8e45-7yf4-5552c2d2fca4"}) {
authorizationCode
}
}

Response:

{
"data": {
"generateAuthorizationCode": {
"authorizationCode": "490dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx674074"
}
}
}
Was this article helpful?
Yes
No