Facebook上的Javascript SDK开放式图形:错误添加自定义对象自定义的故事 [英] Facebook Javascript SDK open-graph: error adding custom objects for custom stories
问题描述
我创建了一个自定义对象,被称为意见,以围绕它建立自定义的故事。
I've created a custom object, called 'Opinion' to build custom stories around it.
我想使用的JavaScript SDK我的网站上添加一些应用程序拥有的对象。
I'm trying to add some app-owned objects from my website using the javascript sdk.
样品code的Facebook给我的是:
The sample code facebook gives me is:
FB.api(
'me/objects/[namespace]:opinion',
'post',
{
app_id: xxxxxxxx,
type: "[namespace]:opinion",
url: "http://samples.ogp.me/331257847005141",
title: "Sample Opinion",
image: "https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png",
description: ""
},
function(response) {
// handle the response
}
);
该效应初探是错误的(OAuth的除外):
The reponse is an error (OAuth Exception):
2500: Cannot specify type in both the path and query parameter.
如果我删除键入
参数,我得到另一个错误:
If i remove the type
parameter, i get another error:
(#100) The parameter object is required
相同的,如果我删除 [命名空间]:意见
从路径
我不明白为什么,谷歌搜索后没有关于此引用。
I don't understand why, and there's no reference about this after googling it.
为什么呢?任何资源可以参考我解决?
Why this? Any resource i can refer to solve that?
推荐答案
对象是一个对象的JSON-CN codeD版,样品code生成你是不正确的。另外从参数列表中删除类型。
The object is a JSON-encoded version of an object, the sample code generated for you was incorrect. Also remove type from the parameter list.
因此,像
FB.api(
'me/objects/[namespace]:opinion',
'post',
{
object: {"app_id":xxx,"url":"http:\/\/samples.ogp.me\/331257847005141","title":"\"Sample Opinion\"","image":"https:\/\/s-static.ak.fbcdn.net\/images\/devsite\/attachment_blank.png","description":"\"\""}
},
function(response) {
// handle the response
}
);
它的外观的例子可以在<一中可以看出href=\"http://philippeharewood.com/facebook/objectify.html\">http://philippeharewood.com/facebook/objectify.html它是基于下车<特定卷曲的例子href=\"https://developers.facebook.com/docs/opengraph/using-object-api/\">https://developers.facebook.com/docs/opengraph/using-object-api/
这篇关于Facebook上的Javascript SDK开放式图形:错误添加自定义对象自定义的故事的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!