REST API v4: GET subprofile push notifications

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

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 subprofile, send an HTTP GET request to the following URL:

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

Replace $id with the ID of the subprofile.

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, view, collection 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": "subprofile",
        "sources": [
            {
                "id": "5678",
                "type": "subprofile"
            }
        ]
    }
}

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 subprofile
$api->get("subprofile/{$id}/push/notifications");

This example requires the REST API class.