Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can get the result in another format with the non-mandatory parameter output (possible values are 'array' or 'object')

Code Block
languagejs
titleAvailability single room query for array response
linenumberstrue
{
    "session": "6167a22d1f87d2028bf6",
    "arrival": "2017-05-01",
    "departure": "2017-05-03",
    "rooms": [{
            "adults": 2
        }
    ],
    "language": "en",
    "currency": "EUR",
    "output": "array",
    "hotels": [{
            "hotel_id": 258705,
            "hotel_spider_id": "A123"
        }, {
            "hotel_id": 730099,
            "hotel_spider_id": "B456"
        }, {
            "hotel_id": 555555,
            "hotel_spider_id": "555"
        },
    ]
}

Example with 'array' output type :

Code Block
languagejs
titleAvailability single room array response example
linenumberstrue
[
    {
		"hotel_spider_id": "A123",
        "response_type": "available",
        "availabilities": [{
			"id": "00P582abdecadadd",
			"name": "Double deluxe / Non-refundable",
			"guestRoomId": "00P582abdfee305d",
			"ratePlanId": "00P56ba183cad830",
			"totalPrice": 240,
			"currency": "EUR",
			"availability": 26,
			"url": "https://reservations.hotel-spider.com/#/02g5aa27f42cfb7f/room?id=02g5aa2808ea8b58&channelId=344&checkIn=2019-10-23&checkOut=2019-10-25&nbAdults=2&nbChildren=0&nbInfants=0&currency=EUR&lang=en"
		},{
			"id": "00P582abdecadaee",
			"name": "Double deluxe / Standard",
			"guestRoomId": "00P582abdfee305d",
			"ratePlanId": "00P592eb6b621542",
			"totalPrice": 240,
			"currency": "EUR",
			"availability": 26,
			"url": "https://reservations.hotel-spider.com/#/02g5aa27f42cfb7f/room?id=02g5aa2808ea8b58&channelId=344&checkIn=2019-10-23&checkOut=2019-10-25&nbAdults=2&nbChildren=0&nbInfants=0&currency=EUR&lang=en"
		},{
			"id": "00P582abdecadadd",
			"name": "Single / Non-refundable",
			"guestRoomId": "00P56ba154cd2a5f",
			"ratePlanId": "00P56ba183cad830",
			"totalPrice": 240,
			"currency": "EUR",
			"availability": 26,
			"url": "https://reservations.hotel-spider.com/#/02g5aa27f42cfb7f/room?id=02g5aa2808ea8b58&channelId=344&checkIn=2019-10-23&checkOut=2019-10-25&nbAdults=2&nbChildren=0&nbInfants=0&currency=EUR&lang=en"
		}]
    },
    {
		"hotel_spider_id": "B456",
        "response_type": "unavailable"
    },
    {
		"hotel_spider_id": "555",
        "response_type": "error",
        "error": {
            error_code: 3
            message: "Unknown hotel id was requested."
        }
    }
]

...