我已经从FB.login登录了用户到我的应用程序,现在我想代表用户发布到用户时间线.我想将视频上传到用户时间轴.我正在做类似的事情:
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']});执行此操作时,出现错误提示code: 100 fbtrace_id: "F1BDJWtcTXl" message: "Unsupported post request. Please read the Graph API documentation at developers.facebook/docs/graph-api" type: "GraphMethodException"
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 developers.facebook/docs/graph-api" type: "GraphMethodException"
为什么我会收到此错误?
Why I am getting this error ??
寻求帮助..
谢谢
推荐答案使用/me/videos代替/${user_id}/videos,并使用单引号(或双引号)代替`".
Use /me/videos instead of /${user_id}/videos and use single (or double) quotes instead of "`".
此外,您仅需要publish_actions,并且需要将scope参数与FB.login一起使用. FB.api只是一个API调用.
Also, you need publish_actions only, and you need to use the scope parameter with FB.login. FB.api is just an API call.
以下是登录示例: www .devils-heaven/facebook-javascript-sdk-login/
这是用于上传视频的文档的链接: developers.facebook/docs/graph-api/reference/user/videos/#Creating
And here´s the link to the docs for uploading videos: developers.facebook/docs/graph-api/reference/user/videos/#Creating
有人建议该应用程序可能处于沙盒/开发模式,不知道为什么这应该是一个问题,但这是线程:如何修复不支持的帖子请求"在发布到FB粉丝页面时是什么?
Someone suggested that the App may be in sandbox/dev mode, no sure why this should be a problem but here´s the thread: How to fix "Unsupported post request" when posting to FB fan page?
更多推荐
Facebook不支持的帖子请求
发布评论