Yelp API保留开口返回“找不到”

问题描述 投票:0回答:1

我想使用Yelp预订API来查看您可以在餐厅预订什么时间。每次查询API时,它都会返回以下内容:

{'error': {'code': 'NOT_FOUND', 'description': 'Resource could not be found.'}}

我正在使用以下端点:

https://api.yelp.com/v3/bookings/QR7JDps9RqH2430JSzasrg/openings

并使用以下代码(Python 3):

import requests

API_KEY = '<My key>'
ENDPOINT ='https://api.yelp.com/v3/bookings/QR7JDps9RqH2430JSzasrg/openings'
HEADERS = {'Authorization': 'Bearer %s' % API_KEY}

PARAMETERS = {
  'time': '17:30',   
  'date': '2019-08-06',
  'covers': 2,
}

response = requests.get(url=ENDPOINT,params=PARAMETERS,headers=HEADERS)
data = response.json()

print(data)

这是我要讨论的docs

我在做什么错?

感谢您的帮助。

python python-3.x http yelp yelp-fusion-api
1个回答
0
投票

对于PHP,看来您必须将参数与端点URL一起放入。对于Python而言,最可能是相同的。这是https://github.com/Yelp/yelp-fusion/blob/master/fusion/php/sample.php的示例(virgytam)。

© www.soinside.com 2019 - 2024. All rights reserved.