Export (0) Print
Expand All

Send a WNS Native Notification

Updated: August 12, 2013

Sends a WNS native notification through a notification hub.

 

Method Request URI HTTP Version

POST

https://{namespace}.servicebus.windows.net/{NotificationHub}/messages/?api-version=2013-08

HTTP/1.1

Request Headers

The following table describes required and optional request headers.

 

Request Header Description

Authorization

Token generated as specified in Shared Access Signature Authentication with Service Bus, or Service Bus authentication and authorization with Microsoft Azure Active Directory Access Control (also known as Access Control Service or ACS).

Content-Type

Set to application/json;charset=utf-8. If the notification type is “wns/raw”, set to application/octet-stream.

ServiceBusNotification-Tags

{single tag identifier} (optional)

ServiceBusNotification-Format

Set to windows

X-WNS-*

All headers starting with X-WNS will be forwarded to WNS.

Request Body

The request body is an XML document as specified by WNS. If the notification is of type “wns/raw”, the body is any text up to 5Kb. For example:

<?xml version="1.0" encoding="utf-8" ?>
<toast>
    <visual lang="en-US">
        <binding template="ToastText01">
            <text id="1”>
                This is my toast message for Win8!
            </text>
        </binding>
    </visual>
</toast>

The response includes an HTTP status code and a set of response headers.

Response Codes

 

Code Description

200

Message successfully sent.

400

The request is malformed (for example, not valid routing headers, not valid content-type, message exceeds size, bad message format).

401

Authorization failure. The access key was incorrect.

403

Quota exceeded or message too large; message was rejected.

404

No message branch at the URI.

413

Requested entity too large. The message size cannot be over 64Kb.

For information about status codes, see Status and Error Codes.

Response Headers

None.

Response Body

None.

Community Additions

ADD
Show:
© 2014 Microsoft