|
1 | 1 | openapi: 3.0.2
|
2 | 2 | info:
|
3 |
| - title: Composition API |
4 |
| - description: Composition API. |
| 3 | + title: Composition API (beta) |
| 4 | + description: | |
| 5 | + The Algolia Composition API lets you run 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 | + The official API clients are covered by Algolia's [Service Level Agreement](https://www.algolia.com/policies/sla/). |
| 11 | +
|
| 12 | + See: [Algolia's ecosystem](https://www.algolia.com/doc/guides/getting-started/how-algolia-works/in-depth/ecosystem/) |
| 13 | +
|
| 14 | + ## Base URLs |
| 15 | +
|
| 16 | + The base URLs for requests to the Composition API are: |
| 17 | +
|
| 18 | + - `https://{APPLICATION_ID}.algolia.net` |
| 19 | + - `https://{APPLICATION_ID}-dsn.algolia.net`. |
| 20 | + If your subscription includes a [Distributed Search Network](https://dashboard.algolia.com/infra), |
| 21 | + this ensures that requests are sent to servers closest to users. |
| 22 | +
|
| 23 | + Both URLs provide high availability by distributing requests with load balancing. |
| 24 | +
|
| 25 | + **All requests must use HTTPS.** |
| 26 | +
|
| 27 | + ## Retry strategy |
| 28 | +
|
| 29 | + To guarantee high availability, implement a retry strategy for all API requests using the URLs of your servers as fallbacks: |
| 30 | +
|
| 31 | + - `https://{APPLICATION_ID}-1.algolianet.com` |
| 32 | + - `https://{APPLICATION_ID}-2.algolianet.com` |
| 33 | + - `https://{APPLICATION_ID}-3.algolianet.com` |
| 34 | +
|
| 35 | + These URLs use a different DNS provider than the primary URLs. |
| 36 | + You should randomize this list to ensure an even load across the three servers. |
| 37 | +
|
| 38 | + All Algolia API clients implement this retry strategy. |
| 39 | +
|
| 40 | + ## Authentication |
| 41 | +
|
| 42 | + To authenticate your API requests, add these headers: |
| 43 | +
|
| 44 | + - `x-algolia-application-id`. Your Algolia application ID. |
| 45 | + - `x-algolia-api-key`. An API key with the necessary permissions to make the request. |
| 46 | + The required access control list (ACL) to make a request is listed in each endpoint's reference. |
| 47 | +
|
| 48 | + You can find your application ID and API key in the [Algolia dashboard](https://dashboard.algolia.com/account). |
| 49 | +
|
| 50 | + ## Request format |
| 51 | +
|
| 52 | + Depending on the endpoint, request bodies are either JSON objects or arrays of JSON objects, |
| 53 | +
|
| 54 | + ## Parameters |
| 55 | +
|
| 56 | + Parameters are passed as query parameters for GET and DELETE requests, |
| 57 | + and in the request body for POST and PUT requests. |
| 58 | +
|
| 59 | + Query parameters must be [URL-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding). |
| 60 | + Non-ASCII characters must be UTF-8 encoded. |
| 61 | + Plus characters (`+`) are interpreted as spaces. |
| 62 | + Arrays as query parameters must be one of: |
| 63 | +
|
| 64 | + - A comma-separated string: `attributesToRetrieve=title,description` |
| 65 | + - A URL-encoded JSON array: `attributesToRetrieve=%5B%22title%22,%22description%22%D` |
| 66 | +
|
| 67 | + ## Response status and errors |
| 68 | +
|
| 69 | + The Composition API returns JSON responses. |
| 70 | + Since JSON doesn't guarantee any specific ordering, don't rely on the order of attributes in the API response. |
| 71 | +
|
| 72 | + Successful responses return a `2xx` status. Client errors return a `4xx` status. Server errors are indicated by a `5xx` status. |
| 73 | + Error responses have a `message` property with more information. |
| 74 | +
|
| 75 | + ## Version |
| 76 | +
|
| 77 | + The current version of the Composition API is version 1, as indicated by the `/1/` in each endpoint's URL. |
| 78 | +
|
5 | 79 | version: 1.0.0
|
6 | 80 | components:
|
7 | 81 | securitySchemes:
|
@@ -34,18 +108,21 @@ security:
|
34 | 108 | - appId: []
|
35 | 109 | apiKey: []
|
36 | 110 | tags:
|
37 |
| - - name: Compositions |
| 111 | + - name: compositions |
| 112 | + x-displayName: Compositions |
38 | 113 | description: |
|
39 | 114 | Manage your compositions and composition settings.
|
40 |
| - - name: Rules |
| 115 | + - name: rules |
| 116 | + x-displayName: Rules |
41 | 117 | description: |
|
42 | 118 | Manage your compositions rules.
|
43 |
| - - name: Search |
44 |
| - description: Search one or more indices for matching records or facet values. |
| 119 | + - name: search |
| 120 | + x-displayName: Search |
| 121 | + description: Search one composition for matching records or facet values. |
45 | 122 | x-tagGroups:
|
46 |
| - - name: Search |
| 123 | + - name: Compositions |
47 | 124 | tags:
|
48 |
| - - Compositions |
| 125 | + - search |
49 | 126 | paths:
|
50 | 127 | # ########################
|
51 | 128 | # ### Search Endpoints ###
|
|
0 commit comments