This topic has not yet been rated - Rate this topic

Push Notification Service Response Codes for Windows Phone

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.

Responses from the Microsoft Push Notification Service will be in the following format:

HTTP/1.1 <error code> <error text> 
Date: <HTTP-date>
<Custom HTTP Headers>

<error code>

A three-digit error code. See a list of error codes below.

<error text>

The explanation of the error.

<Custom HTTP Headers>

The customer HTTP headers are defined below.

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 noteImportant Note:
This response code can occur for a variety of reasons, including but not limited to:
  1. To reduce network load and latency, mobile operator network configurations can vary greatly in the amount of time a persistent data connection is allowed to live. The Push Notification Client attempts to mitigate these persistent data connection limitations, but there is a lower bound after which it is power inefficient to mitigate this situation. This may lead to devices experiencing the “OK/Received/Temporarily Disconnected/Active” state as a result of the data connection being interrupted.

  2. The device is outside the coverage area of their carrier and the user has chosen to disable data connection when roaming.

  3. The device has a Pay-As-You-Go plan and has temporarily disabled the data connection or has a restrictive data plan option.

  4. The device is on the edge of a coverage area and the data connection is not reliable.

  5. If Wi-Fi is being used and cellular data is not available, the device must have a clear path to the Internet in order for push notifications to be received – this can be problematic on some corporate networks.

  6. The device is alternating between cell and Wi-Fi connections and the connection is not in a steady state.

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:

  • There is a mismatch between the subject name of the certificate on the web service and the subject name of the certificate on the Push Notification Service.

  • If the token has been modified.

  • If the token is not valid for its subscription.

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.

Did you find this helpful?
(1500 characters remaining)