Push API \ Upload a picture to Twitter 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/board/<board_id>/pin.json Publish Pin
Pinterest · Publish a board on behalf of a user /push/identities/<identity_token>/pinterest/board.json Publish Board
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 this endpoint in order to upload a picture to the Twitter account of a user:

POST /push/identities/<identity_token>/twitter/picture.json

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

Successfully uploaded pictures are identified by a picture_id that can be used to attach the picture to a 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 permission 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://assets.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