POST push notifications/login/users/:id/publish
From Social ID Developers
Revision as of 17:02, 30 December 2021 by Gabriel.prado (Talk | contribs)
Contents |
Description
Sends a push notification to all devices of a Login User.
Resource URL
POST https://api.socialidnow.com/v1/marketing/push_notifications/login/users/:id/publish
Parameters
URL Parameters
id | required | user identifier. |
---|
JSON Parameters
data | required | a hash in the format field:value, with the necessary fields to create the notification: |
---|---|---|
message | required | notification message. |
title | optional | [Android] notification title. |
small_icon | optional | [Android] notification icon name. |
vibrate | optional | [Android] whether to vibrate or not when the notification is received. |
vibrate_duration | optional | [Android] vibration duration. |
auto_cancel | optional | [Android] whether the notifcation should or not be removed from the notification area when it is opened. |
big_style | optional | [Android] whether the notification should or not use BigStyle. |
activity_class | optional | [Android] class name to be invoked when the notification is opened. |
badge | optional | [iOS] numeric value of the notification badge. |
sound | optional | [iOS] file name of the sound to be played when the notification is received. |
Authentication
This API requires Login App authentication. See Authentication.
Response
Response Status
ok (200) | The notification was processed successfully. |
---|---|
bad_request (400) | The parameter "data" wasn't informed or is not a hash. |
unauthorized (401) | The authentication is wrong. See Authentication. |
forbidden (403) | The user does not belong to the Login App. |
unprocessable_entity (422) | Validation error in the field "data". |
internal_server_error (500) | An unknown error happened. |
Examples
Request
Creates a push notification for the Login User "33943".
curl -iX POST 'https://api.socialidnow.com/v1/marketing/push_notifications/login/users/33943/publish' \ -d '{ "data": { "message":"hello world", "vibrate":false, "badge":5 } }' \ -H 'Content-type:application/json' \ --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
Response
Response Headers
HTTP/1.1 200 Ok Status: 200