How to get a Yelp access token

691 views Asked by At

I am trying to use the yelp fusion api but cannot seem to find out how to format the url. I have read the get started page but do not understand it. I just need to know where to put what. This is what I have so far: https://api.yelp.com/oauth2/token?grant_type=client_credentials&client_id=ID&client_secret="CLIENT SECRET" When I load this url it says "VALIDATION_ERROR." What am I doing wrong?

1

There are 1 answers

1
Nithin A Y On

The grant_type,client_id and client_secret should be sent in application/x-www-form-urlencoded format in the POST call.

curl -X POST \
https://api.yelp.com/oauth2/token \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials&client_id=CLIENT_ID&client_secret=CLIENT_SECRET'