Get Solution Instances (user/master token)
POST https://{{base_url}}/graphql
Return the Solution Instances associated with a particular user.
Pay particular attention to solutionVersionFlags as a piece of returned data, which indicates if the Instance needs upgrading due to new information being required from the End User.
Use example requests from the right to try simple local tests with curl, js, python etc. (note you will still be interacting with live data when using master and user tokens!)
You can find example usage of this as a backend-only API in our Embedded sample app (remember that client-side Javascript calls to the API will be blocked by CORS):
queries.solutionInstances
in server/api.js referencessolutionInstances
in server/graphql.js
Required token | Notes |
---|---|
Master | If using a Master token it is possible to filter Solution Instances by the owner of the Solution Instance, or by the ID of the Solution which it came from |
User | If a User token is used, the Solution Instances displayed will only be those owned by that End User |
The query accepts the following filter criteria:
Criteria | Notes |
---|---|
solutionId | Can be used to filter based on the Solution which the Instance came from. If used with a User Token it will only return instances owned by that user |
owner | This is the userId of an End User. Can only be used with a Master Token, in order to filter Solution Instances of a particular user |
Note that it is possible to filter by both owner and solutionId at the same time.
Returned Data | Subfields | Notes |
---|---|---|
totalCount | Note this is a top-level field, so is specified before 'edge' as per example query below The results returned by the totalCount will depend on the filter criteria specified: If solutionId is specified the total count will refer to the solution instances for that particular solution If owner (userId) is specified (when using a Master Token) the total count will refer to the solution instances for that end user If owner and solutionId are both specified the total count will refer to the solution instances for that user and for that solution | |
id | the solutionInstance id | |
name | the name (derived from the parent Solution) | |
enabled | boolean to indicate whether the solutionInstance has been activated using Update Solution Instance | |
created | the date and time the solutionInstance was created | |
solutionVersionFlags | hasNewerVersion requiresUserInputToUpdateVersion requiresSystemInputToUpdateVersion | used to indicate if an underlying Solution has a newer version which might need upgrading as explained in Updating / Upgrading Solution Instances |
solution | id title description customFields configSlots | details of the parent Solution |
workflows | id triggerUrl sourceWorkflowId sourceWorkflowName | triggerUrl is the webhook url for the End User's version of that workflow (see Retrieving Webhook URLs) |
configValues | externalId value | any config data that has been set for the End User of the solutionInstance |
authValues | externalId authId | authentications associated with this solutionInstance |
Pagination
You can paginate the results of this query using the methods discussed in Pagination
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Authorization | string | ||
Authorization | string |
RESPONSES
status: OK
{"data":{"viewer":{"solutionInstances":{"edges":[{"node":{"id":"533d48e8-XXXX-XXXX-XXXX-74ff887198d3","name":"Sample Instance","enabled":true,"owner":"13b3ab9c-XXXX-XXXX-XXXX-c4dd07fbbfa4","created":"2019-12-03T21:11:09.456Z","solution":{"id":"b73d4e07xxx-xxx-xxx-xxx-xxxafad23d94","title":"Slack webhook solution","description":"sends a message to a slack channel of your choice"},"solutionVersionFlags":{"hasNewerVersion":true,"requiresUserInputToUpdateVersion":true,"requiresSystemInputToUpdateVersion":false},"workflows":{"edges":[{"node":{"triggerUrl":null,"id":"89f8ebeb-XXXX-XXXX-XXXX-be070f3cd0f8","sourceWorkflowId":"3af6461f-XXXX-XXXX-XXXX-91ada5769f90"}}]},"authValues":[{"externalId":"external_slack_authentication","authId":"dcbc11f1-XXXX-XXXX-XXXX-b7f90dafcf28"}],"configValues":[]},"cursor":"NTMzZDQ4ZTgtNjM2Zi00M2FkLTk1ZjItNzRmZjg4NzE5OGQz"}],"pageInfo":{"startCursor":"NTMzZDQ4ZTgtNjM2Zi00M2FkLTk1ZjItNzRmZjg4NzE5OGQz","endCursor":"NTMzZDQ4ZTgtNjM2Zi00M2FkLTk1ZjItNzRmZjg4NzE5OGQz","hasNextPage":false,"hasPreviousPage":false}}}}}