Skip to content

Commit 34e345d

Browse files
kai687shortcuts
andauthored
fix(specs): update documentation for consistency (#2976)
Co-authored-by: Kai Welke <kai.welke@algolia.com> Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
1 parent bd75f37 commit 34e345d

File tree

31 files changed

+244
-365
lines changed

31 files changed

+244
-365
lines changed

specs/analytics/common/parameters.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ x-ratelimit-remaining:
316316
type: integer
317317

318318
x-ratelimit-reset:
319-
description: Timestamp in Unix epoch time when the rate limit will reset.
319+
description: Timstamp when the rate limit will reset, measured in seconds since the Unix epoch.
320320
example: 1710682486
321321
schema:
322322
type: integer

specs/analytics/spec.yml

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@ info:
88
description: |
99
The Analytics API gives you access to metrics related to your Algolia search experience.
1010
11-
# Availability
11+
## Base URLs
1212
13-
Access to this API is available as part of the [Premium or Elevate plans](https://www.algolia.com/pricing).
14-
15-
# Base URLs
16-
17-
The base URLs for making requests to the Analytics API are:
13+
The base URLs for requests to the Analytics API are:
1814
1915
- `https://analytics.us.algolia.com` (alias: `https://analytics.algolia.com`)
2016
- `https://analytics.de.algolia.com`
@@ -23,42 +19,38 @@ info:
2319
2420
**All requests must use HTTPS.**
2521
26-
# Authentication
22+
## Availability and authentication
23+
24+
Access to the Analytics API is available as part of the [Premium or Elevate plans](https://www.algolia.com/pricing).
2725
2826
To authenticate your API requests, add these headers:
2927
30-
<dl>
31-
<dt><code>x-algolia-application-id</code></dt>
32-
<dd>Your Algolia application ID.</dd>
33-
<dt><code>x-algolia-api-key</code></dt>
34-
<dd>
35-
An API key with the necessary permissions to make the request.
36-
The required access control list (ACL) to make a request is listed in each endpoint's reference.
37-
</dd>
38-
</dl>
28+
- `x-algolia-application-id`. Your Algolia application ID.
29+
- `x-algolia-api-key`. An API key with the necessary permissions to make the request.
30+
The required access control list (ACL) to make a request is listed in each endpoint's reference.
3931
4032
You can find your application ID and API key in the [Algolia dashboard](https://dashboard.algolia.com/account).
4133
42-
# Rate limits
34+
## Rate limits
4335
4436
You can make up to **100 requests per minute per app** to the Analytics API.
4537
The response includes headers with information about the limits.
4638
47-
# Parameters
39+
## Parameters
4840
4941
Query parameters must be [URL-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding).
5042
Non-ASCII characters must be UTF-8 encoded.
5143
Plus characters (`+`) are interpreted as spaces.
5244
53-
# Response status and errors
45+
## Response status and errors
5446
5547
The Analytics API returns JSON responses.
5648
Since JSON doesn't guarantee any specific ordering, don't rely on the order of attributes in the API response.
5749
5850
Successful responses return a `2xx` status. Client errors return a `4xx` status. Server errors are indicated by a `5xx` status.
5951
Error responses have a `message` property with more information.
6052
61-
# Version
53+
## Version
6254
6355
The current version of the Analytics API is version 2, as indicated by the `/2/` in each endpoint's URL.
6456

specs/common/parameters.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,33 @@ Index:
3030
StartDate:
3131
in: query
3232
name: startDate
33-
description: Start date (`YYYY-MM-DD`) of the period to analyze.
33+
description: Start date of the period to analyze, in `YYYY-MM-DD` format.
34+
schema:
35+
type: string
36+
example: 2022-09-19
37+
38+
StartDateRequired:
39+
in: query
40+
name: startDate
41+
description: Start date of the period to analyze, in `YYYY-MM-DD` format.
42+
required: true
3443
schema:
3544
type: string
3645
example: 2022-09-19
3746

3847
EndDate:
3948
in: query
4049
name: endDate
41-
description: End date (`YYYY-MM-DD`) of the period to analyze.
50+
description: End date of the period to analyze, in `YYYY-MM-DD` format.
51+
schema:
52+
type: string
53+
example: 2023-01-21
54+
55+
EndDateRequired:
56+
in: query
57+
name: endDate
58+
description: End date of the period to analyze, in `YYYY-MM-DD` format.
59+
required: true
4260
schema:
4361
type: string
4462
example: 2023-01-21

specs/common/responses/common.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,30 @@ objectIDs:
1919
createdAt:
2020
type: string
2121
example: 2023-07-04T12:49:15Z
22-
description: Timestamp of creation in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format.
22+
description: Date and time when the object was created, in RFC 3339 format.
2323

2424
createdAtTimestamp:
2525
type: integer
2626
format: int64
2727
example: 1656345570000
28-
description: Timestamp of creation in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time).
28+
description: Timestamp when the object was created, in milliseconds since the Unix epoch.
2929

3030
updatedAt:
3131
type: string
3232
example: 2023-07-04T12:49:15Z
33-
description: Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format.
33+
description: Date and time when the object was updated, in RFC 3339 format.
3434

3535
updatedAtNullable:
36-
type: string
37-
example: 2023-07-04T12:49:15Z
38-
nullable: true
39-
description: |
40-
Timestamp of the last update in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format.
41-
If null, no update was performed yet.
36+
default: null
37+
oneOf:
38+
- type: string
39+
example: 2023-07-04T12:49:15Z
40+
description: |
41+
Date and time when the object was updated, in RFC 3339 format.
42+
- type: 'null'
43+
description: If null, this object wasn't updated yet.
4244

4345
deletedAt:
4446
type: string
4547
example: 2023-06-27T14:42:38.831Z
46-
description: Timestamp of deletion in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format.
48+
description: Date and time when the object was deleted, in RFC 3339 format.

0 commit comments

Comments
 (0)