Solutions

Solutions represent the integrations you have built with Tray.

Get solutions (master token)

post/

Retrive a list of solutions using various filters and pagination parameters.

Click 'Examples' to see different types of queries you can make when listing solutions

Required Token Notes
Master Obtained from the Tray app UI. Refer this.

The query accepts the following criteria:

Criteria Notes
tags If you have created tags in the Solution Editor, this field can be used to filter Solutions in your external application

Here are some example queries:

Get all solutions

query {
  viewer {
    solutions {
      edges {
        node {
          id
          title
          description
          tags
          customFields {
            key
            value
          }
          configSlots {
            externalId
            title
            defaultValue
          }
          authSlots {
            externalId
            title
          }
        }
        cursor
      }
      pageInfo {
          hasNextPage
          endCursor
          hasPreviousPage
          startCursor
      }
    }
  }
}

Get solutions by tag(s)

query {
  viewer {
    solutions (criteria: { tags: [
        "marketing",
    "marketo"
    ] }) {
      edges {
        node {
          id
          title
          description
          tags
          customFields {
            key
            value
          }
          configSlots {
            externalId
            title
            defaultValue
          }
          authSlots {
            externalId
            title
          }
        }
        cursor
      }
      pageInfo {
          hasNextPage
          endCursor
          hasPreviousPage
          startCursor
      }
    }
  }
}

Get first 5 solutions

query {
  viewer {
    solutions(first: 5) {
      edges {
        node {
          id
          title
          description
          tags
          customFields {
            key
            value
          }
          configSlots {
            externalId
            title
            defaultValue
          }
          authSlots {
            externalId
            title
          }
        }
        cursor
      }
      pageInfo {
          hasNextPage
          endCursor
          hasPreviousPage
          startCursor
      }
    }
  }
}

Get first solution after cursor

query {
  viewer {
    solutions(first: 1, after: "MTNiM2FiOWMtZTIyMi00NzM5LWE2OWItYzRkZDA3ZmJiZmE0") {
      edges {
        node {
          id
          title
          description
          tags
          customFields {
            key
            value
          }
          configSlots {
            externalId
            title
            defaultValue
          }
          authSlots {
            externalId
            title
          }
        }
        cursor
      }
      pageInfo {
          hasNextPage
          endCursor
          hasPreviousPage
          startCursor
      }
    }
  }
}
Returned Data Subfields Notes
id The solution id which needs to be passed when using the createSolutionInstance mutation.
title
description
configSlots externalId
title
defaultValue
This can be used when Importing config Data
authSlots externalId
title
Array of all the auths required by your solution
tags If you have created tags in the Solution Editor, this field can be used to filter Solutions in your external application
custom fields You can set these on the solution settings page.

Pagination

You can paginate the results of this query using the methods discussed in Pagination

SecuritybearerAuth
Request
Responses
200

OK - An array of solutions from your embedded org is returned

401

Unauthorized

403

Forbidden

500

Internal Error

Request samples
curl -i -X POST \
  https://tray.io/graphql \
  -H 'Authorization: Bearer <MASTER_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": "query {\n  viewer {\n    solutions {\n      edges {\n        node {\n          id\n          title\n          description\n          tags\n          customFields {\n            key\n            value\n          }\n          configSlots {\n            externalId\n            title\n            defaultValue\n          }\n          authSlots {\n            title\n            externalId\n          }\n        }\n        cursor\n      }\n      pageInfo {\n          hasNextPage\n          endCursor\n          hasPreviousPage\n          startCursor\n      }\n    }\n  }\n}",
    "variables": {}
  }'
Response samples
application/json
{
  • "data": {
    • "viewer": {
      • "solutions": {
        • "edges": [
          • {
            • "node": {
              • "id": "28233cac-XXXX-XXXX-XXXX-e464a6881c04",
              • "title": "New Marketo Leads MailChimp Campaign",
              • "description": "Add newly created Marketo leads to the New Leads MailChimp Campaign",
              • "tags": [
                • "marketing"
                ],
              • "customFields": [
                • {
                  • "key": "my_custom_field",
                  • "value": "myCustomFieldValue"
                  }
                ],
              • "configSlots": [
                • {
                  • "externalId": "external_campaignId",
                  • "title": "campaign ID",
                  • "defaultValue": "1234"
                  }
                ],
              • "authSlots": [
                • {
                  • "externalId": "external_marketo_authentication",
                  • "title": "Marketo authentication"
                  },
                • {
                  • "externalId": "external_mailchimp_authentication",
                  • "title": "mailchimp authentication"
                  }
                ]
              },
            • "cursor": "MjgyMzNjYWMtNzc1ZS00MTNlLWIyYWYtZTQ2NGE2ODgxYzA0"
            }
          ],
        • "pageInfo": {
          • "hasNextPage": false,
          • "endCursor": "MjgyMzNjYWMtNzc1ZS00MTNlLWIyYWYtZTQ2NGE2ODgxYzA0",
          • "hasPreviousPage": false,
          • "startCursor": "MjgyMzNjYWMtNzc1ZS00MTNlLWIyYWYtZTQ2NGE2ODgxYzA0"
          }
        }
      }
    }
}