首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我在skyscanner REST API中找不到trip结果

我在skyscanner REST API中找不到trip结果
EN

Stack Overflow用户
提问于 2021-04-10 23:03:21
回答 1查看 73关注 0票数 0

我获得此错误: 403,\n "message“:”当我尝试在Python中使用Skyscanner REST API获取此请求时,缺少用于会话创建的基本定价访问权限。其他请求已正确解决

代码语言:javascript
复制
  data = {
  'cabinclass': 'Economy',
  'country': 'ES',
  'currency': 'EUR',
  'locale': 'es-ES',
  'locationSchema': 'iata',
  'originplace': '{origin}'.format(origin=originplace),
  'destinationplace': '{destination}'.format(destination=destinationplace),
  'outbounddate': '{y}-{m}-{d}'.format(y=str(date.year),m=str(date.month).zfill(2),d=str(date.day).zfill(2)),
  'inbounddate':'',
  'adults': '{numadul}'.format(numadul=nadults),
  'children': '{numchildren}'.format(numchildren=nchildren),
  'infants': '{numinfants}'.format(numinfants=ninfants),
  'apikey': 'myapiKey'
 }

headers = {
  'Content-Type': 'application/x-www-form-urlencoded',
}

 



response=requests.post('https://partners.api.skyscanner.net/apiservices/pricing/v1.0',headers=headers, data=data)
EN

回答 1

Stack Overflow用户

发布于 2021-04-12 23:44:21

HTTP 403错误通常用于指示缺少权限。您收到的错误消息"Missing base pricing access for session creation“似乎也表明权限不足。这里的响应代码列表也支持缺少访问权限:https://skyscanner.github.io/slate/#response-codes

API403被禁止--未提供

密钥,或密钥无效,或未授权访问该服务。

我会尝试通过curl或Postman之类的工具运行请求,以确认这是您的API密钥,而不是您的代码。然后与API提供程序进行核对,以确定您无法访问该端点的原因。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67035841

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档