Push API \ Upload Picture On Twitter PHP SDK

Resource/URI @Facebook GET POST PUT DELETE
Publish Post On Facebook /push/identities/<identity_token>/facebook/post.json Publish
Post
Upload Picture To Facebook /push/identities/<identity_token>/facebook/picture.json Upload
Picture
Upload Video To Facebook /push/identities/<identity_token>/facebook/video.json Upload
Video
Resource/URI @LinkedIn GET POST PUT DELETE
Publish Post On LinkedIn /push/identities/<identity_token>/linkedin/post.json Publish
Post
Resource/URI @Twitter GET POST PUT DELETE
Publish Tweet On Twitter /push/identities/<identity_token>/twitter/post.json Publish
Tweet
Upload Picture To Twitter /push/identities/<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/identities/<identity_token>/twitter/picture.json to upload a picture to the Twitter account of a user. The <identity_token> is obtained whenever one of your users connects using a social network account.

By using the picture_id of the uploaded picture you can attach it to a new Tweet. Pictures that are not attached to a Tweet will be removed from Twitter after 24 hours.

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":{
      "picture":{
        "description": "#description#",
        "url": "#url#"
      }
    }
  }
}
	
Key Description
#description# A description of the uploaded picture.
Example: OneAll Logo
* #url# The fully qualified URL of the picture to upload. The picture may not be larger than 5MB and must have one of the following formats: jpeg, bmp, png, gif, tiff.
Example: http://public.oneallcdn.com/img/oneall/logo_sni_retina.png

Result: the code returned by the API

Resultset Example

{
  "response":{
    "request":{
      "date": "Thu, 21 Sep 2017 16:25:31  0200",
      "resource": "/push/identities/923843ec-1749-4cc1-988f-d6963f3b1baa/twitter/picture.json",
      "status":{
        "flag": "success",
        "code": 200,
        "info": "Your request has been processed successfully"
      }
    },
    "result":{
      "data":{
        "provider": "twitter",
        "object": "picture",
        "picture_id": "910890718352281600",
        "expires_in": "86400"
      }
    }
  }
}
	

User Contributed Notes