Reputation: 21
I am trying to get a list of channels in SendBird chat api.
curl -d "auth=API_TOKEN" https://api.sendbird.com/channel/list
It keeps returning Invalid Params
.
Upvotes: 2
Views: 1283
Reputation: 361
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 is your App Api-Token on SendBird Portal
Upvotes: 0
Reputation: 196
You should use json/application
content type and body should be json
.
For example:
curl -d '{"auth":"API_TOKEN"}' -H "Content-type: application/json" -X POST https://api.sendbird.com/channel/list
Upvotes: 3