facebook unsupported post request

匿名 (未验证) 提交于 2019-12-03 01:45:01

问题:

I have logged in a user to my app from FB.login now I want to post to the user timeline on the behalf of user. I want to upload a video to the user timeline. I am doing something like:

FB.api(     `/${user_id}/videos`,     "POST",     {         "file_url": video,         "description": description,         "thumb": video_thumbnail,         "title": title,       },     function (response) {       console.log("fb response")       console.log(response)       if (response && !response.error) {         /* handle the result */         console.log("video upload response")         console.log(response)       }     }, {scope: ['user_videos', 'user_actions.video']}); 

When I do this it is giving me error saying code: 100 fbtrace_id: "F1BDJWtcTXl" message: "Unsupported post request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api" type: "GraphMethodException"

Why I am getting this error ??

Help is appriciated ..

Thank you

回答1:

Use /me/videos instead of /${user_id}/videos and use single (or double) quotes instead of "`".

Also, you need publish_actions only, and you need to use the scope parameter with FB.login. FB.api is just an API call.

http://www.devils-heaven.com/facebook-javascript-sdk-login/

https://developers.facebook.com/docs/graph-api/reference/user/videos/#Creating

How to fix "Unsupported post request" when posting to FB fan page?



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