The HTTP Push API restnotification provides a mechanism to send push notification to an application that is registered with SAP Mobile Platform Server.
The restnotification API sends native push notifications to applications. This RESTful service provides more flexibility for sending push messages than existing interfaces that are based on HTTP headers or URL parameters. Earlier push interfaces required that you send messages to a registration ID. The restnotification interface also sends the message to a specific user or to all users of a specific application.
The restnotification API allows to send message to multiple recipients. The messages are queued in SAP Mobile Platform Server and sent out asynchronously.
http[s]://<host:port>/restnotification/<resource>
https://<HMC base URL>/restnotification/<resource>
http[s]://<host:port>/restnotification/application/<applicationId>
https://<HMC base URL>/restnotification/application/<applicationId>
> POST /restnotification/application/123456789 HTTP/1.1 > Authorization: Basic cHVzaDpzZWNyZXQ= > User-Agent: curl/7.36.0 > Host: localhost:8080 > Accept: */* > Content-Type: application/json;charset=utf-8 > Content-Length: 127 > { "alert": "alertval", "badge": 1, "data": "testData", "sound": "soundval" } < HTTP/1.1 201 Created < Content-Length: 0 < Date: Mon, 05 May 2014 00:29:38 GMT < Server: SAP
http[s]://<host:port>/restnotification/application/<applicationId>/user/<userID>
https://<HMC base URL>/restnotification/application/<applicationId>/user/<userID>
> POST /restnotification/application/123456789/user/timmitester HTTP/1.1 > Authorization: Basic cHVzaDpzZWNyZXQ= > User-Agent: curl/7.36.0 > Host: localhost:8080 > Accept: */* > Content-Type: application/json;charset=utf-8 > Content-Length: 127 > { "alert": "alertval", "badge": 1, "data": "testData", "sound": "soundval" } < HTTP/1.1 201 Created < Set-Cookie: X-SMP-SESSIDSSO=C05E58BE3CFC685ABB945D53C2AF14FD; Path=/; HttpOnly < Set-Cookie: X-SMP-SESSID=4CC5BC2943E5D3A9B5D924888FC28CB060034F0092911A66B9F079047077798C; Path=/; HttpOnly < Content-Length: 0 < Date: Mon, 05 May 2014 00:32:35 GMT < Server: SAP
http[s]://<host:port>/restnotification/registration/<applicationRegistrationId>
https://<HMC base URL>/restnotification/registration/<applicationRegistrationId>
> POST /restnotification/registration/9f847e51-3242-4899-9193-39b6e840d657 HTTP/1.1 > Authorization: Basic cHVzaDpzZWNyZXQ= > User-Agent: curl/7.36.0 > Host: localhost:8080 > Accept: */* > Content-Type: application/json;charset=utf-8 > Content-Length: 127 > { "alert": "alertval", "badge": 1, "data": "testData", "sound": "soundval" } < HTTP/1.1 201 Created < Set-Cookie: X-SMP-SESSIDSSO=D541E4898186AB304F506D13C0C3F1D0; Path=/; HttpOnly < Set-Cookie: X-SMP-SESSID=FDB39F9BAE8A6E1AD4373765A58E094A14B8FDFB8289CC70E51B77A284C50736; Path=/; HttpOnly < Content-Length: 0 < Date: Mon, 05 May 2014 00:36:15 GMT < Server: SAP
http[s]://<host:port>/restnotification/application/<applicationId>/user
https://<HMC base URL>/restnotification/application/<applicationId>/user
POST /restnotification/application/123456789/user HTTP/1.1 > Authorization: Basic cHVzaDpzZWNyZXQ= > User-Agent: curl/7.36.0 > Host: localhost:8080 > Accept: */* > Content-Type: application/json;charset=utf-8 > Content-Length: 277 > { "notification": { "alert": "alertval", "badge": 1, "data": "testData", "sound": "soundval" }, "users": [ "timmitester", "user1", "user2" ] } < HTTP/1.1 201 Created < Set-Cookie: X-SMP-SESSIDSSO=9AD06173C8AB9FC05FD6AA8DC55BB9AE; Path=/; HttpOnly < Set-Cookie: X-SMP-SESSID=DFB2D2AC4EBAA4903553EB7C5A0C90870BD4B8F3A3DC19A5FD984673EB1BD646; Path=/; HttpOnly < Content-Length: 0 < Date: Mon, 05 May 2014 00:38:32 GMT < Server: SAP
http[s]://<host:port>/restnotification/registration
https://<HMC base URL>/restnotification/registration
POST /restnotification/registration HTTP/1.1 > Authorization: Basic cHVzaDpzZWNyZXQ= > User-Agent: curl/7.36.0 > Host: localhost:8080 > Accept: */* > Content-Type: application/json;charset=utf-8 > Content-Length: 466 > { "notification": { "alert": "alertval", "badge": 1, "data": "testData", "sound": "soundval" }, "registrations": [ "3078e166-f144-4288-9dbc-1d192afe18d8", "9f847e51-3242-4899-9193-39b6e840d657", "4d1ccdf9-058a-42cf-a625-c4ed48944729", "f05dc905-b859-45fa-afdc-da3b630d2b48", "282be579-783e-40fb-b376-25bed5e13606" ] } < HTTP/1.1 201 Created < Set-Cookie: X-SMP-SESSIDSSO=BCA5FCB41DD7F451410E3E8BB59E8F7A; Path=/; HttpOnly < Set-Cookie: X-SMP-SESSID=2AC74022B258178ED3A88E4B2FA10AB41093F53C3D0A77976FE6FE076F1E3CC2; Path=/; HttpOnly < Content-Length: 0 < Date: Mon, 05 May 2014 00:41:52 GMT < Server: SAP
> POST /restnotification/application/XYZ HTTP/1.1 > Authorization: Basic cHVzaDpzZWNyZXQ= > User-Agent: curl/7.36.0 > Host: localhost:8080 > Accept: */* > Content-Type: application/json;charset=utf-8 > { "alert": "alertval", "badge": 1, "data": "testData", "sound": "soundval" }
> { "alert": "alertval", "badge": 1, "customParameters": { "gcm.sound": "soundforgcm" }, "data": "testData", "sound": "soundval" }