Search code examples
facebook-marketing-api

Facebook Marketing API AdImage Upload - Image Resize Failed


I am trying to use image bytes to upload AdImages to the Facebook marketing API. Right now I'm just using the Graph Explorer to test stuff on a Sandbox Account.

I am using the following code to get images as bytes from a URL:

$bytes = base64_encode( file_get_contents( 'https://example.com/PATH/TO/image.jpg' ) );

When I do so I get this error:

{
    "error": {
        "message": "Invalid parameter",
        "type": "OAuthException",
        "code": 100,
        "error_subcode": 1487242,
        "is_transient": false,
        "error_user_title": "Image Resize Failed",
        "error_user_msg": "Image Resize Failed:unknown reason",
        "fbtrace_id": "DvqRl8YMleC"
    }
}

UPDATE: I reported this as a bug on Facebook, and they have escalated the issue.


Solution

  • The bytes parameter will only be accepted if it's a Post parameter.