Unable to tweet videos using the media/upload (chunked) API



Hello There,

I am using the POST media/upload (chunked) API for uploading my 1 MB video on twitter as a tweet,
and using the code-bird twitter library file. I have follow the following step for uploading video.

  1. INIT (Initialize an upload)
  2. APPEND (Upload(s) of chunked data)
  3. FINALIZE (Complete the upload)
  4. STATUS (Check the processing status of the upload (for async video uploads only))

First 3 step i got successful response with media id. Here is my step4 code

`// Now use the media_id in a tweet
$reply = $cb->statuses_update(array(
    'status'    => 'Twitter now accepts video uploads.',
    'media_ids' => $media_id

However when i try to update status with ‘media_ids’ as parameter in this API, this returned the following error.

Please help me out if you find any mistake in my code. Any suggestion would be appreciated.

Thanks in advanced.


Please post the result of this call, insert it before calling statuses_update:



Hello jublonet,

Thanks for replying. The following screen shot shows the result of FINALIZE step(3rd step) along with media id.


The video file size is okay (1.2 MB).
Try using the media_id_string property instead of media_id:

// Now use the media_id in a tweet
$reply = $cb->statuses_update(array(
  'status'    => 'Twitter now accepts video uploads.',
  'media_ids' => $media_id_string // using string version

Does that work better?


Actually i am using the code like this,


$reply = $cb->statuses_update(array(
    'status'    => 'Twitter now accepts video uploads.',
    'media_ids' => $media_id

But its not Working.


This is not an issue with the Codebird library, but with the Twitter API itself. @andypiper, are you able to jump in?


@tpcgsocial, could you attach or provide a URL to the video in question? I would like to isolate where the issue is taking place.


@jbulava how to do async upload in iOS swift ? Your documentation does not explain it and does not provide example… Thanks for your help.


@mydaypix We have added relevant information to https://dev.twitter.com/rest/reference/post/media/upload-finalize.