Push Notification Service Response Codes for Windows Phone
March 22, 2012
After your web service sends a push notification to the Microsoft Push Notification Service, your web service will receive one of many response codes with possible custom headers.
The following table describes both error and non-error response codes that may be returned to your web service:
|
Response Code |
NotificationStatus |
DeviceConnectionStatus |
SubscriptionStatus |
Comments |
|---|---|---|---|---|
|
200 OK |
Received |
Connected |
Active |
The notification request was accepted and queued for delivery. This status does not mean the device has received the notification. It indicates only that the server has received the notification and queued it for delivery at the next possible opportunity for the device. The server could respond with this status even though the device is currently transitioning into an unreachable state. This means the notification would not be delivered until the device returns from the unreachable state. |
|
200 OK |
Received |
Temporarily Disconnected |
Active |
The notification request was accepted and queued for delivery. However, the device is temporarily disconnected. Important Note:This response code can occur for a variety of reasons, including but not limited to:
|
|
200 OK |
QueueFull |
Connected |
Active |
Queue overflow. The web service should re-send the notification later. A best practice is to use an exponential backoff algorithm in minute increments. |
|
200 OK |
QueueFull |
Temporarily Disconnected |
Active |
Queue overflow. The web service should re-send the notification later. A best practice is to use an exponential backoff algorithm in minute increments. |
|
200 OK |
Suppressed |
Connected |
Active |
The push notification was received and dropped by the Push Notification Service. The Suppressed status can occur if the notification channel was configured to suppress push notifications for a particular push notification class. |
|
200 OK |
Suppressed |
Temp Disconnected |
Active |
The push notification was received and dropped by the Push Notification Service. The Suppressed status can occur if the notification channel was configured to suppress push notifications for a particular push notification class. |
|
400 BadRequest |
N/A |
N/A |
N/A |
This error occurs when the web service sends a notification request with a bad XML document or malformed notification URI. |
|
401 Unauthorized |
N/A |
N/A |
N/A |
Sending this notification is unauthorized. This error can occur for one of the following reasons:
|
|
404 Not Found |
Dropped |
Connected |
Expired |
The subscription is invalid and is not present on the Push Notification Service. The web service should stop sending new notifications to this subscription, and drop the subscription state for its corresponding application session. |
|
404 Not Found |
Dropped |
Temporarily Disconnected |
Expired |
The subscription is invalid and is not present on the Push Notification Service. The web service should stop sending new notifications to this subscription, and drop the subscription state for its client. |
|
404 Not Found |
Dropped |
Disconnected |
Expired |
The subscription is invalid and is not present on the Push Notification Service. The web service should stop sending new notifications to this subscription, and drop the subscription state for its client. |
|
405 Method Not Allowed |
N/A |
N/A |
N/A |
Invalid method (PUT, DELETE, CREATE). Only POST is allowed when sending a notification request. |
|
406 Not Acceptable |
Dropped |
Connected |
Active |
This error occurs when an unauthenticated web service has reached the per-day throttling limit for a subscription. The web service can try to re-send the push notification every hour after receiving this error. The web service may need to wait up to 24 hours before normal notification flow will resume. |
|
406 Not Acceptable |
Dropped |
Temp Disconnected |
Active |
This error occurs when an unauthenticated web service has reached the per-day throttling limit for a subscription. The web service can try to re-send the push notification every hour after receiving this error. The web service may need to wait up to 24 hours before normal notification flow will resume. |
|
412 Precondition Failed |
Dropped |
Inactive |
N/A |
The device is in an inactive state. The web service may re-attempt sending the request one time per hour at maximum after receiving this error. If the web service violates the maximum of one re-attempt per hour, the Push Notification Service will de-register or permanently block the web service. |
|
503 Service Unavailable |
N/A |
N/A |
N/A |
The Push Notification Service is unable to process the request. The web service should re-send the notification later. A best practice is to use an exponential backoff algorithm in minute increments. |
Each response that is sent from the Push Notification Service may include one or more of the following custom headers:
|
Header |
Specification |
Description |
|---|---|---|
|
MessageID |
"X-MessageID"":"1*MessageIDValue MessageIDValue = STRING (uuid) //For example: X-MessageID:<UUID> |
The notification message ID associated with the response. If the POST request delivered to the Push Notification Service did not contain the MessageID custom header, MessageID will not be returned in the response. For more information, see Sending Push Notifications for Windows Phone. |
|
NotificationStatus |
"X-NotificationStatus"":"1*NotificationStatusValue NotificationStatusValue = STRING (Received|Dropped|QueueFull|) //For example: X-NotificationStatus:Received |
The status of the notification received by the Microsoft Push Notification Service. |
|
DeviceConnectionStatus |
"X-DeviceConnectionStatus"":"1*DeviceConnectionStatusValue DeviceConnectionStatusValue = STRING (Connected|InActive|Disconnected|TempDisconnected) //For example: X-DeviceConnectionStatus:Connected |
The connection status of the device. |
|
SubscriptionStatus |
"X-SubscriptionStatus"":"1*SubscriptionStatusValue SubscriptionStatusValue = STRING (Active|Expired) //For example: X-SubscriptionStatus:Active |
The subscription status. |
Important Note: