Use Graph API Explorer to post a photo

主宰稳场 提交于 2019-12-05 18:28:33

I don't think the Graph API explorer tool supports file upload, so you won't be able to use it to check your uploads.

Facebook accepts a url param for image uploads - point that to a full image url, and Facebook should pick it up. Since it's just a string, you can use the Explorer for that.

However, Facebook should come back with reasonable errors for photo uploads - I'd start coding rather than worry about the explorer tool!

Use curl with the -F and "source=" flags and it should work. Here is a code snippet from one of our applications (we construct this curl command from PHP):

curl -F 'access_token=xxxxxx' -F 'source=@/path/to/image.jpg' 
-F 'message=' -F 'privacy={"value": "EVERYONE"}' 
https://graph.facebook.com/FB-ALBUM-ID/photos

I managed to post images from Graph API explorer using this!

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!