Call the PushMessageToAndroid operation to push messages to Android devices.
Description
This operation sends messages to online devices by default. To send messages that are stored for offline devices, use the advanced Push API.
Test
Request parameters
Name | Type | Required | Example value | Description |
|---|---|---|---|---|
Action | String | Yes | PushMessageToAndroid | PushMessageToAndroid PushMessageToAndroid. |
AppKey | Long | Yes | 23267207 | AppKey details |
Body | String | Yes | my body | The message content. |
Target | String | Yes | ALL | The push target. Valid values:
|
TargetValue | String | Yes | all | The value of this parameter depends on the `Target` parameter. Use commas (,) to separate multiple values. If you exceed the limit for a value, send the message in multiple pushes.
|
Title | String | Yes | my title | The message title. |
JobKey | String | No | 123 | The custom ID for the push task. If you specify a `JobKey`, this field is included in the receipt log. For more information, see Receipt log. |
Return Data
Name | Type | Example | Description |
|---|---|---|---|
MessageId | String | 501029 | The message ID of a single push. |
RequestId | String | 9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC | The request ID. |
Examples
Sample request
http(s)://cloudpush.aliyuncs.com/?Action=PushMessageToAndroid
&AppKey=23267207
&Body=my body
&Target=ALL
&TargetValue=all
&Title=my title
&<Common request parameters>Sample success response
XML format
<PushMessageToAndroidResponse>
<RequestId>9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC</RequestId>
<MessageId>501029</MessageId>
</PushMessageToAndroidResponse>JSON format
{
"RequestId": "9998B3CC-ED9E-4CB3-A8FB-DCC61296BFBC",
"MessageId": "501029"
}Error codes
For a list of error codes, see the Error Center.