Community Discussion

Ask a Question
Back to All

Trying to retrieve access token

Hello, I recently got my credentials from Taboola.
I try to get the access token using the description in your documentation, in C#.
The response I get is an HTML page, not JSON.
Would you know why?

var client = new RestClient("https://backstage.taboola.com/backstage/oauth/token");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "client_id=MY_ID&client_secret=MY_SECRET&grant_type=client_credentials", ParameterType.RequestBody);
var response = client.Execute(request);