|
1 | 1 | openapi: 3.0.2
|
2 | 2 | info:
|
3 | 3 | title: Composition API
|
4 |
| - description: Composition API. |
| 4 | + description: | |
| 5 | + The Algolia Composition API lets you run composed search requests on your Compositions. |
| 6 | +
|
| 7 | + ## Client libraries |
| 8 | +
|
| 9 | + Use Algolia's API clients and libraries to reliably integrate Algolia's APIs with your apps. |
| 10 | +
|
| 11 | + See: [Algolia's ecosystem](https://www.algolia.com/doc/guides/getting-started/how-algolia-works/in-depth/ecosystem/) |
| 12 | +
|
| 13 | + ## Base URLs |
| 14 | +
|
| 15 | + The base URLs for requests to the Composition API are: |
| 16 | +
|
| 17 | + - `https://{APPLICATION_ID}.algolia.net` |
| 18 | + - `https://{APPLICATION_ID}-dsn.algolia.net`. |
| 19 | + If your subscription includes a [Distributed Search Network](https://dashboard.algolia.com/infra), |
| 20 | + this ensures that requests are sent to servers closest to users. |
| 21 | +
|
| 22 | + Both URLs provide high availability by distributing requests with load balancing. |
| 23 | +
|
| 24 | + **All requests must use HTTPS.** |
| 25 | +
|
| 26 | + ## Retry strategy |
| 27 | +
|
| 28 | + To guarantee high availability, implement a retry strategy for all API requests using the URLs of your servers as fallbacks: |
| 29 | +
|
| 30 | + - `https://{APPLICATION_ID}-1.algolianet.com` |
| 31 | + - `https://{APPLICATION_ID}-2.algolianet.com` |
| 32 | + - `https://{APPLICATION_ID}-3.algolianet.com` |
| 33 | +
|
| 34 | + These URLs use a different DNS provider than the primary URLs. |
| 35 | + You should randomize this list to ensure an even load across the three servers. |
| 36 | +
|
| 37 | + All Algolia API clients implement this retry strategy. |
| 38 | +
|
| 39 | + ## Authentication |
| 40 | +
|
| 41 | + To authenticate your API requests, add these headers: |
| 42 | +
|
| 43 | + - `x-algolia-application-id`. Your Algolia application ID. |
| 44 | + - `x-algolia-api-key`. An API key with the necessary permissions to make the request. |
| 45 | + The required access control list (ACL) to make a request is listed in each endpoint's reference. |
| 46 | +
|
| 47 | + You can find your application ID and API key in the [Algolia dashboard](https://dashboard.algolia.com/account). |
| 48 | +
|
| 49 | + ## Request format |
| 50 | +
|
| 51 | + Depending on the endpoint, request bodies are either JSON objects or arrays of JSON objects, |
| 52 | +
|
| 53 | + ## Parameters |
| 54 | +
|
| 55 | + Parameters are passed in the request body for POST and PUT requests. |
| 56 | + Query parameters must be [URL-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding). |
| 57 | + Non-ASCII characters must be UTF-8 encoded. |
| 58 | + Plus characters (`+`) are interpreted as spaces. |
| 59 | +
|
| 60 | + ## Response status and errors |
| 61 | +
|
| 62 | + The Composition API returns JSON responses. |
| 63 | + Since JSON doesn't guarantee any specific ordering, don't rely on the order of attributes in the API response. |
| 64 | +
|
| 65 | + Successful responses return a `2xx` status. Client errors return a `4xx` status. Server errors are indicated by a `5xx` status. |
| 66 | + Error responses have a `message` property with more information. |
| 67 | +
|
| 68 | + ## Version |
| 69 | +
|
| 70 | + The current version of the Composition API is version 1, as indicated by the `/1/` in each endpoint's URL. |
| 71 | +
|
5 | 72 | version: 1.0.0
|
6 | 73 | components:
|
7 | 74 | securitySchemes:
|
|
0 commit comments