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()
Out[122]:
{‘description’: ‘twitter video description’,
‘poster_image_media_id’: u’1001891432632762371’,
‘title’: ‘twitter video title’,
‘video_media_id’: u’1001899387734274049’}
In [123]: video.save()
ServerError Traceback (most recent call last)
in ()
----> 1 video.save()
/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()
202
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
74
ServerError: <ServerError object at 0x10c124dc0 code=500 details=[{u’message’: u’Internal Error’, u’code’: u’INTERNAL_ERROR’}]>