Push API \ Publish a post to a Facebook group PHP SDK

Resource/URI POST
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 to a group the user is member of /push/identities/<identity_token>/facebook/group/post.json Publish Group Post
Facebook · Upload a picture to a group the user is member of /push/identities/<identity_token>/facebook/group/picture.json Upload Group Picture
Facebook · Upload a video to a group the user is member of /push/identities/<identity_token>/facebook/group/video.json Upload Group Video
Facebook · Publish a post on a page the user administers /push/identities/<identity_token>/facebook/page/post.json Publish Page Post
Facebook · Upload a picture on behalf of a page that the user administers /push/identities/<identity_token>/facebook/page/picture.json Upload Page Picture
Facebook · Upload a video on behalf of a page that 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
Pinterest · Publish a pin on behalf of a user /push/identities/<identity_token>/pinterest/pin.json Publish Pin
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
YouTube · Publish a video on behalf of a user /push/identities/<identity_token>/youtube/video.json Upload Video
YouTube · Add a video to a playlist /push/identities/<identity_token>/youtube/playlist/<playlist_id>/video.json Add Video to Playlist
YouTube · Create a playlist on behalf of a user /push/identities/<identity_token>/youtube/playlist.json Create Playlist
YouTube · Add a section to a user's channel /push/identities/<identity_token>/youtube/channel/section.json Add Channel Section

Workflow

Request: the code to send to the API

Send an API request to the following endpoint in order to publish a new post to a group on Facebook:

POST /push/identities/<identity_token>/facebook/group/post.json

The <identity_token> is obtained whenever one of your users connects using his Facebook account.

In order to use this endpoint the permission Publish To Group must be enabled in the Facebook settings in your OneAll account and the user must have granted this permission when he logged in with Facebook. You can use our Pull API to retrieve the groups of an identity.

POST data to include in the request

      {
       "request": {
         "push": {			
           "group": {
             "id": "#id#",
             "message": "#message#",
             "link": "#link#"
           }
         }
       }
      }
  	
Key Description
* #id#
integer
The identifier of the group on which to publish the post.
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/

Result: the code returned by the API

Resultset Example

  {
    "response":{
      "request":{
        "date": "Thu, 21 Sep 2017 15:56:59  0200",
        "resource": "/push/identities/0az2d2azd-096b-459f-a90b-cdsd5f1e516/facebook/group/post.json",
        "status":{
          "flag": "success",
          "code": 200,
          "info": "Your request has been processed successfully"
        }
      },
      "result":{
        "data":{
          "provider" : "facebook",
          "object" : "post",
          "post_id" : "145437213572676_161852928597771",
          "post_location" : "https://www.facebook.com/145437213572676_161852928597771"
        }
      }
    }
  }
  	

User Contributed Notes