我正在尝试使用图像字节将AdImages上传到Facebook营销API。现在我只是使用Graph Explorer来测试Sandbox帐户上的内容。
我使用以下代码从URL获取图像作为字节:
$bytes = base64_encode( file_get_contents( 'https://example.com/PATH/TO/image.jpg' ) );
当我这样做时,我收到此错误:
{
"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"
}
}
更新:我在Facebook上报告这是一个错误,他们已经将问题升级了。
只有当它是Post参数时,才会接受bytes
参数。