Unable to Create Promoted Video Tweet. Getting invalid_media error

video

#1

Unable to Create Promoted Video Tweet.

Video 13_1064548284189028352 has been published using ad account 18ce54c8201 with attributable_user_id as 722076694450806788.

Trying to publish video tweet using endpoint :
3/accounts/18ce54c8201/tweet

with request params :
video_id : 13_1064548284189028352
video_cta : WATCH_NOW
as_user_id : 722076694450806788
video_title : Shell Eco-marathon | India
text : Make the Future India, Chennai, December 6-9 #MakeTheFuture
account_id : 18ce54c8201
video_cta_value : https://www.shell.in/energy-and-innovation/make-the-future.html?utm_source=twitter&utm_content=FLIPBOOK FoM 2&utm_campaign=Make the future_Shell Eco-marathon_India_2018

getting error :
code : “INVALID_MEDIA”
message : “Invalid media key: 13_1064548284189028352”

Could you please let us know why we are getting invalid media error. We are publishing video and video tweet using ad account. And, both attributable_user_id while uploading video and as_user_id while publishing video tweet are set to 722076694450806788.


#2

twurl -H ‘ads-api.twitter.com’ ‘/3/accounts/18ce54c8201/authenticated_user_access’

{“data”:{“user_id”:722076694450806788,“permissions”:[“ACCOUNT_ADMIN”]},“request”:{“params”:{“account_id”:“18ce54c8201”}}}


#3

Hi @ashishkalya ,

It might be a URL encoding issue specifically for the value of video_cta_value you sent.

video_cta_value : https://www.shell.in/energy-and-innovation/make-the-future.html?utm_source=twitter&utm_content=FLIPBOOK FoM 2&utm_campaign=Make the future_Shell Eco-marathon_India_2018

Could you please encode blank space chars to %20 and try it again? like:

twurl -H 'ads-api.twitter.com' -X POST '/3/accounts/18ce54t1ol3/tweet?text=Make the Future India, Chennai, December 6-9 #MakeTheFuture&video_id= 13_1064548284189028352&video_title=Shell Eco-marathon | India&video_cta=WATCH_NOW&video_cta_value=https://www.shell.in/energy-and-innovation/make-the-future.html?utm_source=twitter&utm_content=FLIPBOOK%20FoM%202&utm_campaign=Make%20the%20future_Shell%20Eco-marathon_India_2018'

You don’t have to do espace for other parameters but video_cta_value as it’s a URL string and you have to follow the general HTTP URI encoding rules.

Best,
Shohei


#4

We are trying this out. Meanwhile, could u pls let us know why we are getting invalid_media error for incorrect video_cta_value.


#5

Hi @ashishkalya ,

Did that work? I was able to reproduce this error and also able to fix it by escaping space chars as I mentioned. I understand this is not a right error message for that reason and should be handled more clearly. I will report this internally but let me know if you should have any further questions regarding this matter.

Best,
Shohei


#6

Thanks. Have communicated the solution to the customer. Will let you know if we face any difficulty.