POST login/users/:user id/notifications/facebook
From Social ID Developers
(Difference between revisions)
Renato.neves (Talk | contribs) (→JSON Parameters) |
|||
(10 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
Posts a Facebook notification to the user. | Posts a Facebook notification to the user. | ||
+ | |||
+ | Read the documentation about Facebook Notifications at https://developers.facebook.com/docs/games/notifications to understand how to use this API, the limitations and best practices. Important details: | ||
+ | |||
+ | * Facebook Apps must have Canvas Page configured. | ||
+ | * Facebook Apps can send notifications only to people who have authorized the app. | ||
+ | * No special or extended Facebook permission is required. | ||
+ | * Facebook Apps that send more than 50,000 notifications in a week are required to maintain at least a 17% weekly click-to-impression (CTI) ratio. | ||
+ | * Best practices: https://developers.facebook.com/docs/games/notifications#best_practices | ||
== Resource URL == | == Resource URL == | ||
Line 22: | Line 30: | ||
! align="left" width="200px" | notification | ! align="left" width="200px" | notification | ||
| width="200px" | required | | width="200px" | required | ||
− | | a hash with the necessary fields to post the | + | | a hash with the necessary fields to post the notification: |
|- | |- | ||
! align="left" width="180px" style="padding-left: 20px" | template | ! align="left" width="180px" style="padding-left: 20px" | template | ||
Line 31: | Line 39: | ||
| width="200px" | optional | | width="200px" | optional | ||
| The relative path that someone clicking on the notification will be directed to. This is will be appended to the Facebook app's canvas URL. | | The relative path that someone clicking on the notification will be directed to. This is will be appended to the Facebook app's canvas URL. | ||
+ | |- | ||
+ | ! align="left" width="180px" style="padding-left: 20px" | ref | ||
+ | | width="200px" | optional | ||
+ | | Separate your notifications into groups so they can be tracked independently in Facebook App Analytics. | ||
|} | |} | ||
== Authentication == | == Authentication == | ||
− | This API requires | + | This API requires Login App authentication. See [[Authentication]]. |
+ | |||
+ | == Response == | ||
+ | |||
+ | === Response Status === | ||
+ | |||
+ | {| | ||
+ | ! align="left" width="200px" | accepted (202) | ||
+ | | The request was accepted and will be processed. | ||
+ | |- | ||
+ | ! align="left" width="200px" | bad_request (400) | ||
+ | | The parameters are missing or invalid. | ||
+ | |- | ||
+ | ! align="left" width="200px" | unauthorized (401) | ||
+ | | The authentication is wrong. See [[Authentication]]. | ||
+ | |- | ||
+ | ! align="left" width="200px" | internal_server_error (500) | ||
+ | | An unknown error happened. | ||
+ | |} | ||
== Examples == | == Examples == | ||
Line 41: | Line 71: | ||
=== Request === | === Request === | ||
− | curl -iX POST 'https://api.socialidnow.com/v1/marketing/login/users/ | + | curl -iX POST 'https://api.socialidnow.com/v1/marketing/login/users/340/notifications/facebook' \ |
− | -d '{" | + | -d '{"notification": {"template": "Visit Social-ID NOW", |
− | + | "href": "/visit/campaign" }}' \ | |
-H 'Content-type: application/json' \ | -H 'Content-type: application/json' \ | ||
--user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf | --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf | ||
Line 51: | Line 81: | ||
==== Response Headers ==== | ==== Response Headers ==== | ||
− | HTTP/1.1 | + | HTTP/1.1 202 Accepted |
− | Status: | + | Status: 202 |
Latest revision as of 16:51, 30 December 2021
Contents |
Description
Posts a Facebook notification to the user.
Read the documentation about Facebook Notifications at https://developers.facebook.com/docs/games/notifications to understand how to use this API, the limitations and best practices. Important details:
- Facebook Apps must have Canvas Page configured.
- Facebook Apps can send notifications only to people who have authorized the app.
- No special or extended Facebook permission is required.
- Facebook Apps that send more than 50,000 notifications in a week are required to maintain at least a 17% weekly click-to-impression (CTI) ratio.
- Best practices: https://developers.facebook.com/docs/games/notifications#best_practices
Resource URL
POST https://api.socialidnow.com/v1/marketing/login/users/:user_id/notifications/facebook
Parameters
URL Parameters
user_id | required | user identifier. |
---|
JSON Parameters
notification | required | a hash with the necessary fields to post the notification: |
---|---|---|
template | required | The message text of the notification. This can be formatted according to special text templating. Maximum of 180 characters. |
href | optional | The relative path that someone clicking on the notification will be directed to. This is will be appended to the Facebook app's canvas URL. |
ref | optional | Separate your notifications into groups so they can be tracked independently in Facebook App Analytics. |
Authentication
This API requires Login App authentication. See Authentication.
Response
Response Status
accepted (202) | The request was accepted and will be processed. |
---|---|
bad_request (400) | The parameters are missing or invalid. |
unauthorized (401) | The authentication is wrong. See Authentication. |
internal_server_error (500) | An unknown error happened. |
Examples
Request
curl -iX POST 'https://api.socialidnow.com/v1/marketing/login/users/340/notifications/facebook' \ -d '{"notification": {"template": "Visit Social-ID NOW", "href": "/visit/campaign" }}' \ -H 'Content-type: application/json' \ --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
Response
Response Headers
HTTP/1.1 202 Accepted Status: 202