Forums

Facebook Marketing API - Creative can't access my photo

Hello everyone,

I've set up a little python code that, upon receiving a POST request from a Google Sheets API, will create a Facebook Campaign, ad set, ad creative, ad form and ad.

I have to create some images for the adcreative which I do from some templates and the created image is then stored on my static folder.

The static folder is available publicly: https://angelo31.pythonanywhere.com/static/template_0.jpg (you should be able to access this image and if not, I am wrong).

Yet, I still get the following error from Facebook:

2024-11-28 13:10:28 {'error': {'message': 'Invalid parameter', 'type': 'OAuthException', 'code': 100, 'error_subcode': 3858258, 'is_transient': False, 'error_user_title': 'Image non téléchargée', 'error_user_msg': 'Votre image, https://angelo31.pythonanywhere.com/static/template_0.jpg, couldn't be downloaded. Make sure the image is accessible online and isn't blocked by robots.txt', 'fbtrace_id': 'A6Foi4KIF1OBSph2tEp93_c'}}

I am not sure as to why I get this error since the image can be accessed online and I don't have a robots.txt. I've tried this with other images URL online and it worked, not sure why the one from pythonAnywhere doesn't.

Thanks for your help!

Kind regards, Angelo

Since the image appears to be served from that location, the issue is probably with some sort of Facebook config and we cannot help with that.

Yeah I ended up changing how I do it. I just upload the image to FB now, get its hash and pass it as hash to the creative.

I'm glad you found a solution.