简体   繁体   English

使用Facebook Sharp SDK创建自定义对象时出现OAuthException#100

[英]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: 我尝试了各种方法和变体:

  1. 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); 
  2. if I uncomment the type parameter I get: 如果取消注释类型参数,则会得到:

    (OAuthException - #2500) Cannot specify type in both the path and query parameter (OAuthException-#2500)不能同时在path和query参数中指定类型

  3. 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

  4. 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.

相关问题 C#facebook sdk:(OAuthException-#100)(#100)GK中的应用程序只需通过TOS检查 - C# facebook sdk : (OAuthException - #100) (#100) Apps in the GK only need to pass TOS check 使用Facebook C#SDK发布到Facebook页面时,我怎么突然开始收到OAuthException - How come I suddenly start receiving OAuthException when posting to facebook page using facebook c# SDK 访问Facebook时,如何解决OAuthException 100要求用户会话错误? - How do I resolve the OAuthException 100 Requires user session error when accessing Facebook? OAuthException 200 Facebook sdk wp8 - OAuthException 200 facebook sdk wp8 OAuthException Facebook C#SDK ie9 - OAuthException Facebook C# SDK ie9 Facebook c# sdk 错误 OAuthException - #2 - Facebook c# sdk error OAuthException - #2 Facebook(OAuthException - #100)尝试在节点类型(AnonymousUser)上访问不存在的字段(first_name) - Facebook (OAuthException - #100) Tried accessing nonexisting field (first_name) on node type (AnonymousUser) (OAuthException)在Facebook C#SDK上验证带有动态用户= FbApp.Get(“ me”)的访问令牌时出错 - (OAuthException) Error validating access token w/dynamic user = FbApp.Get(“me”) on Facebook C# SDK C Sharp Object仅在另一个类中创建和引用一个对象 - C Sharp Object creating and referencing only 1 object in another class 创建一个新的Thread()要求ParameterizedThreadStart对象作为C语言中的参数 - Creating new a Thread() is asking ParameterizedThreadStart object as a parameter in C sharp
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM