2

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

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

它不断返回Invalid Params

4

2 回答 2

3

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

例如:

curl -d '{"auth":"API_TOKEN"}' -H "Content-type: application/json" -X POST https://api.sendbird.com/channel/list
于 2016-02-10T20:43:04.260 回答
0
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

于 2018-08-11T10:18:35.227 回答