Open Navigation

The Main Process


Certain tasks, such as creating users, must be executed with the Master API token (obtained from the Partner Dashboard) and other tasks, such as creating a Solution Instance for an End User, must be executed using a user access token (a persistent token valid for 2 days that should be securely stored in your application). Further, in order to initiate the pop-up Configuration Wizard for a user, a one-time access code must be generated for that user.

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 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 - using a button to hand over the Solution Instance configuration to our End User Config Wizard in a pop-up or iframe.

Steps in the Main Process

  1. Register and authorize a new user so that you have the required access token (must be persistently and securely stored for re-use in your application. A new token should only be generated if the original one expires, which it will do after 2 days) for making user queries and mutations to the APIs (see Create User and Authorize User). A new user will be issued with a Tray userId (note that you can import external data about a user and import authentications to save a user who is already registered with your service from having to do so again)

  2. List the solutions in your partner account that are available for End Users to configure for their own use (see List Solutions). These would typically be displayed in a UI which allows the user to select which solution they wish to activate and create a Solution Instance.

  3. Allow the user to click on one of the listed solutions and activate the pop-up Configuration Wizard. This involves obtaining a one-time authorizationCode (see Authorization Code) and obtaining a solutionInstanceId with Create Solution Instance. At this point the pop-up url must also be passed in the format:${partnerId}/configure/${solutionInstanceId}?code=${authorizationCode}

    In the above url remember that ${partnerId} is the value that you set when configuring your Config Wizard CSS

    Note on Browser Compatibility: The Tray Config Wizard supports the major desktop and mobile browsers Chrome, Firefox, Safari (9.1+ desktop and 9.3+ iOS), Opera, Android (and Android UC) and Edge (version 14 and above). It does not support Internet Explorer.

  4. Enable the Solution - once the user has entered their configuration and a Solution Instance has been created, the final step is to use the updateSolutionInstance mutation to set the status to 'enabled'.

  5. If underlying workflows and Solutions are updated in any way, it is possible to publish new Solution Releases and then update any Solution Instances which have been activated by your End Users.

Testing the full process

Please see the next page on Manually testing the full process for step-by-step instructions on getting the full process tested and working before you begin developing your application.

This will show how to use the API Playground to create a user and their access token and then create a Solution Instance and activate the Configuration Wizard by pasting the url in your browser.

The process of doing this will give you a very good feel for what is required to manage Solutions, End Users and Solution Instances in your application.

Required token types

To fully familiarize yourself with the required token types (Master/User) for the APIs involved in each stage of the process, it is recommended you follow the steps at Manually testing the full process.

The required tokens are also indicated on the individual API pages, plus there is a reference table of required token types

Was this article helpful?