【问题标题】:How can I get SendBird server API working?如何让 SendBird 服务器 API 工作?
【发布时间】:2018-08-11 18:18:35
【问题描述】:

我正在尝试在 SendBird 聊天 api 中获取频道列表。

curl -d "auth=API_TOKEN" https://api.sendbird.com/channel/list

它不断返回Invalid Params

【问题讨论】:

    标签: rest api sdk chat sendbird


    【解决方案1】:

    您应该使用json/application 内容类型和正文应该是json

    例如:

    curl -d '{"auth":"API_TOKEN"}' -H "Content-type: application/json" -X POST https://api.sendbird.com/channel/list
    

    【讨论】:

      【解决方案2】:
      Try To pass Api-Token with Header 
      
      HttpClient client = new HttpClient();
      
      var request = new HttpRequestMessage();            
                      request.Headers.Add("Api-Token", SendBirdApiToken);
                      request.Method = new HttpMethod("GET");
                      request.RequestUri = new Uri(SendBirdUserUrl, UriKind.RelativeOrAbsolute);
      
                      var result = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, CancellationToken.None);
      

      SendBirdApiToken 是您在 SendBird Portal 上的 App Api-Token

      【讨论】:

        猜你喜欢
        • 2015-08-03
        • 1970-01-01
        • 2014-07-30
        • 2011-08-10
        • 1970-01-01
        • 1970-01-01
        • 2010-09-20
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多