Get an API user
An API user holds the credentials that your system uses to sign in. Certain creates API users. Ask your Certain contact for an API user, and tell them:
- The name of the API user, for example the name of your system.
- The kind of API user that you need: organization-wide, for the organization and all its events, or restricted to specific events.
- For a restricted API user, the events that it can reach.
Your Certain contact gives you the Client Id and the Client Token of the API user. Keep both values secret. Your system sends them to the login mutation.
To see the API users of your organization, open your organization in the CMS. In the menu of the organization page, under Administration, select API Users. Only organization managers can open this screen.
Sign in
The login mutation takes the client id and the client token. It returns a token.
mutation Login($clientId: String!, $clientToken: String!) {
login(clientId: $clientId, clientToken: $clientToken) {
token
}
}
This command sends the mutation with curl.
curl https://api.certaintouchpoint.com/graphql \
-H "Content-Type: application/json" \
-d '{
"query": "mutation Login($clientId: String!, $clientToken: String!) { login(clientId: $clientId, clientToken: $clientToken) { token } }",
"variables": { "clientId": "YOUR_CLIENT_ID", "clientToken": "YOUR_CLIENT_TOKEN" }
}'
The response holds the token.
{
"data": {
"login": {
"token": "eyJhbGciOi..."
}
}
}
If the client id or the client token is wrong, the response has the error Invalid client id or token.
The token is valid for one day. There is no refresh call. When the token expires, call login again. Send that request without an Authorization header. A request that carries the expired token gets HTTP 401.
This article is a copy of Getting started in the Touchpoint API documentation.
Comments
0 comments
Please sign in to leave a comment.