Receiving 500 errors trying to create Video object


I’m trying to create tweets with a VideoWebsiteCard via the api, so I’m uploading a video, creating a Video object, then creating a VideoWebsiteCard object and finally a Tweet.

This worked for me yesterday, but in the afternoon I started receiving 500 errors from the twitter API when saving the Video object.

I’m able to successfully upload a video and receive a media_id, but when I create the Video object, I get an HTTP 500 error (attached at the end of this post).

I can’t find a twitter API status page, so I’m not sure if there’s a more general issue happening, or if I’m doing something wrong?

In [116]: video = twitter_ads.creative.Video(account)

In [117]: video
Out[117]: <Video resource at 0x10c16b9d0 id=None>

In [118]: video.description = video_params[‘description’]

In [119]: video.title = video_params[‘title’]

In [120]: video.video_media_id = video_params[‘video_media_id’]

In [121]: video.poster_image_media_id = video_params[‘poster_image_media_id’]

In [122]: video.to_params()
{‘description’: ‘twitter video description’,
‘poster_image_media_id’: u’1001891432632762371’,
‘title’: ‘twitter video title’,
‘video_media_id’: u’1001899387734274049’}

In [123]:

ServerError Traceback (most recent call last)
in ()
----> 1

/path/to/lib/python2.7/site-packages/twitter_ads/resource.pyc in save(self)
199 response = Request(
200 self.account.client, method,
–> 201 resource, params=self.to_params()).perform()
203 return self.from_response(response.body[‘data’])

/path/to/lib/python2.7/site-packages/twitter_ads/http.pyc in perform(self)
70 response = self.__oauth_request()
71 if response.code > 399:
—> 72 raise Error.from_response(response)
73 return response

ServerError: <ServerError object at 0x10c124dc0 code=500 details=[{u’message’: u’Internal Error’, u’code’: u’INTERNAL_ERROR’}]>


Thanks for posting details about your implementation and the response. Many INTERNAL_ERROR issues are temporary backend service issues and should not persist. If you have a retry mechanism you may be able to succeed on the second try. If it happens persistently and is still happening today, please definitely post again and someone will take a look into the cause.


I’m using a retry mechanism that waits progressively longer for each retry, but the call continued to throw a 500 each time. This persisted for at least 3 days, before I moved on to working on something else. I came back another few days later and the call is now working.

Is there a twitter ads api status page somewhere? It’s more difficult to integrate with the twitter ads api if I don’t have feedback on whether I’m doing something wrong, versus the ads api is having issues.


Thanks for the good suggestion, @JBabichJapan.

@anrope: Sorry to hear you have been experiencing issues. So that we can check our logs, could you please make the same request again and provide the media ID as well as the account ID you’re using? We need a recent (unsuccessful) request to verify in our logs. Thanks!