Push API \ Publish a post on a Facebook user profile PHP SDK

Resource/URI @Facebook GET POST PUT DELETE
Publish a post on a Facebook user profile /push/identities/<identity_token>/facebook/post.json Publish
User
Publish a post on a Facebook page /push/identities/<identity_token>/facebook/page/post.json Publish
Page
Upload a picture to Facebook /push/identities/<identity_token>/facebook/picture.json Upload
Picture
Upload a video to Facebook /push/identities/<identity_token>/facebook/video.json Upload
Video
Resource/URI @LinkedIn GET POST PUT DELETE
Publish on a LinkedIn user profile /push/identities/<identity_token>/linkedin/post.json Publish
User
Publish on a LinkedIn company page /push/identities/<identity_token>/linkedin/company/post.json Publish
Company
Resource/URI @Twitter GET POST PUT DELETE
Publish a tweet on Twitter /push/identities/<identity_token>/twitter/post.json Publish
Tweet
Upload a picture to Twitter /push/identities/<identity_token>/twitter/picture.json Upload
Picture
Upload a video to Twitter /push/identities/<identity_token>/twitter/video.json Upload
Video
Resource/URI @Pinterest GET POST PUT DELETE
Publish a pin on Pinterest /push/identities/<identity_token>/pinterest/pin.json Publish
Pin
Resource/URI @YouTube GET POST PUT DELETE
Publish a video on YouTube /push/identities/<identity_token>/youtube/video.json Publish
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/post.json to publish a message on the timeline of a Facebook account. The <identity_token> is obtained whenever one of your users connects using a social network account.

To be able to use this endpoint Facebook must be fully configured for your OneAll Site and the user must have given consent to publish content on his behalf when he logged in with Facebook.

POST data to include in the request

    {
     "request":{
       "push":{			
         "post":{
           "message": "#message#",
           "link": "#link#",
           "attachments":[
             "#picture_id#"
           ]
         }
       }
     }
    }
	
Key Description
* #message# The message to include in the post.
Example: Hello World!
#link# 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# 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