Error:invalid_client getting the Client Credentials

Having the same issue when trying to make a REST call to UiPath with following request data:
{
“grant_type”:“client_credentials”,
“client_id”:“APP-ID-FROM-CLOUD”,
“client_secret”:“APP-SECRET-FROM-CLOUD”,
“scope”:“OR.Tasks OR.Folders OR.Folders.Write OR.Folders.Read OR.Robots OR.Robots.Read OR.Robots.Write OR.Machines OR.Machines.Read OR.Machines.Write OR.Jobs.Write OR.Jobs OR.Jobs.Read”
}
I tried using both application/json and application/x-www-form-urlencoded for Content-type in request header. Both ways seems to fail.
With application/json the call is failing with CORS erros.
With application/x-www-form-urlencoded call is failing with {“error”:“invalid_client”}.
I am trying to connect to orchestrator and create a job from a website in my local machine. The web site is running in on localhost.
I have checked the External application setting and have given all the detail including scopes and redirect url and using the APP ID, Secret received in this page.

Kindly help me resolve this issue