Can not use video in a card or tweet


#1

So we use video chunk upload to upload the video we get the media_id.

Than we use this endpoint to get the status https://upload.twitter.com/1.1/media/upload.json we wait until the state is succeeded this is responce

Array
(
[state] => succeeded
[progress_percent] => 100
)

Than we use this endpoint to create video_id https://ads-api.twitter.com/0/accounts/:adaccount/videos for some reason the this endpoint returns the same id that we send to it

Array
(
[data_type] => video
[data] => Array
(
[id] => 710106294292762624
)

[request] => Array
    (
        [params] => Array
            (
                [video_media_id] => 710106294292762624
                [account_id] => XXXXXXX
            )
    )

)

than we use that id to create tweet with video and we get this error Message: Video referenced by video_id 710106294292762624 is not ready.

We can see the video on the Twitter UI and we do a GET call on this endpoint for that video https://ads-api.twitter.com/0/accounts/:adaccount/videos we get this responce

public ‘data_type’ => string ‘video’ (length=5)
public ‘data’ =>
array (size=1)
0 =>
object(stdClass)[181]
public ‘tweeted’ => boolean false
public ‘ready_to_tweet’ => boolean true
public ‘duration’ => int 10000
public ‘reasons_not_servable’ =>
array (size=0)
empty
public ‘description’ => string ‘’ (length=0)
public ‘preview_url’ => string ‘https://amp.twimg.com/prod/multibr_v_1/video/2016/03/16/14/710106294292762624-libx264-baseline-2528k.mp4?i1WhvgvpizyQ46zBZgyQcnOXKESw7EqJTEBb7CK%2BA9w%3D’ (length=153)
public ‘id’ => string ‘710106294292762624’ (length=18)
public ‘created_at’ => string ‘2016-03-16T14:12:50Z’ (length=20)
public ‘title’ => string ‘’ (length=0)
public ‘updated_at’ => string ‘2016-03-16T14:13:42Z’ (length=20)
public ‘deleted’ => boolean false
public ‘request’ =>
object(stdClass)[182]
public ‘params’ =>
object(stdClass)[183]
public ‘account_id’ => string ‘XXXXXXXXXXXX’ (length=11)
public ‘next_cursor’ => null


#2

Hi there,

The Video API returning the same ID is expected behavior.

Two follow-up questions:

1.) Are you able to use the video in the UI?
2.) Are you able to use the video in the API later? The “not ready” may indicate it’s still processing on our side, though – as you noted – it should have been encoded in the media upload step.


#3
  1. Yes we can use it in the UI
  2. After some time we can use it in the API

We have spoted than when we get the video is processed ([state] => succeeded) in the API we can see it in the UI and it still has status processing in the UI.