Resources
Authentications
Authentications represent the auth data used for authenticating to all the services that you would be integrating with Tray.
Get user authentications (user/master token)
Type: Query
Operation: get-authentications
Request Examples
{
"query": "query {\n viewer {\n authentications {\n edges {\n node {\n id\n name\n customFields\n service {\n id,\n name,\n icon,\n title,\n version\n }\n }\n }\n pageInfo{\n hasNextPage\n hasPreviousPage\n }\n }\n }\n}",
"variables": {}
}Response Examples
{
"data": {
"viewer": {
"authentications": {
"edges": [
{
"node": {
"id": "569xxxxxx-xxxxx-xxxx-7e829d2c56d",
"name": "Roger Ramjet's Slack Account",
"service": {
"id": "227312c4-3e5f-4b0d-22a0-5b9630ece00e",
"name": "slack",
"icon": "https://s3.amazonaws.com/images.tray.io/artisan/icons/slack.png",
"title": "Slack",
"version": "1"
}
}
},
{
"node": {
"id": "0b07xxxxxx-xxxxx-xxxx-b8d4121471c3",
"name": "Roger Ramjet's Trello Account",
"service": {
"id": "72cef4e9-229f-4d7c-97e3-b6cd4d92146f",
"name": "trello",
"icon": "https://s3.amazonaws.com/images.tray.io/artisan/icons/trello.png",
"title": "Trello",
"version": "1"
}
}
},
{
"node": {
"id": "a29dxxxxxx-xxxxx-xxxx-99901f41c698",
"name": "Roger Ramjet's Slack Account 2",
"service": {
"id": "227312c4-3e5f-4b0d-22a0-5b9630ece00e",
"name": "slack",
"icon": "https://s3.amazonaws.com/images.tray.io/artisan/icons/slack.png",
"title": "Slack",
"version": "1"
}
}
}
]
}
}
}
}Create user Auth (user/master token)
Type: Mutation
Operation: create-authentication
Request Examples
{
"query": "mutation (\n $authenticationName: String!,\n $serviceId: String!,\n $serviceEnvironmentId: String!,\n $authenticationData: Json!,\n $hidden: Boolean!\n ){ createUserAuthentication (input:{\n name: $authenticationName,\n serviceId: $serviceId,\n serviceEnvironmentId: $serviceEnvironmentId,\n data: $authenticationData,\n scopes: [],\n hidden: $hidden\n }) {\n authenticationId\n }\n}",
"variables": {
"authenticationName": "my-test-sqs-authentication-1",
"serviceId": "e73d8e91-XXXX-XXXX-XXXX-37df289242",
"serviceEnvironmentId": "a84eu2880-XXXX-XXXX-XXXX-7edd82904d",
"authenticationData": "{\"region\":\"us-east-1\",\"account_id\":\"1234\",\"access_key\":\"accesskey\",\"secret_key\":\"secretkey\"}",
"hidden": true
}
}Response Examples
{
"data": {
"createUserAuthentication": {
"authenticationId": "8ffexxxx-xxxx-xxxx-xxxx-xxxxxx7e8c1d"
}
}
}Delete user Auth (user/master token)
Type: Mutation
Operation: delete-authentication
Request Examples
{
"query": "mutation ($authenticationId: ID!){\n removeAuthentication(input: { authenticationId: $authenticationId }) {\n clientMutationId\n }\n}",
"variables": {
"authenticationId": "dd36c246-XXXX-XXXX-XXXX-a600be2b39fe"
}
}Response Examples
{
"data": {
"removeAuthentication": {
"clientMutationId": null
}
}
}