【问题标题】:Create a Subscription in instagram with c#使用 c# 在 instagram 中创建订阅
【发布时间】:2023-03-03 01:50:01
【问题描述】:

我点击了这个链接OAuth 2.0 In .NET With Instagram API,它帮助我解决了获取访问令牌的问题。

我的代码是这样的:

NameValueCollection parameters = new NameValueCollection
                                             {
                                                 {"client_id", ClientId},
                                                 {"client_secret", ClientSecretId},
                                                 {"object", "user"},
                                                 {"aspect", "media"},
                                                 {"verify_token", "thisIsANormalSubscription"},
                                                 {"callback_url", CallbackURI}
                                             };

        WebClient client = new WebClient();
        var result = client.UploadValues(SubscriptionURI, parameters);

SubscriptionURI = "https://api.instagram.com/v1/subscriptions"。

我正在遵循 instagram(http://instagram.com/developer/realtime/) 的指南,包括 POST 请求的所有参数。但是我只在执行 client.UploadValues 时收到 400 错误。

PS:这是我的第一篇文章,所以可能不像我希望的那样吸引眼球

【问题讨论】:

标签: c# instagram


【解决方案1】:

如果你有访问令牌,你可以使用我找到的这个插件,它会从用户那里获取最新的照片。

Instagram .NET

【讨论】:

  • 你可以访问插件here...我会看看为什么网站关闭
  • 它仍然没有回答我的问题,只是用插件绕过它。
  • 如果您仍想访问该网站,目前是不可能的。我运行了那个站点,它有关于 instagram 的 API 和插件信息的信息,不幸的是我没有时间再维护它了。如果您有其他关于插件的问题,我很乐意提供帮助。
【解决方案2】:

如果您使用 Instasharp 客户端 API (https://github.com/InstaSharp/InstaSharp),您可以执行以下操作:

    public InstagramConfig Config 
    {
        get
        {
            return new InstagramConfig(InstagramAuthorisationModel.ApplicationId, InstagramAuthorisationModel.Secret);
        }
    }

public void YourSubscribeMethod(string searchTerm)
{
    var result = await new Subscription(Config).CreateTag(searchTerm))
}

其中 InstagramAuthorisationModel 是一个保存您注册的应用程序 ID 和机密的类 您可以为 Geography、(CreateGeography)、User (CreateUser) 和 (CreateLocation) 方法创建订阅。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-12-02
    • 2015-11-18
    • 1970-01-01
    • 1970-01-01
    • 2014-07-11
    • 1970-01-01
    • 2014-11-27
    • 2020-02-10
    相关资源
    最近更新 更多