0

I have read the documentation for OAuth on this website.

But I am still confused about the format in which the request url is supposed to be in.

Any help would be amazing.

Arsenic
  • 727
  • 1
  • 8
  • 22

2 Answers2

2

You may use the following request url to generate the Access Token,

String URL = "https://outpost.mapmyindia.com/api/security/oauth/token?grant_type=client_credentials&client_id="+clientid+"&client_secret="+clientsecret;

And, add the following Headers in the POST Method,

("accept", "application/json")

("Content-Type", "application/x-www-form-urlencoded")

If you are using Volley Library to get the Access Token using the POST request, you may pass the parameters as a HashMap as follows:

Map<String, String> params = new HashMap<String, String>();
            params.put("accept", "application/json");
            params.put("Content-Type", "application/x-www-form-urlencoded");
Vaibhav
  • 117
  • 7
1

It looks like they use Spring. And it requires grant_type to be passed as application/x-www-form-urlencoded. And the credentials in a header:

{
  'Authorization': `Basic ${base64Encode(clientId:clientSecret)}`,
}
Yaroslav
  • 31
  • 1
  • 3