Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving 403 Error on javascript fetch #340

Closed
goodbar-dev opened this issue Jan 4, 2018 · 1 comment
Closed

Receiving 403 Error on javascript fetch #340

goodbar-dev opened this issue Jan 4, 2018 · 1 comment

Comments

@goodbar-dev
Copy link

goodbar-dev commented Jan 4, 2018

Overview

  • **Client ID: zWLhTbc_Q0R2800Q5EPSKw
  • **Issue type: Question
  • **Summary: Making a get call from javascript using fetch and the new API KEY, but receiving a 403 error.
  • **Platform: Web

Description

Using the below call in javascript with my actual API Key substituted in from my own website, I am receiving a 403 error. Is there anything wrong with my request that would be causing the error?

Endpoint

Fusion Search API

Parameters or Sample Request

fetch(`https://api.yelp.com/v3/businesses/search?latitude=${lat}&longitude=${lng}`, {
  headers: {
    Authorization: 'Bearer <API_KEY>'
  }
}).then(function(response) {
  debugger;
}).catch(function(err) {
  console.log(err);
});

Response

HTTP403: FORBIDDEN - The server understood the request, but is refusing to fulfill it.
(Fetch)OPTIONS - https://api.yelp.com/v3/businesses/search?latitude=44.50326189999999&longitude=-88.06424670000001

@goodbar-dev goodbar-dev changed the title Receiving 403 Error Receiving 403 Error on javascript fetch Jan 4, 2018
@goodbar-dev
Copy link
Author

Sounds like CORS is not supported by Yelp API, hence the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant