notificationstatusofuser
POST v1/simplepush/notificationstatusofuser#
With this API, you can query the status of a notification you sent earlier for a specific user (customer) number. For this, you need the pushId that the Diyalog system created for your request at the time of sending. You get whether the notification delivered to the user (customer) given in the request was successful.
API requests
- Must be authenticated with HMAC Authentication. For HMAC Authentication, see the Authentication document.
- API URI : https://DIYALOG-SERVER-API-ENDPOINT/v1/simplepush/notificationstatusofuser
- HTTP Request Type POST
- HTTP Content-Type application/json
Request Body#
| Schema |
|---|
| json object |
| push_id (String[]) The unique id created by the Diyalog system for your request, returned in the API response of the sendpush API request. |
| to (String) The user (customer) number. The API returns whether the notification was sent to the user (customer) number given in this parameter. |
Example Json Request Body :#
Responses#
| HTTP 200 Response |
|---|
| json object Returns the status of the notification with the given pushId for the specified user (customer) number. |
| pushId (String) The id of the notification whose status you queried is returned in the response. |
| requestAt (Unix epoch timestamps (miliseconds)) The request time, in milliseconds. |
| sendAt (Unix epoch timestamps (miliseconds)) Optional. The time, in milliseconds, at which Diyalog forwarded the notification to APNS, GOOGLE FCM or HUAWEI HMS. If the request never left the Diyalog system, this field is not returned. |
| isSuccess (Boolean) Returns true if the operation succeeded, otherwise false. |
| error (String) Optional. Returned if the notification failed and an error code was produced; it contains the error code. It can return the following codes. USER_NOT_FOUND_IN_SYSTEM USER_PUSH_TOKEN_NOT_FOUND May contain the APNS rejection reason. GOOGLE FCM error cases: FCM_ERROR_INVALID_REGISTRATION : The device token is not valid. FCM_ERROR_NOT_REGISTERED : The device token is not valid. FCM_ERROR_XXX : Other error cases. The error detail is given in the part marked XXX. FCM_INTERNAL_ERROR_DESERIALIZATION_EXCEPTION : The notification was not sent because the Diyalog application threw an exception. Huawei HMS error cases: HMS_ERROR_XXX : Other error cases. The error detail is given in the part marked XXX. See the Huawei HMS documentation for detailed error codes. "80100000" ⇒ "Some tokens are right, the others are illegal" "80100001" ⇒ "Parameters check error" "80100002" ⇒ "Token number should be one when send sys message" "80100003" ⇒ "Message structure error" "80100004" ⇒ "TTL is less than current time, please check" "80100013" ⇒ "Collapse_key is illegal, please check" "80100016" ⇒ "Message contians sensitive information, please check" "80200001" ⇒ "Oauth authentication error" "80200003" ⇒ "Oauth Token expired" "80300002" ⇒ "APP is forbidden to send" "80300007" ⇒ "Invalid Token" "80300008" ⇒ "The message body size exceeds the default value set by the system (4K)" "80300010" ⇒ "Tokens exceed the default value" "81000001" ⇒ "System inner error" "82000001" ⇒ "GroupKey or groupName error" "82000002" ⇒ "GroupKey and groupName do not match" "82000003" ⇒ "Token array is null" "82000004" ⇒ "Group do not exist" "82000005" ⇒ "Group do not belond to this app" "82000006" ⇒ "Token array or group number is transfinited" "82000007" ⇒ "Invalid topic" "82000008" ⇒ "Token array null or transfinited" "82000009" ⇒ "Topic num transfinited, at most 2000" "82000010" ⇒ "Some token is wrong" "82000011" ⇒ "Token is null" "82000012" ⇒ "Data storage location is not selected" "82000013" ⇒ "Data storage location does not match the actual data" HMS_INTERNAL_ERROR_DESERIALIZATION_EXCEPTION : The notification was not sent because the Diyalog application threw an exception. |
Example Response Body :#
If no record is found for the given push ID and user number pair, the API request returns the following error.#
| HTTP 400 Response |
|---|
| string SPECIFIED_PUSH_NOT_FOUND_FOR_GIVEN_USER |
| HTTP 500 Response |
|---|
| string When the API encounters a general error, it returns a response with the HTTP 500 status code. The API's error message is returned as text. |
If the request fails HMAC validation, the following errors are returned as plain text. See Authentication.
| HTTP status | Message | Description |
|---|---|---|
| 400 | Required headers not found | One or more of the x-dlg-date, x-dlg-requester-userid or x-dlg-authorization headers are missing. |
| 400 | Authorization failed due to data format not valid | The x-dlg-authorization value after DLGA is not in the AccessKeyId:Signature form. |
| 400 | Date format is invalid. EEE, dd MMM yyyy HH:mm:ss Z is requied | The x-dlg-date value cannot be parsed in this format. The message text is returned as shown, including its spelling. |
| 401 | Authorization failed | The x-dlg-authorization header does not contain DLGA , the AccessKeyId is unknown, or the signature is not correct. |
| 401 | You have no permission on this operation. Contact your admin. | The signature is correct, but your access key has no push permission. |
| 403 | Request time may not be correct. | The x-dlg-date value differs from the server time by more than 15 minutes. |