Currently in the process of learning how to utilize this system, however there appears to be an issue with my code.
$.ajax({
dataType: "POST",
url: "https://api.yelp.com/oauth2/token",
grant_type: "client_credentials",
client_id: "my_client_id",
client_secret: "my_client_secret",
success: function(data,textStatus,jqXHR) {
console.log(data,textStatus,jqXHR);
}
});
The values for 'my_client_id' and 'my_client_secret' are obtained from yelp. The browser displays the following error message:
XMLHttpRequest cannot load https://api.yelp.com/oauth2/token.
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'null' is therefore not allowed access. The response had HTTP status code 404.
Edit:
Upon retrying with
yelpTokenURL = "https://api.yelp.com/oauth2/token?grant_type=client_credentials&client_id="
+ id + "&client_secret=" + secret;
jQuery.post(yelpTokenURL, function(){
console.log(data);
});
An error occurred:
XMLHttpRequest cannot load https://... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.