Get member push notification tokens

GET /api/members/{memberID}/push-notification-token

Success: 200 OK

Overview

Lists every device registration a member currently holds for push notifications. A member can be registered on several devices and in several apps at once, so this typically returns more than one entry.

The one thing to plan for: a member with no registrations returns 404, not 200 with an empty array. Checking "is this member registered for push?" therefore means treating 404 as a normal negative answer rather than an error. The same 404 shape is used for a member id that does not exist, with a different message.

Use it before sending a notification, or to reconcile what your app thinks it registered against what the platform actually holds. To remove a registration, see Delete member push notification token — and note that the delete endpoint matches on appBundleId, so keep the value you see here.

Endpoint

GET {base_url}/api/members/{memberID}/push-notification-token

{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.

Path parameters

NameTypeRequiredDescription
memberIDinteger (int32)YesThe member whose registrations you want. The member must exist, or you get 404 with a different message from the no-registrations case. With a member-scoped token this must be the token's own member; linked members are not accepted.

Sample request

cURL
curl -X GET '{base_url}/api/members/{memberID}/push-notification-token' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true'

Response fields

FieldTypeDescription
tokensarray of objectEvery device registration held for the member, one entry per app bundle plus at most one entry with no bundle. Never empty on a 200 — a member with none gives 404 instead. No ordering is guaranteed.
tokens[].idinteger (int32)The registration's own id. Informational only: the delete endpoint identifies a registration by member and appBundleId, not by this id.
tokens[].memberIDinteger (int32)The member the registration belongs to. Always the member you asked for.
tokens[].pushTokenstringThe device token issued by the push provider, stored verbatim. This is the value you send to APNs or FCM. Device tokens are rotated by the operating system, so a value here can be stale — a send failure is the only way you find out, and the platform does not prune them for you.
tokens[].appBundleIdstringThe app the registration belongs to, stored lower-cased. null for a registration made without a bundle id — the single-app case. Pass this exact value to Delete member push notification token; calling that endpoint without a bundle id will not match a registration that has one.

Sample response

200 OK
{
  "tokens": [
    {
      "id": 12345,
      "memberID": 12345,
      "pushToken": "string",
      "appBundleId": "string"
    }
  ]
}

Errors

StatusMeaningWhen
403ForbiddenThe token belongs to a different member. Linked members are not accepted here. The body is The given member ID of {memberID} does not belong to the logged in member.
404Not foundmemberID does not exist. The body is The member does not exist.
404Not foundThe member exists but has no device registrations at all. The body is The member does not have any push notification device tokens. This is the expected answer for most members and should not be treated as a failure.
500Internal server errorAn unexpected server-side failure while reading the registrations.

This page as markdown · All pages · llms.txt