Thanks @brandonmblack
All the videos I have uploaded are in .mp4 format and those are supported.
Resolution 640x360 (maintaining 16:9 aspect ratio)
Duration always between 5sec and 30sec
Tried with files < 5MB which can be uploaded in single chunk
I am using the same token in media upload request as well as in POST/videos.
Moreover the example response on POST/Videos page suggests that “data” field in json response has many fields inside it but I only receive “id” field. I am attaching my terminal output and link for video
Initialisation
Dubeys-MacBook:~ prashant$ twurl -H upload.twitter.com “/1.1/media/upload.json” -d “command=INIT&media_type=video/mp4&total_bytes=752331”
{“media_id”:639314475921854464,“media_id_string”:“639314475921854464”,“expires_after_secs”:86399}Dubeys-MacBook:~ prashant$
Video upload
Dubeys-MacBook:~ prashant$
Dubeys-MacBook:~ prashant$ twurl -H upload.twitter.com “/1.1/media/upload.json” -d “command=APPEND&media_id=639314475921854464&segment_index=0” --file ~/Downloads/images-twitter/DRQCQaiww7XlAYJP.mp4 --file-field “media”
finalize
Dubeys-MacBook:~ prashant$ twurl -H upload.twitter.com “/1.1/media/upload.json” -d “command=FINALIZE&media_id=639314475921854464”
{“media_id”:639314475921854464,“media_id_string”:“639314475921854464”,“size”:752331,“expires_after_secs”:86400,“video”:{“video_type”:“video/mp4”}}Dubeys-MacBook:~ prashant$
video object created
Dubeys-MacBook:~ prashant$
Dubeys-MacBook:~ prashant$
Dubeys-MacBook:~ prashant$ twurl -X POST -H ads-api.twitter.com “/0/accounts/18ce53w6fst/videos” -d “video_media_id=639314475921854464&title=sample video&description=testing on sep 3”
{“data_type”:“video”,“data”:{“id”:“b93ea18b-2c3b-40d6-931d-48d35f62e493”},“request”:{“params”:{“video_media_id”:639314475921854464,“title”:“sample video”,“description”:“testing on sep 3”,“account_id”:“18ce53w6fst”}}}Dubeys-MacBook:~ prashant$
GET/Videos endpoint
Dubeys-MacBook:~ prashant$
Dubeys-MacBook:~ prashant$ twurl -X GET -H ads-api.twitter.com "/0/accounts/18ce53w6fst/videos"
only relevant output
{“tweeted”:false,“ready_to_tweet”:false,“duration”:null,“reasons_not_servable”:[“ERROR”],“description”:“testing on sep 3”,“preview_url”:null,“id”:“b93ea18b-2c3b-40d6-931d-48d35f62e493”,“created_at”:“2015-09-03T05:53:27Z”,“title”:“sample video”,“updated_at”:“2015-09-03T05:53:27Z”,“deleted”:false}
You can easily see the account ID from the requests.
Is it safe to mention the user id?(privacy concerns)