REST API v4: GET profile push notifications

This method retrieves all push notifications that have been sent to a specific profile.

A push notification can be sent through different channels, such as browser push notifications or mobile push notifications.

To retrieve the push notifications of a profile, send an HTTP GET request to the following URL:

https://api.copernica.com/v4/profile/$id/push/notifications

Replace $id with the ID of the profile.

Returned fields

This method returns a collection of push notifications.

Name Description
ID Unique identifier of the push notification.
timestamp Date and time when the push notification was sent.
title Title of the push notification.
destinations Number of recipients targeted by the push notification.
channel Channel through which the push notification was sent, for example web or mobile.
fallback Optional fallback content used when the primary channel is not available.
target Information about the target of the push notification.
target.type Type of target to which the push notification was sent.
target.sources The underlying sources that make up the target.
target.sources[].id ID of the source.
target.sources[].type Type of source, for example profile, subprofile, database, collection, view or miniview.

JSON example

The JSON response looks like the following:

{
    "ID": "1",
    "timestamp": "2025-02-04 13:37:04",
    "title": "testing push",
    "destinations": 0,
    "channel": "web",
    "fallback": "",
    "target": {
        "type": "profile",
        "sources": [
            {
                "id": "1234",
                "type": "profile"
            }
        ]
    }
}

PHP example

The following script demonstrates how to use this API method.

// required scripts
require_once("CopernicaRestAPI.php");

// change this to your access token
$api = new CopernicaRestAPI("your-access-token", 4);

// replace {$id} with the ID of the profile
$api->get("profile/{$id}/push/notifications");

This example requires the REST API class.