Construct Payload API (Beta)

The Construct Payload API will allow you to create an App Clips RichLink using a URL. You can find more details on RichLink and App Clips.

Following is the flow on how to send an App Clips RichLink message.

Construct Payload flow
Construct Payload flow

Before calling the API make sure that the URL has the App Clips elements on its web page. For more details please check here. If the URL doesn't support App Clips the API will return 400 Bad Request.

URL

POST https://mspgw.push.apple.com/v1/constructPayload

HTTP Header

Name Type Description
Authorization string REQUIRED. Credentials used to authenticate the request. See Authorizing Messages.
content-type string REQUIRED. A string value, set to application/json, advertising that the content is a JSON data.

ConstructPayload Properties

Name Type Description
type string REQUIRED. A string representing the type. Default is link .
link object REQUIRED. A collection of name and values used for link type.
version integer REQUIRED. The payload version number. Default is 1.0.
Name Type Description
url string REQUIRED. String URL used by Apple Messages for Business to identify the App Clips.
storeRegion string ISO 3166 alpha-2 country code of the App Store region. By default it is "US". Set this value incase the AppClip is not in the US App Store.

Example of Construct Payload Request

Request

{
 "type":"link",
 "link":{
    "url":"https://www.example.com"
    },
 "version":1.0
}

Response

200 OK
{
    "version": "1.0",
    "richLinkDataRef": {
        "title": "https://www.example.com",
        "signature-base64": "AZ60f1FhkxZ4HdtzGFXXXXX",
        "size": 351298,
        "url": "https://p97-content.icloud.com",
        "owner": "M66169d55-aaee-48dd-b781-XXXXXXXXX.XXXXXX",
        "key": "00ccec31f00f05d3416bf0a41f4762afa3241f486ff3509dXXXXXXXX"
    }
}

Follow our Rich Link message specification and use the RichLinkDataRef to attach the payload returned from the Construct Payload API.

Request

{
    "sourceId": "<business_id>",
    "destinationId": "<destination_id>",
    "id": "<message_id>",
    "v": 1,
    "type": "richLink",
    "richLinkDataRef":{
        "title": "https://www.example.com",
        "signature-base64": "AZ60f1FhkxZ4HdtzGFXXXXX",
        "size": 351298,
        "url": "https://p97-content.icloud.com",
        "owner": "M66169d55-aaee-48dd-b781-XXXXXXXXX.XXXXXX",
        "key": "00ccec31f00f05d3416bf0a41f4762afa3241f486ff3509dXXXXXXXX"
    }
}

Response

200 OK