Query for retrieving the authentications used by your end users. You can also retrieve the auths created within your main embedded org by passing the Master token in the headers.
This query can be used to retrieve the authentications for a particular user.
Please also see our guide to Mapping and Editing Auths
Required Token | Notes |
---|---|
User | obtained after creating a user token (Users/Mutations/Create User Token) the user token is a persistent token (valid for 2 days) that should be securely stored in your application If Master token is used will return all the authentications from the Embedded Organization including all the auths created by owner/admin/contributors and NOT including your end user auths. |
Here is an example query:
query { viewer { authentications { edges { node { id name customFields service { id, name, icon, title, version } serviceEnvironment { id title } } } pageInfo{ hasNextPage hasPreviousPage } } } }
Returned Data | Subfields | Notes |
---|---|---|
id | the authentication id | |
name | the arbitrary name the end user has given to the authentication | |
service | id, name, icon, title, version | details of the service the authentication is for |
serviceEnvironment | id, title | relevant when Importing Authentications |
pageInfo | hasNextPage, hasPreviousPage | can be used for pagination |
OK - If user token is passed, an array of all end user auths is returned. In case of master token, an array of auths from the embedded organization workspace is returned.
Unauthorized
Forbidden
Internal Error
curl -i -X POST \ https://tray.io/graphql \ -H 'Authorization: Bearer <USER_OR_MASTER_TOKEN>' \ -H 'Content-Type: application/json' \ -d '{ "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": {} }'
{- "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",
- "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",
- "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",
- "title": "Slack",
- "version": "1"
}
}
}
]
}
}
}
}