Provider API \ Publish content on a Facebook page PHP SDK
Provider API Resources
Resource/URI | GET |
---|---|
Providers
/providers.json
|
List all providers |
This endpoint has been deprecated and might be removed in the future. Please use the Push API instead.
Workflow
Request: the code to send to the API
POST
the data below to the resource /providers/facebook/pages/<page_token>/publish.json
to publish a message on a Facebook page. The <page_token>
is a unique token generated by the OneAll API for each page.
POST
data to include in the request
{ "request":{ "page_message":{ "parts":{ "text":{ "body": "#text_body#" }, "picture":{ "url": "#picture_url#", "caption": "#picture_caption#" }, "link":{ "url": "#link_url#", "name": "#link_name#", "caption": "#link_caption#", "description": "#link_description#" } } } } }
Key | Description |
---|---|
* #text_body# | The text to be published on the page. Either a text or a link must be supplied. Example: Hello World! |
#picture_url# | The URL of a picture to be included in the publication. Example: http://www.example.com/my_trip_to_australia.png |
#picture_caption# | The caption of the included picture. Example: My trip to Australia |
*#link_url# | A link to be included in the publication. Either a text or a link must be supplied. Example: http://www.example.com/my_page.html |
#link_name# | The name of the included link. Example: My page on example.com |
#link_caption# | The caption of the included link. Example: Visit us for more |
#link_description# | The description of the included link. Example: Our website is about examples. |
Result: the code returned by the API
The API will return a HTTP status code 200
and the identifier of the published message in case of successful post.
In case of an error, an appropriate message body with further details on the error that occured will be included in the result.
Example Resultset
{ "response": { "request": { "date": "Mon, 13 Apr 2015 17:58:09 0200", "resource": "/providers/facebook/pages/db2b8ecb-baf7-41e4-9118-9f6d6082bf80/publish.json", "status": { "flag": "success", "code": 200, "info": "Your request has been processed successfully" } }, "result": { "data": { "publication": { "source": { "id": "193485820675344_973703042653614" } } } } } }