Send bulk notification using NID

Your service can send bulk notification using Notification ID as follows:

Use this method to send the same message to multiple clients using a single Notifications REST API request. To specify the recipients of the notification, set the id parameter to a comma-separated list of NIDs. Limit is 5000-6000 NIDs.

URL

/nnapi/1.0/bulk/nid

Note:

This is a cURL command. For more information, see Testing Service using cURL.

Method

POST

Parameters

See REST API methods and parameters

Response

200 OK

The bulk notification request was received and accepted by the server; the notification will then be sent to all online recipients.

XML response contains more information about request: <requested> count shows the number of recipients in the request and <sent> count shows the number of notifications that were sent to client applications.

<?xml version="1.0" encoding="UTF-8"?>
<bulknotification>
  <requested desc="Number of ids in request">{ID_COUNT}</requested>
  <sent desc="Number of notification sent">{SENT_COUNT}</sent>  
</bulknotification>

Example response from Nokia Notifications API when details parameter is set to true and two of the recipients were unreachable:

<?xml version="1.0" encoding="UTF-8"?>
<bulknotification>
  <requested desc="Number of ids in request">{ID_COUNT}</requested>
  <sent desc="Number of notification sent">{SENT_COUNT}</sent>  
  <details desc="Recipients that were unreachable">
    <id>{ID}</id>
    <id>{ID_2}</id>
  </details>
</bulknotification>

Response when details parameter is set to true and expires-at parameter is used:

<?xml version="1.0" encoding="UTF-8"?>
<bulknotification>
  <requested desc="Number of ids in request">{ID_COUNT}</requested>
  <sent desc="Number of notification sent">{SENT_COUNT}</sent>  
  <details desc="Recipients whose message was stored">
    <id>{ID}</id>
    <id>{ID_2}</id>
  </details>
</bulknotification>

Error cases

400 Bad Request

Read the response body to check the error cause. It can be one of the following:

  • Maximum length exceeded for enc, ctype, title, subtitle, type or icon.

  • Target Notification IDs not specified. Add Notification ID list to your request.

  • Unknown version. Only version 1.0 is currently supported. Any other version (or no version) returns 400 Bad Request.

  • Target Notification ID incorrect.

  • Notification ID is not for this site.

  • Mandatory id parameter missing.

  • Request contains illegal characters. Only characters allowed by XML 1.0 specification are supported.

Response when Notification ID is not for this site but site is known:

<?xml version="1.0" encoding="UTF-8"?>
<bulknotificationerror>
  <id desc="Recipients whose site is not current">{IDs}</id> 
  <site desc="Address of site where id belongs to">{CORRECT SITE BASE URI}</site>
</bulknotificationerror>

Response when Notification ID is not for this site and site is not known:

<?xml version="1.0" encoding="UTF-8"?>
<bulknotificationerror>
  <id desc="Recipients whose site is not current">{IDs}</id> 
</bulknotificationerror>

401 Unauthorized

  • Authorisation failed. Incorrect service credentials.

  • Application ID incorrect. Check that you have correct Application ID in request.

  • TCP/TLS connection for the HTTP requests may not be persistent. Make sure that your service uses a persistent TCP/TLS connection for the HTTP requests.

  • Forbidden service. Service access to Nokia Notifications API is forbidden.

408 Request Timeout

There was no indication that the message has been delivered to the server. This does not cover situations when the message cannot be delivered to the actual mobile device, for example, because of fade out from the wireless network coverage.

413 Request Entity Too Large

Read the response body to check the error cause. It can be one of the following:

  • Payload exceeded maximum size 1.5 kB i.e. 1536 bytes.

  • Maximum length exceeded for id parameter.

500 Internal Server Error

Server encountered an unrecoverable error.

503 Service Unavailable

Maximum number of notifications that can be sent over an hour was exceeded.

Example

Sending bulk notification

Request POST URL

https://alpha.one.ovi.com/nnapi/1.0/bulk/nid

Request POST DATA

id=NIDexample1,NIDexample2,NIDexample3&payload=Test+bulk+notification&details=true
curl --digest -u "service_id:service_secret" -d "payload=Test bulk notification" –d "id=NIDexample1,NIDexample2,NIDexample3" https://alpha.one.ovi.com/nnapi/1.0/bulk/nid

Response DATA

HTTP/1.1 200 OK
Content-Length:414
Content-Type:application/vnd.nokia.ovi.ona+xml;charset=ISO-8859-1
<?xml version="1.0" encoding="UTF-8"?><bulknotification><requested desc="Number of ids in request">3</requested><sent desc="Number of notification sent">2</sent><details desc="Recipients that were unreachable"><id>NIDexmaple3</id></details></bulknotification>

Last updated 9 October 2013

Back to top

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×