POST push notifications/login/apps/publish
From Social ID Developers
(Difference between revisions)
Line 1: | Line 1: | ||
== Description == | == Description == | ||
− | Sends a push notification to all devices of a | + | Sends a push notification to all devices of a Login App. |
== Resource URL == | == Resource URL == | ||
Line 59: | Line 59: | ||
== Authentication == | == Authentication == | ||
− | This API requires | + | This API requires Login App authentication. See [[Authentication]]. |
== Response == | == Response == | ||
Line 86: | Line 86: | ||
=== Request === | === Request === | ||
− | Creates a push notification for the | + | Creates a push notification for the Login App. |
curl -iX POST 'https://api.socialidnow.com/v1/marketing/push_notifications/login/apps/publish' \ | curl -iX POST 'https://api.socialidnow.com/v1/marketing/push_notifications/login/apps/publish' \ |
Latest revision as of 16:49, 30 December 2021
Contents |
Description
Sends a push notification to all devices of a Login App.
Resource URL
POST https://api.socialidnow.com/v1/marketing/push_notifications/login/apps/publish
Parameters
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. |
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 App.
curl -iX POST 'https://api.socialidnow.com/v1/marketing/push_notifications/login/apps/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