ここで解説するAPI 1は非推奨となっているため、API 1.1を使用すべきです。





  • PNG
  • JPG
  • GIF (アニメーションGIFは除く)



  • characters_reserved_per_media
  • max_media_per_upload … 同時に投稿できるメディアの最大数
  • photo_size_limit … 画像サイズの上限



POST /1/statuses/update_with_media.json HTTP/1.1
Accept: */*
Authorization: OAuth oauth_version="1.0",oauth_nonce="xx",oauth_timestamp="000",oauth_consumer_key="xx",oauth_token="000-xx",oauth_signature_method="HMAC-SHA1",oauth_signature="xx"
Content-Length: 123
Content-Type: multipart/form-data; boundary=----------------------------xx


パラメータ 説明
status (必須) The text of your status update. URL encode as necessary. link wrapping may affect character counts if the post contains URLs. You must additionally account for the characters_reserved_per_media per uploaded media, additionally accounting for space characters in between finalized URLs.

Note: Request the GET help/configuration endpoint to get the current characters_reserved_per_media and max_media_per_upload values.

media[] (必須) Up to max_media_per_upload files may be specified in the request, each named media[]. Supported image formats are PNG, JPG and GIF. Animated GIFs are not supported.

Note: Request the GET help/configuration endpoint to get the current max_media_per_upload and photo_size_limit values.

possibly_sensitive Set to true for content which may not be suitable for every audience.
in_reply_to_status_id The ID of an existing status that the update is in reply to.

Note: This parameter will be ignored unless the author of the tweet this parameter references is mentioned within the status text. Therefore, you must include @username, where username is the author of the referenced tweet, within the update.

lat The latitude of the location this tweet refers to. This parameter will be ignored unless it is inside the range -90.0 to +90.0 (North is positive) inclusive. It will also be ignored if there isn't a corresponding long parameter.
long The longitude of the location this tweet refers to. The valid ranges for longitude is -180.0 to +180.0 (East is positive) inclusive. This parameter will be ignored if outside that range, not a number, geo_enabled is disabled, or if there not a corresponding lat parameter.
place_id A place in the world identified by a Twitter place ID. Place IDs can be retrieved from geo/reverse_geocode.
display_coordinates Whether or not to put a pin on the exact coordinates a tweet has been sent from.


非対応の画像フォーマットの送信などで送信に失敗した場合には、Error creating status.と返されます。



アップロードに対応させるにはtwitteroauth.phpを修正し、認可情報をエンティティ ボディではなくヘッダーに含めるようにします。またホストを「」に変更します。