CreatePlatformEndpoint
Written by
Updated at June 26, 2024
Creates an endpoint for push notifications (subscribes the user to push notifications).
HTTP request
POST https://notifications.yandexcloud.net/
Query parameters
Parameter | Description |
---|---|
Action |
string Required field. Parameter to indicate the operation type. Value: CreatePlatformEndpoint . |
PlatformApplicationArn |
string Required field. Mobile push notification channel ID. Example: arn:aws:sns::aoegtvhtp8ob********:app/GCM/test-cns-9990 . |
Attributes.entry.N.key |
string Required field. Attribute key. N : Numerical value.Example: Attributes.entry.1.key=Token&Attributes.entry.2.key=CustomUserData . |
Attributes.entry.N.value |
string Required field. Attribute value. N : Numerical value.Example: Attributes.entry.1.value=c8gzjriSVxDDzX2fAV********&Attributes.entry.2.value=test-text . |
ResponseFormat |
string Response format. The possible values include:
|
Attributes
Attribute | Description |
---|---|
Token |
string Required field. Unique token on the user device (Registration ID) created by the notification service for the app. |
CustomUserData |
string Other user data that can be stored with the endpoint. Cloud Notification Service does not use this data in any way. |
Note
The Enabled
attribute (enabling and disabling endpoint notifications) is currently not supported.
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"?>
<CreatePlatformEndpointResponse>
<ResponseMetadata>
<RequestId>string</RequestId>
</ResponseMetadata>
<EndpointArn>string</EndpointArn>
</CreatePlatformEndpointResponse>
{
"ResponseMetadata": {
"RequestId": "string"
},
"EndpointArn": "string"
}
Where:
RequestId
: Request IDEndpointArn
: Mobile endpoint ID (ARN)
Error response
In case of an error, Cloud Notification Service returns a message with the appropriate HTTP code.
For a list of common error codes for all actions, see Errors.