我正在尝试在SendBird chat api中获取频道列表。
curl -d "auth=API_TOKEN" https://api.sendbird.com/channel/list
不断返回Invalid Params
。
答案 0 :(得分:3)
您应该使用json/application
内容类型,正文应为json
。
例如:
curl -d '{"auth":"API_TOKEN"}' -H "Content-type: application/json" -X POST https://api.sendbird.com/channel/list
答案 1 :(得分:1)
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门户上的应用Api令牌