[英]I can't found trip results in skyscanner REST API
I obtain this error: 403,\n "message": "Missing base pricing access for session creation when I try to obtain this requests in Python with Skyscanner REST API. Other requests are resolved correctly
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)
HTTP 403 錯誤通常用於指示缺少權限。 您收到的錯誤消息“缺少 session 創建的基本定價訪問權限”似乎也指向權限不足。 這里的響應碼列表也支持缺少訪問: https://skyscanner.github.io/slate/#response-codes
403 Forbidden -- 未提供 API 密鑰,或無效,或無權訪問服務。
我會嘗試通過 curl 或 Postman 之類的工具運行請求,以確認它是您的 API 密鑰而不是您的代碼。 然后檢查 API 提供程序以確定您無權訪問該端點的原因。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.