我正在尝试获取 SendBird 聊天 api 中的频道列表。
curl -d "auth=API_TOKEN" https://api.sendbird.com/channel/list
它不断返回Invalid Params
。
您应该使用json/application
内容类型,正文应该是json
.
例如:
curl -d '{"auth":"API_TOKEN"}' -H "Content-type: application/json" -X POST https://api.sendbird.com/channel/list
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