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

Token missing #14

Closed
leonardoARoman opened this issue Dec 9, 2018 · 0 comments
Closed

Token missing #14

leonardoARoman opened this issue Dec 9, 2018 · 0 comments

Comments

@leonardoARoman
Copy link

I am using python2.7 and python3 and yelpapi 2.20.1 I think. Now, this is my first time using Yelp and I am kind of clueless so please bear with me. I've tried two different methods and I get two different errors
METHOD 1:
from yelpapi import YelpAPI
from pprint import pprint
import argparse
key = 'my_key'
yelp_api = YelpAPI(key)
#search_results = yelp_api.search_query(term='ice cream', location='austin, tx', sort_by='rating', limit=5)
#response = yelp_api.search_query(categories='bikerentals', longitude=-122.4392, latitude=37.7474, limit=5)
response = yelp_api.phone_search_query(phone='+13193375512')

This will give me the following error:
{'error': {'code': 'TOKEN_MISSING', 'description': 'An access token must be supplied in order to use this endpoint.'}}

METHOD 2:
from yelpapi import YelpAPI
from pprint import pprint
import argparse
key = 'my_key'
argparser = argparse.ArgumentParser(description='Example Yelp queries using yelpapi. '
'Visit https://www.yelp.com/developers/v3/manage_app to get the '
'necessary API keys.')
argparser.add_argument(key, type=str, help='Yelp Fusion API Key')
args = argparser.parse_args()

yelp_api = YelpAPI(args.api_key)

This will give me the following error where app.py is my python code and my_key the actual key:
usage: app.py [-h]
my_key
app.py: error: too few arguments

I've even try to query from Postman and still can get a result! this is what I get from Postman:

{
"error": {
"code": "TOKEN_MISSING",
"description": "An access token must be supplied in order to use this endpoint."
}
}

Thanks in advance

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