Send a test notification to mobile device(s)

POST https://z.u1v.ru/api/v1/mobile_push/test_notification

Trigger sending a test push notification to the user's selected mobile device or all of their mobile devices.

Changes: Deprecated in Zulip 11.0 (feature level 420). Clients connecting to newer servers and with E2EE push notifications support should use the Send an E2EE test notification to mobile device(s) endpoint, as this endpoint will be removed in a future release.

Starting with Zulip 8.0 (feature level 234), test notifications sent via this endpoint use test rather than test-by-device-token in the event field. Also, as of this feature level, all mobile push notifications now include a realm_name field.

New in Zulip 8.0 (feature level 217).

Usage examples

The -u line implements HTTP Basic authentication. See the Authorization header documentation for how to get those credentials for users and bots.

curl -sSX POST https://z.u1v.ru/api/v1/mobile_push/test_notification \
    -u EMAIL_ADDRESS:API_KEY \
    --data-urlencode token=111222 \
    --data-urlencode device_instance_id=device-1 \
    --data-urlencode push_event_id=550e8400-e29b-41d4-a716-446655440000 \
    --data-urlencode token_type=apns \
    --data-urlencode environment=sandbox

Parameters

token string optional

Example: "111222"

The push token for the device to which to send the test notification.

If this parameter is not submitted, the test notification will be sent to all of the user's devices registered on the server.

A mobile client should pass this parameter, to avoid triggering a test notification for other clients.


device_instance_id string optional

Example: "device-1"

Stable application installation identifier used to limit a route-registry test notification to one device.


push_event_id string optional

Example: "550e8400-e29b-41d4-a716-446655440000"

UUID identifying one logical notification event. Production diagnostics can call this endpoint twice with the same value, after observing push_received for the first trace, to verify provider and client duplicate suppression. This parameter requires device_instance_id, token_type, and environment.


token_type string optional

Example: "apns"

Exact registered route token type for a duplicate probe.


environment string optional

Example: "sandbox"

Exact registered route environment for a duplicate probe. Must be one of: "production", "sandbox".


Response

Return values

  • delivery_trace_id: string

    A unique trace identifier for the test notification, useful for correlating delivery receipts.

  • routes_contacted: integer

    Number of push-route-registry routes contacted when the route registry is enabled.

  • accepted_routes: integer

    Number of push-route-registry provider attempts accepted by the provider.

  • push_event_id: string

    Canonical logical event UUID used by a duplicate probe.

Example response(s)

Changes: As of Zulip 7.0 (feature level 167), if any parameters sent in the request are not supported by this endpoint, a successful JSON response will include an ignored_parameters_unsupported array.

A typical successful JSON response may look like:

{
    "delivery_trace_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "msg": "",
    "result": "success"
}

Invalid push device token

A typical failed JSON response for when the push device token is not recognized by the Zulip server:

{
    "code": "INVALID_PUSH_DEVICE_TOKEN",
    "msg": "Device not recognized",
    "result": "error"
}

Invalid push device token

A typical failed JSON response for when the push device token is not recognized by the push notification bouncer:

{
    "code": "INVALID_REMOTE_PUSH_DEVICE_TOKEN",
    "msg": "Device not recognized by the push bouncer",
    "result": "error"
}