2

I am trying to integrate the YELP API within an application in Android Studio. I am trying to acquire an access token using a post request in Postman. However, when I send the post request I get this error returned in JSON format:

{
"error": {
    "code": "VALIDATION_ERROR",
    "description": "'client_credentials' is not one of ['authorization_code', 'refresh_token']",
    "field": "grant_type",
    "instance": "client_credentials"
   }
}

I have searched this site and google for what the description line means in particular:

"description": "'client_credentials' is not one of ['authorization_code', 'refresh_token']",

I have not been able to find any results as to what this error means. Here is my project setup in postman:

enter image description here

I simply copy and pasted my client ID and API key from yelp and stored them within the client_id and client_secret in Postman respectively. When I send this requestion I get the 400 Bad Request error and find out that its a validation error. At first I thought that I entered the wrong API key, however, I refreshed the API key and directly copy and pasted it, so I am confident that my API key and client ID are correct. The output should look like this and it should deliver an access token:

enter image description here

I couldn't find any examples that had this specific error message.

brooksrelyt
  • 3,925
  • 5
  • 31
  • 54
Simeon Ikudabo
  • 2,152
  • 1
  • 10
  • 27

1 Answers1

3

You no longer need a refresh token, all you need is an API key in your Authorization header:

Authorization: Bearer {{apiKey}}

Source: https://www.yelp.com/developers/documentation/v3/authentication

so cal cheesehead
  • 2,515
  • 4
  • 29
  • 50
  • Thank you. The issue is that the documentation shows no way to do this in Postman. That's where I'm kind of lost at this point. I have no clue where to type in "Authorization: Bearer {{apikey}} because all of the data that I saw online only shows how to do it when you needed a refresh token. I can't find any examples of doing this in Postman to get the access token. – Simeon Ikudabo Oct 26 '18 at 01:23
  • 1
    I was able to figure it out in POSTMAN. Under Bearer Token I simply added the API key as the token. Thanks for the help. That put me on the right path and saved the day. – Simeon Ikudabo Oct 26 '18 at 14:17
  • @SimeonIkudabo - can you post the screenshot of your solution? – viru Nov 27 '18 at 23:20