2

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.

Harish Gyanani
  • 1,366
  • 2
  • 22
  • 43
Kay Jun
  • 21
  • 2

2 Answers2

3

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
Rhys
  • 4,511
  • 2
  • 23
  • 32
Jin Ku
  • 196
  • 1
  • 2
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 is your App Api-Token on SendBird Portal

Naveen Tiwari
  • 301
  • 2
  • 12