0

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)
  • I am using this data diccionary: {'cabinclass': 'Economy', 'country': 'ES', 'currency': 'EUR', 'locale': 'es-ES', 'locationSchema': 'iata', 'originplace': 'MAD-sky', 'destinationplace': 'BCN-sky', 'outbounddate': '2021-04-30', 'inbounddate': '', 'adults': '1', 'children': '0', 'infants': '0', 'apikey': 'myapikey'} – Andrés Rodríguez Apr 10 '21 at 15:09

1 Answers1

1

An HTTP 403 error is typically used to indicate a lack of permissions. The error message you received "Missing base pricing access for session creation" seems to also point to inadequate permissions. The list of response codes here also supports a lack of access: https://skyscanner.github.io/slate/#response-codes

403 Forbidden -- The API Key was not supplied, or it was invalid, or it is not authorized to access the service.

I would try running the request through curl or a tool like Postman to confirm it's your API key and not your code. Then check with the API provider to determine why you don't have access to that endpoint.

dephekt
  • 446
  • 2
  • 9