Authentication with GraphQL and the REST API
To communicate with the GraphQL and the REST server, you'll need a bearer token.
Each token is dedicated by workspace, so with one token, you can only access to the corresponding workspace data.
How to get a token?
You just have to follow this steps:
- Login to Switchy.io
- Go to the workspace that you want to use with the API
- Go into the settings page then select the integrations tab
- Click over the button Generate a token
How to use the token?
You just have to provide for each request an Api-Authorization.
For example with curl
curl -H "Api-Authorization: your-token" -X POST -d " \
{ \
\"query\": \"query { workspaces { companyName createdDate id name }}\" \
} \
" https://graphql.switchy.io/v1/graphql
Official partner/integration
For official integration, you have more access to our API.
For each request, you have to provide Partner-Authorization and the Api-Authorization (of you user) headers.
If you don't have a Partner-Authorization, feel free to reach us on our live chat. You can find our chat on the website or within the app! ๐