Push API \ Publish Tweet On Twitter PHP SDK

Resource/URI @Facebook GET POST PUT DELETE
Publish Post On Facebook /push/<identity_token>/facebook/post.json Publish
Post
Upload Picture To Facebook /push/<identity_token>/facebook/picture.json Upload
Picture
Upload Video To Facebook /push/<identity_token>/facebook/video.json Upload
Video
Resource/URI @LinkedIn GET POST PUT DELETE
Publish Post On LinkedIn /push/<identity_token>/linkedin/post.json Publish
Post
Resource/URI @Twitter GET POST PUT DELETE
Publish Tweet On Twitter /push/<identity_token>/twitter/post.json Publish
Tweet
Upload Picture To Twitter /push/<identity_token>/twitter/picture.json Upload
Picture

Workflow

Request: the code to send to the API

Send a POST request with the data below to the endpoint /push/<identity_token>/twitter/post.json to publish a new Tweet on behalf of a Twitter user. The <identity_token> is obtained whenever one of your users connects using a social network account.

To be able to use this endpoint Twitter must be fully configured for your OneAll Site and the setting Permissions \ Access of your Twitter app must be set to Read and Write.

POST data to include in the request

    {
     "request":{
       "push":{			
         "post":{
           "message": "#message#",
           "attachments":[
             "#picture_id#"
           ]
         }
       }
     }
    }
	
Key Description
* #message# The message to include in the Tweet. No more than 140 characters.
Example: Hello World!
attachments (list)
#picture_id# The Twitter identifier of a picture to attach to the Tweet. Up to four attachments are allowed.
You can upload new pictures by using the following API endpoint.
Example: 910890718352281600

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/twitter/post.json",
      "status":{
        "flag": "success",
        "code": 200,
        "info": "Your request has been processed successfully"
      }
    },
    "result":{
      "data":{
        "provider": "twitter",
        "object": "post",
        "post_id": "910891858989060096",
        "post_location": "https://twitter.com/OneAll/status/910891858989060091"
      }
    }
  }
}
	

User Contributed Notes