Documentation

SavePushNotificationTemplate

Saves push notification template for title

Request Details

SavePushNotificationTemplateRequest
Request Properties
AndroidPayload String

Android JSON for the notification template.

Id String

Id of the push notification template.

IOSPayload String

IOS JSON for the notification template.

LocalizedPushNotificationTemplates Dict<String, LocalizedPushNotificationProperties>

Dictionary of localized push notification templates with the language as the key.

Name (required) String

Name of the push notification template.

POST https://{{TitleID}}.playfabapi.com/Server/SavePushNotificationTemplate
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "Id": "6bc7dbf0-075a-46e9-8e84-35737a22c6a4",
  "Name": "F8763A987E",
  "AndroidPayload": "{       notification:      {          body: \"Some Message\",          title: \"Subject\",          body_loc_key: \"someLocKey\"     } }",
  "IOSPayload": "{       aps:      {          alert:          {          body: \"Some Message\",          title: \"Subject\",          \"loc-key\": \"someLocKey\"         }      } }",
  "LocalizedPushNotificationTemplates": {
    "en": {
      "Subject": "Recent Attack",
      "Message": "You have been attacked! Go defend your base!"
    },
    "fr": {
      "Subject": "Attaque récente",
      "Message": "Vous avez été attaqué! Va défendre ta base!"
    }
  }
}
        

Response Details

SavePushNotificationTemplateResult
Result Properties
PushNotificationTemplateId String

Id of the push notification template that was saved.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "PushNotificationTemplateId": "6bc7dbf0-075a-46e9-8e84-35737a22c6a4"
  }
}

Authentication

SecretKey

Possible Error Codes

Name Code
InvalidLocalizedPushNotificationLanguage 1409
InvalidParams 1000
InvalidTitleId 1004
MissingLocalizedPushNotificationMessage 1410
OverLimit 1214
PushNotificationTemplateAndroidPayloadMissingNotificationBody 1416
PushNotificationTemplateContainsInvalidAndroidPayload 1414
PushNotificationTemplateContainsInvalidIosPayload 1413
PushNotificationTemplateInvalidPayload 1408
PushNotificationTemplateInvalidSyntax 1419
PushNotificationTemplateIosPayloadMissingNotificationBody 1415
PushNotificationTemplateMissingDefaultVersion 1418
PushNotificationTemplateMissingName 1442
PushNotificationTemplateMissingPlatformPayload 1411
PushNotificationTemplateNoCustomPayloadForV1 1420
PushNotificationTemplatePayloadContainsInvalidJson 1412
TitleDefaultLanguageNotSet 1393