registerMyPushToken
Requires permission notifications:push-token:manage.
Registers a push-notification token for the signed-in staff user's device. Requires permission to manage push tokens.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation RegisterMyPushToken($input: RegisterPushTokenInput!) {
registerMyPushToken(input: $input)
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation RegisterMyPushToken($input: RegisterPushTokenInput!) {\n registerMyPushToken(input: $input)\n}",
"variables": {
"input": {
"deviceId": "id",
"platform": "ANDROID",
"token": "string"
}
}
}
EOF
Variables:
{
"input": {
"deviceId": "id",
"platform": "ANDROID",
"token": "string"
}
}
Response:
{
"data": {
"registerMyPushToken": true
}
}
registerMyPushToken(
input: RegisterPushTokenInput!
): Boolean!
Arguments
registerMyPushToken.input ● RegisterPushTokenInput! non-null input
The push token, the device ID, the platform and optionally the app version.
Type
Boolean scalar
The Boolean scalar type represents true or false.