CreatePlatformApplication
Written by
Updated at August 9, 2024
Creates a mobile push notification channel.
HTTP request
POST https://notifications.yandexcloud.net/
Query parameters
Parameter | Description |
---|---|
Action |
string Required field. Parameter to indicate the operation type. Value: CreatePlatformApplication . |
Name |
string Required field. Notification channel name. The name must be unique within the cloud. It may contain lowercase and uppercase Latin letters, numbers, underscores, hyphens, and periods. It may be 1 to 256 characters long. For APNs channels, we recommend specifying the bundle ID in the name, and for FCM and HMS, the full package name. Example: com.example.app . |
Platform |
string Required field. Platform for sending mobile push notifications. The possible values include:
APNS_SANDBOX : Apple Push Notification service for testing the app. |
FolderId |
string Required field. ID of the folder to create a notification channel in. Example: b1gsm0k26v1l******** . |
Attributes.entry.N.key |
string Required field. Attribute key. N : Numerical value.Example: Attributes.entry.1.key=PlatformPrincipal&Attributes.entry.2.key=PlatformCredential . |
Attributes.entry.N.value |
string Required field. Attribute value. N : Numerical value.Example: Attributes.entry.1.value=c8gzjriSVxDDzX2fAV********&Attributes.entry.2.value=CgB6e3x9iW/qiE9l9wAUPK0e/bJQe5uIgTlYUD4bP******** . |
ResponseFormat |
string Response format. The possible values include:
|
Attributes
Common attributes
Attribute | Description |
---|---|
Description |
string App description. Example: Test application . |
APNS and APNS_SANDBOX attributes
Attribute | Description |
---|---|
PlatformPrincipal |
string Token ID in .p8 format or SSL certificate in .p12 format. Token-based authentication is preferred as it is more modern. |
PlatformCredential |
string Token or private key of the SSL certificate. |
ApplePlatformTeamID |
string Developer ID, only when using a token. |
ApplePlatformBundleID |
string App ID (bundle ID), only when using a token. |
FCM attributes
Attribute | Description |
---|---|
PlatformCredential |
string Google Cloud service account key in JSON format for authentication with the HTTP v1 API or API key (server key) for authentication with the Legacy API. The HTTP v1 API is preferred as FCM will no longer support |
HMS attributes
Attribute | Description |
---|---|
PlatformPrincipal |
string Key ID |
PlatformCredential |
string API key |
For more information about authentication attributes, see the Mobile push notification channels subsection.
Response
Successful response
If there are no errors, Cloud Notification Service returns the 200
HTTP code.
A successful response contains additional data in XML or JSON format depending on the specified ResponseFormat
parameter.
Data schema:
XML
JSON
<?xml version="1.0" encoding="UTF-8"?>
<CreatePlatformApplicationResponse>
<ResponseMetadata>
<RequestId>string</RequestId>
</ResponseMetadata>
<CreatePlatformApplicationResult>
<PlatformApplicationArn>string</PlatformApplicationArn>
</CreatePlatformApplicationResult>
</CreatePlatformApplicationResponse>
{
"ResponseMetadata": {
"RequestId": "string"
},
"CreatePlatformApplicationResult": {
"PlatformApplicationArn": "string"
}
}
Where:
RequestId
: Request IDPlatformApplicationArn
: Notification channel ID (ARN)
Error response
In case of an error, Cloud Notification Service returns a message with the appropriate HTTP code and its additional description in XML or JSON format depending on the specified ResponseFormat
parameter.
Data schema:
XML
JSON
<?xml version="1.0" encoding="UTF-8"?>
<ErrorResponseXML>
<RequestId>string</RequestId>
<Error>
<Code>string</Code>
<Message>string</Message>
</Error>
</ErrorResponseXML>
{
"ErrorResponse": {
"RequestId": "string",
"Error": {
"Code": "string",
"SubCode": "string",
"Message": "string"
}
}
}
Where:
RequestId
: Request IDCode
: Error codeMessage
: Error description
For a list of common error codes for all actions, see Errors.
Errors specific for the CreatePlatformApplication
action:
HTTP | Error code | Description |
---|---|---|
400 | InvalidParameter | A mobile push notification channel with such name and platform already exists. |
400 | InvalidParameter | You cannot use the name and platform to create a new mobile push notification channel because a channel with the same parameters was recently deleted, and the mobile platform data has not yet been updated. |