how to get chat oauth token using c#
답변함hello.
i want to call chat api with c# console
bellow is my chat setting and my source code
1. zendesk chat setting
* this zendesk chat is trial ver
2. C# console source code
* i using RestSharp
//=============================================
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
var client = new RestClient("https://www.zopim.com/oauth2/token");
var request = new RestRequest();
request.AddParameter("grant_type", "client_credentials");
request.AddParameter("client_id", "aQ4xhWZFwkCStiwTCarZxpw0wBk7vWRnHWV76jRc6YbNpDYMoF");
request.AddParameter("client_secret", "CLIENT_SECRET_KEY");
var response = client.Post(request);
Console.WriteLine(response.Content);
//=============================================
However, errors occur.
"{\"error\": \"invalid_client\"}"
How do I fix it to work?
Have a nice day.
-
Hi Jason Jeong! This is outside of what we can normally troubleshoot, but I did some Googling and it looks like you may need to pass in some additional headers: https://community.apigee.com/questions/44542/why-do-i-get-an-invalid-client-response-when-gener.html
Good luck, I hope that helps!
댓글을 남기려면 로그인하세요.
1 댓글