Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/422.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 未知路径组件_Javascript_Facebook_Facebook Graph Api_Facebook Opengraph - Fatal编程技术网

Javascript 未知路径组件

Javascript 未知路径组件,javascript,facebook,facebook-graph-api,facebook-opengraph,Javascript,Facebook,Facebook Graph Api,Facebook Opengraph,我试图发布一个“监视”操作,但我总是遇到以下错误: Error occured Type: OAuthException Message: Unknown path components: /MyAppName:watch 这是我的JS函数: function postWatch() { FB.api('/me/MyAppName:watch' + '?video=http//myLink.com','post', function(response) { v

我试图发布一个“监视”操作,但我总是遇到以下错误:

Error occured

Type: OAuthException

Message: Unknown path components: /MyAppName:watch
这是我的JS函数:

function postWatch()
  {
FB.api('/me/MyAppName:watch' + 
    '?video=http//myLink.com','post',
    function(response) {
    var msg = 'Error occured';
    if (!response || response.error) {
    if (response.error) {
    msg += "\n\nType: "+response.error.type+"\n\nMessage: "+response.error.message;
    }
    alert(msg);
    } 
    else {
    alert('Post was successful! Action ID: ' + response.id);
    }
    });
  }
这是我的og:标签

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"
      xmlns:fb="https://www.facebook.com/2008/fbml"> 
    <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# video: http://ogp.me/ns/video#">
    <meta property="fb:app_id" content="MyAppID" />
    <meta property="og:title" content="MyTitle" />
    <meta property="og:image" content="http://MyUrlImage.com" />
    <meta property="og:description" content="MyDescription" />
    <meta property="og:url" content="MyLink.com">
    <meta property="og:site_name" content="MySiteName" />
    <meta property="og:type" content="video.movie" /> 

有什么想法吗

谢谢;)

PS:对不起,我的英语很差,我是法国人;)


关于

对于内置操作,语法不同。使用video.watchs

实际上,对于您自己的操作/对象,您可以使用以下语法:

var params = {};
params['video'] = 'http://example.com/myvideo.html';
FB.api('me/mynamespace:watch','post',params,function(response){
       console.log(response);
});
如果您的用户提供了“发布”操作的权限,那么这实际上会在墙上发布带有对象的操作。 对于权限,您可能希望确保您拥有权限,因此您的检查应如下所示:

FB.api('me/permissions','get',function(response){
       if (response.data[0].publish_actions){
          //do your magic
       }      
});