Create Card issues

creative
media-upload

#1

I am successfully creating a campaign via java api
adding a line item to it
uploading an image via the upload api.
but when i try to add a card using the media_id_string i get this as a response
{“code”:“NOT_FOUND”,“parameter”:“image_media_id”,“message”:“701021818983993344 was not found”}
the number changes and matches with the previously uploaded image.
please ANY assistance would be greatly appreciated


Media not found on video upload
#2

Moving this to the Ads API category as it refers to Ads campaign cards.


#3

Hi @Vinoth! Are you using the sandbox environment?


#4

@Vinoth media IDs for content you upload are only valid for about an hour. They must be used to create a card, tweet, video, etc. within that timespan or the uploaded content will get flushed from Twitter’s servers.

As @majoritasdev was about to point out though, our sandbox environment for the Ads API (ads-api-sandbox.twitter.com) is a completely separate environment from production. As a result, media uploaded through POST /media/upload is not available in the sandbox. The sandbox is primarily an environment where you can test out campaign management without risk of accidentally causing any spend.

If you’re experimenting with creative content only it’s safe to do that in production where media IDs will work correctly for you.


Error when attempting to create a Video Poll
Error when attempting to create a Video Poll
#5

sorry for the delayed response.
I am uploading to live about 1 second before creating the card.
still getting the same result
Thank you for any assistance


#8

Here is further detail.
I added a call to :account/account_media in hopes that that was the missing link.
i get similar results
I post the image to uploadmedia
POST /1.1/media/upload.json
{“image”:{“w”:320,“h”:50,“image_type”:“image/png”},“size”:18962,“media_id_string”:“702530820502745089”,“media_id”:702530820502745089,“expires_after_secs”:86400}
i got back the media id and it has the correct size
POST /0/accounts/xxxxx/account_media?creative_type=BANNER&media_id=702530820502745089
So now i post that id to account_media immediately following the response from the upload
{“request”:{“params”:{“account_id”:“xxxxx”,“creative_type”:“BANNER”,“media_id”:702530820502745089}},“errors”:[{“code”:“INVALID_MEDIA_ID”,“message”:“Media referenced by media_id 702530820502745089 was not found.”}]}
and here is the createcard response called immediately after

{“request”:{“params”:{}},“errors”:[{“code”:“NOT_FOUND”,“parameter”:“image_media_id”,“message”:“702536535334264832 was not found”}]}
but, if i make the image small than 800px wide i get this response from create card
{“request”:{“params”:{}},“errors”:[{“code”:“INVALID_IMAGE”,“parameter”:"",“message”:“The image should be wider than 800 pixels”},{“code”:“INVALID_IMAGE”,“parameter”:"",“message”:“The image should be taller than 200 pixels”}]}
So i increase the image size to over 800x200
and i am back to this
{“request”:{“params”:{}},“errors”:[{“code”:“NOT_FOUND”,“parameter”:“image_media_id”,“message”:“702539438123954176 was not found”}]}

Something tells me the error messages i am getting are misleading?


#10

Few questions:

1.) Can you provide the media you are attempting to upload, so we can reproduce
2.) Are you using the product or sandbox environment?

Ryan