Facebook不支持的帖子请求 [英] facebook unsupported post request

查看:117
本文介绍了Facebook不支持的帖子请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从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 https://developers.facebook.com/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 https://developers.facebook.com/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.

以下是登录示例: http://www .devils-heaven.com/facebook-javascript-sdk-login/

这是用于上传视频的文档的链接:

And here´s the link to the docs for uploading videos: https://developers.facebook.com/docs/graph-api/reference/user/videos/#Creating

有人建议该应用程序可能处于沙盒/开发模式,不知道为什么这应该是一个问题,但这是线程:

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不支持的帖子请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆