Push API \ Publish a post on a Facebook page PHP SDK

Resource/URI GET POST PUT DELETE
Facebook · Publish a post on a user's profile /push/identities/<identity_token>/facebook/post.json Publish
User Post
Facebook · Upload a picture on behalf of a user /push/identities/<identity_token>/facebook/picture.json Upload
User Picture
Facebook · Upload a video on behalf of a user /push/identities/<identity_token>/facebook/video.json Upload
User Video
Facebook · Publish a post on a page the user administers /push/identities/<identity_token>/facebook/page/post.json Publish
Page Post
Facebook · Publish a video on a page the user administers /push/identities/<identity_token>/facebook/page/video.json Upload
Page Video
LinkedIn · Publish a post on a user's profile /push/identities/<identity_token>/linkedin/post.json Publish
User Post
LinkedIn · Publish a post on a company page the user administers /push/identities/<identity_token>/linkedin/company/post.json Publish
Company Post
Twitter · Publish a tweet on a user's timeline /push/identities/<identity_token>/twitter/post.json Publish
Tweet
Twitter · Upload a picture on behalf of a user /push/identities/<identity_token>/twitter/picture.json Upload
Picture
Twitter · Upload a video on behalf of a user /push/identities/<identity_token>/twitter/video.json Upload
Video
Pinterest · Publish a pin on behalf of a user /push/identities/<identity_token>/pinterest/pin.json Publish
Pin
YouTube · Publish a video on behalf of a user /push/identities/<identity_token>/youtube/video.json Upload
Video

Workflow

Request: the code to send to the API

Send a POST request with the data below to the endpoint /push/identities/<identity_token>/facebook/page/post.json to publish a message on the timeline of a Facebook page. The <identity_token> is obtained whenever one of your users connects using his Facebook account.

To order to use this endpoint the permissions Manage Pages and Publish Pages must be enabled in the Facebook settings in your OneAll account and the user must have granted that permission when he logged in with Facebook. You can use our Pull API to retrieve the pages of a user.

POST data to include in the request

    {
     "request": {
       "push": {			
         "page": {
           "id": "#id#",
           "message": "#message#",
           "link": "#link#",
           "attachments":[
             "#picture_id#"
           ]
         }
       }
     }
    }
	
Key Description
* #id#
integer
The identifier of the page to publish the content to.
You can use our Pull API to retrieve the pages of a user.
Example: 4563453
* #message#
string
The message to include in the post.
Example: Hello World!
#link#
string
The link to include in the post.
Example: http://www.oneall.com/
attachments (list) - You can either include a link or attachments but not both at the same time.
#picture_id#
integer
The Facebook identifier of a picture to attach to the post. Only one single attachment allowed.
You can upload a new picture by using the following API endpoint.
Example: 10213097336001811

Result: the code returned by the API

Resultset Example

{
  "response":{
    "request":{
      "date": "Thu, 21 Sep 2017 15:56:59  0200",
      "resource": "/push/identities/923843ec-1749-4cc1-988f-d6963f3b1baa/facebook/post.json",
      "status":{
        "flag": "success",
        "code": 200,
        "info": "Your request has been processed successfully"
      }
    },
    "result":{
      "data":{
        "provider": "facebook",
        "object": "post",
        "post_id": "1122334455_10213097383563000",
        "post_location": "https://www.facebook.com/1122334455_10213097383563000"
      }
    }
  }
}
	

User Contributed Notes