[英]OAuthException #100 when creating custom object with facebook sharp SDK
Basically, I have a custom object inheriting from place. 基本上,我有一个从地方继承的自定义对象。 I am creating ac# tool for creating the objects using the Facebook Sharp c# SDK located here I am using an app access token when making these calls. 我正在创建使用位于此处的Facebook Sharp c#SDK创建对象的ac#工具,我在进行这些调用时正在使用应用程序访问令牌。
I've tried various approaches and variation within: 我尝试了各种方法和变体:
Here is a sample call that yeilds: 这是一个示例调用:
(OAuthException - #100) (#100) The parameter object is required (OAuthException-#100)(#100)参数对象是必需的
_api.AccessToken = GetExtendedToken().Token; var postdata = new Dictionary<string, object> { //{"fb:app_id", "appId"}, //{"type", "myapp:myobject"}, {"url", resort.Url}, {"title", resort.Name }, {"image", resort.Image}, {"video", resort.Video}, {"description", resort.Description}, {"place:location:latitude", lat}, {"place:location:longitude", long} }; var response = _api.Post("/app/objects/myapp:myobject", postdata);
if I uncomment the type parameter I get: 如果取消注释类型参数,则会得到:
(OAuthException - #2500) Cannot specify type in both the path and query parameter (OAuthException-#2500)不能同时在path和query参数中指定类型
If I add the type back in, and remove the type from the path, I get a response of true but this should be something like id: 23049820398092384 如果我重新添加类型,然后从路径中删除类型, 则会得到true的响应,但这应该类似于id:23049820398092384
If I remove the place objects, or if I remove place and type, or if I remove place but use the type and change the get path, I still get errors. 如果删除放置对象,或者删除放置和类型,或者删除放置但使用类型并更改获取路径,则仍然会出错。
refactored a bit. 重构了一下。 In this scenario I needed to assign the postdata information to an object as such below. 在这种情况下,我需要将后数据信息分配给一个对象,如下所示。 also needed to stop using facebooksharp, their api does weird stuff to the request. 还需要停止使用facebooksharp,他们的api确实使请求变得奇怪。
var obj = new
{
app_id = appId,
type = app_name:object_type",
url = Url,
title = Name,
image = Image,
video = Video,
description = Description
};
var vars = new NameValueCollection {{"object", JsonConvert.SerializeObject(obj)}, {"format", "json"}, {"access_token", AppToken}};
var url = "https://graph.facebook.com/app/objects/"+ _appName + object_type;
return HttpTools.Post(url, vars);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.