Skip to main content

SNS Notification platforms API

API endpoints

Data formats

For Android

  • platform should be GCM
  • platformCredential is your API key
  • platformPrincipal should be omitted
  • platformProperties is optional, and can include a channelId, i.e.
    platformProperties: {
    channelId: 'atomic_action_cards_notification_channel'
    restrictedPackageName: 'com.example.myapp'
    }
    For iOS

When configuring a Notification Platform for iOS you have two options. Either Certificate authentication using a P12 certificate or Token based authentication using P8 private key and signing details. These configuration details are available through the Apple Developer Centre.

For iOS - Certificate Authentication

  • platform should be APNS or APNS_SANDBOX
  • platformCredential is your private key
  • platformPrincipal is the SSL certificate

Note if you have a certificate in PCKCS#12 format, the private key and SSL certificate can be extracted with a command such as

openssl pkcs12 -in APNS.p12 -out combined.pem`

For iOS - Token Authentication

You will have to download the p8 certificate from the Apple Developer Centre.

  • Signing key – The authentication token signing key from your Apple Developer account, which you download as a .p8 file. Apple lets you download your signing key only once.

  • Signing key ID – The ID that's assigned to your signing key. Amazon SNS requires this information to construct authentication tokens. To find this value in your Apple Developer account, choose Certificates, IDs & Profiles, and then choose your key in the Keys section.

  • Team identifier – The ID that's assigned to your Apple Developer account team. You can find this value on the Membership page.

  • Bundle identifier – The ID that's assigned to your app. To find this value, choose Certificates, IDs & Profiles, choose App IDs in the Identifiers section, and then choose your app.

List existing platforms

GET /v1/:environmentId/notification-platforms

Response contains platform details in JSON format:

{
"data": [
{
"id": "7JlDQ1Da",
"type": "sns-notification-platform",
"attributes": {
"platform": "APNS",
"appId": "io.atomic...",
"arn": "arn:aws:sns:us-east-1:...",
"created": "2020-07-09T00:20:11.765Z",
"enabled": true,
"attributes": {
"Enabled": "true",
"AppleCertificateExpirationDate": "2021-12-05T02:28:49Z"
}
}
}
]
}

Create a platform

Example Android.

POST /v1/:environmentId/notification-platforms
{
"appId": "...",
"platform": "GCM",
"platformCredential": "ABC...XYZ"
}

Example iOS.

POST /v1/:environmentId/notification-platforms
{
"appId": "...",
"platform": "APNS",
"platformCredential": "-----BEGIN RSA PRIVATE KEY-----\r\nABC...XYZ\r\n-----END RSA PRIVATE KEY-----\r\n",
"platformPrincipal": "-----BEGIN CERTIFICATE-----\r\nDEF...UVW\r\n-----END CERTIFICATE-----\r\n"
}

Response:

{
"data": {
"arn": "arn:aws:sns:us-east-1:..."
}
}

Update a platform

Example Android.

PUT /v1/:environmentId/notification-platforms
{
"appId": "...",
"platform": "GCM",
"platformCredential": "ABC...XYZ"
}

Example iOS.

PUT /v1/:environmentId/notification-platforms
{
"appId": "...",
"platform": "APNS",
"platformCredential": "-----BEGIN RSA PRIVATE KEY-----\r\nABC...XYZ\r\n-----END RSA PRIVATE KEY-----\r\n",
"platformPrincipal": "-----BEGIN CERTIFICATE-----\r\nDEF...UVW\r\n-----END CERTIFICATE-----\r\n"
}

Response:

{
"data": {
"arn": "arn:aws:sns:us-east-1:..."
}
}

Disable / Enable a platform

PUT /v1/:environmentId/notification-platform-enabled
{
"id": "7JlDQ1Da",
"enabled": false
}

Delete a platform

Only disabled platforms can be deleted

DELETE /v1/:environmentId/notification-platforms
{
"appId": "...",
"platform": ("GCM" | "FCM" | "APNS" | "APNS_SANDBOX")
}