Skip to content

Commit 48cdda0

Browse files
committed
Updated API from documentation release
1 parent c47b5ed commit 48cdda0

File tree

8 files changed

+91
-6
lines changed

8 files changed

+91
-6
lines changed

api-specs/history/api.raml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,30 @@ types: !include types/types.raml
9393
resourceTypes:
9494
base:
9595
get:
96-
description: The `view_audit_log:{projectKey}` scope is required, and depending on the [resource type](ctp:history:type:ChangeHistoryResourceType) queried, their respective scopes must be granted.
96+
description: |
97+
The `view_audit_log:{projectKey}` scope is required, and depending on the [resource type](ctp:history:type:ChangeHistoryResourceType) queried, their respective scopes must be granted.
98+
99+
If the request exceeds the rate limit, a [TooManyRequests](ctp:history:type:TooManyRequestsError) error is returned.
97100
responses:
98101
200:
99102
body:
100103
application/json:
101104
type: RecordPagedQueryResponse
102105
example: !include examples/RecordPagedQueryResponse.json
103106
description: Records of the resource under query.
107+
headers:
108+
X-RateLimit-Limit:
109+
description: |
110+
Indicates the total number of tokens available when fully replenished.
111+
type: string
112+
X-RateLimit-Remaining:
113+
description: |
114+
Indicates the number of tokens available after the current query is completed.
115+
type: string
116+
X-RateLimit-Request-Cost:
117+
description: |
118+
Indicates the number of tokens used by the current query.
119+
type: string
104120
400:
105121
body:
106122
application/json:
@@ -128,13 +144,24 @@ resourceTypes:
128144
description:
129145
Forbidden. Indicates that the authenticated client is not allowed to
130146
perform the request.
147+
429:
148+
body:
149+
application/json:
150+
type: ErrorResponse
151+
example: !include examples/TooManyRequests.json
152+
description: Too Many Requests. Indicates that the client has exceeded the API rate limit. Reduce the date range and resource types in your query to minimize the token usage, or retry the request after some time (indicated in the `Retry-After` header).
153+
headers:
154+
Retry-After:
155+
description: |
156+
The wait time, in seconds, before you can retry the request.
157+
type: string
131158
500:
132159
body:
133160
application/json:
134161
type: ErrorResponse
135162
example: !include examples/InternalServerError.json
136163
description:
137-
Internal Server Error. A 500 indicates that a request failed due to
164+
Internal Server Error. A 500 indicates that the request failed due to
138165
a server-side problem that needs to be resolved before subsequent
139166
requests can succeed. It either indicates a temporary unavailability
140167
or permanent server-side problem that needs to be reported and
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"statusCode": 429,
3+
"message": "You have made too many requests. Please try again later.",
4+
"errors": [
5+
{
6+
"code": "TooManyRequests",
7+
"message": "You have made too many requests. Please try again later."
8+
}
9+
]
10+
}

api-specs/history/types/GraphQLError.raml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ properties:
1616
items: any
1717
description: Query fields listed in order from the root of the query response up to the field in which the error occurred. `path` is displayed in the response only if an error is associated with a particular field in the query result.
1818
extensions:
19-
type: object
20-
# type: GraphQLErrorObject
19+
type: GraphQLErrorObject
2120
description: Dictionary with additional information where applicable.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#%RAML 1.0 DataType
2+
(package): Error
3+
type: object
4+
displayName: GraphQLErrorObject
5+
discriminator: code
6+
description: Represents a single error.
7+
properties:
8+
code:
9+
type: string
10+
description: |
11+
One of the error codes that is listed on the [Errors](/errors) page.
12+
//:
13+
type: any
14+
description: |
15+
Error-specific additional fields.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#%RAML 1.0 DataType
2+
(package): Error
3+
type: GraphQLErrorObject
4+
displayName: GraphQLTooManyRequestsError
5+
discriminatorValue: TooManyRequests
6+
description: |
7+
Returned when the [Query Records](/../api/history/change-history#query-records) request exceeds the rate limit.
8+
9+
10+
11+
Reduce the date range and resource types in your query to minimize the token usage, or retry the request after some time (indicated in the `Retry-After` header).
12+
properties:
13+
code:
14+
type: string

api-specs/history/types/Record.raml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ example: !include ../examples/Record.json
66
description: |
77
Captures the differences between the previous and next version of a resource.
88
9-
The maximum number of Records that can be stored and their retention period are subject to a [limit](/../api/limits#records).
9+
The maximum number of Records that can be stored and their retention period are subject to a [limit](/../api/limits#change-history).
1010
properties:
1111
version:
1212
type: integer
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#%RAML 1.0 DataType
2+
(package): Error
3+
type: ErrorObject
4+
displayName: TooManyRequestsError
5+
discriminatorValue: TooManyRequests
6+
description: |
7+
Returned when the [Query Records](/../api/history/change-history#query-records) request exceeds the rate limit.
8+
9+
Reduce the date range and resource types in your query to minimize the token usage, or retry the request after some time (indicated in the `Retry-After` header).
10+
properties:
11+
code:
12+
type: string
13+
description: |
14+
`"TooManyRequests"`
15+
message:
16+
type: string
17+
description: |
18+
`"You have made too many requests. Please try again later."`

api-specs/history/types/types.raml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ ChangeHistoryResourceType: !include ChangeHistoryResourceType.raml
44
DateStringFilter: !include DateStringFilter.raml
55
ErrorObject: !include ErrorObject.raml
66
ErrorResponse: !include ErrorResponse.raml
7+
TooManyRequestsError: !include TooManyRequestsError.raml
78
ModifiedBy: !include ModifiedBy.raml
89
PlatformInitiatedChange: !include PlatformInitiatedChange.raml
910
Source: !include Source.raml
@@ -17,8 +18,9 @@ GraphQLRequest: !include ../../api/types/graphql/GraphQLRequest.raml
1718
GraphQLResponse: !include ../../api/types/graphql/GraphQLResponse.raml
1819
GraphQLError: !include GraphQLError.raml
1920
GraphQLErrorLocation: !include ../../api/types/graphql/GraphQLErrorLocation.raml
21+
GraphQLTooManyRequestsError: !include GraphQLTooManyRequestsError.raml
2022
GraphQLVariablesMap: !include ../../api/types/graphql/GraphQLVariablesMap.raml
21-
# GraphQLErrorObject: !include ../../api/types/error/graphql/GraphQLErrorObject.raml
23+
GraphQLErrorObject: !include ../../api/types/error/graphql/GraphQLErrorObject.raml
2224
# Generated types
2325
AddAddressChange: !include change/AddAddressChange.raml
2426
AddAssetChange: !include change/AddAssetChange.raml

0 commit comments

Comments
 (0)