# Introduction

## API

Allocate uses hypermedia as the engine of application state. Given initial availability parameters you can follow returned links in response bodies to take a booking to completion.

Every request will return a JSON payload with three top level properties:

```javascript
{
   "head": {},
   "href": "https://...",
   "body": {},
}
```

The `head` property contains related information on other resources (sometimes inlined) you can fetch.&#x20;

`href` is always the location of the fetched resource (for caching)

`body` contains the resource you have requested and can be a deeply nested JSON object.

{% hint style="info" %}
We recommend exploring the API using a tool such as [Insomnia](https://insomnia.rest/) which will let you work through a booking just by clicking the next links at each stage. Try starting with this availability url and clicking through the links you find.

<https://example.allocate.co.uk/api/v2/availability/?date_from=2023-09-03&date_to=2023-09-03&nights=2&stay_occs=3>
{% endhint %}

Explore the methods documented in the pages below

{% content-ref url="api/property-api" %}
[property-api](https://docs.allocate.co.uk/api/property-api)
{% endcontent-ref %}

{% content-ref url="api/booking" %}
[booking](https://docs.allocate.co.uk/api/booking)
{% endcontent-ref %}

## Widget

Allocate has a widget you can install on your existing website which will allow you to take bookings.

{% content-ref url="widget/widget" %}
[widget](https://docs.allocate.co.uk/widget/widget)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.allocate.co.uk/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
