You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/guides/api-calls/api-versioning-strategy.md
+44-39Lines changed: 44 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,35 +13,58 @@ API versioning empowers Box to continually enhance its platform, while also offe
13
13
14
14
<Messagetype='tip'>
15
15
16
-
To stay informed about the forthcoming API modifications, monitor the [Changelog](https://developer.box.com/changelog/) and maintain a current email address in the Developer Console's App Info section.
16
+
To stay informed about the forthcoming API modifications, monitor the [Changelog](page://changelog) and maintain a current email address in the Developer Console's App Info section.
17
17
18
18
</Message>
19
19
20
-
## How Box API versioning works
21
-
20
+
<!-- Commenting this until we enable base version support in Public API Service
22
21
<Message type='notice'>
23
22
24
-
Box API supports versioning in URL `path` and `header`. To determine which version to use, look at the API reference and included sample requests.
23
+
In 2024, Box introduced year-based API versioning.
24
+
25
+
All endpoints available at the end of 2024 were assigned the version `2024.0`.
26
+
27
+
**No action is required for API users to continue using Box APIs.**
28
+
29
+
To make version-aware API calls, include the `box-version` header with the value `2024.0` in your requests.
25
30
26
31
</Message>
32
+
-->
33
+
34
+
## How Box API versioning works
27
35
28
-
### Versioning in `path`
36
+
<Messagetype='notice'>
29
37
30
-
The default version of the API used in any requests is specified in the URL of the endpoint you call.
31
-
For example, when calling the `https://upload.box.com/api/2.0/files/content` endpoint without any version header specified, you reach the `2.0` version defined in the URL.
38
+
Box API supports versioning in `header`. To determine which version to use, look at the API reference and included sample requests.
32
39
33
-
If there is a significant change to API behavior, the new endpoint will be exposed under the new URL.
34
-
For example, `https://upload.box.com/api/2.0/files/content` supports a multipart content type when uploading files to Box. If the new version of this API stops supporting this content type, it will be released under a new URL `https://upload.box.com/api/3.0/files/content`.
40
+
</Message>
35
41
36
42
### Versioning in `header`
37
43
38
-
Box API processes the `box-version` header which should contain a valid version name, that is `box-version: 2025.0` and be directed at `https://api.box.com/2.0/files/:file_id/metadata`.
44
+
Box API processes the `box-version` header which should contain a valid version name. For example, when a client wants
45
+
to get a list of all sign requests using version `2025.0`, the request should look like this:
If the provided version is correct and supported by the endpoint, a response is sent to the client.
54
+
If the endpoint is available in multiple versions, the response will include the `box-version` header,
55
+
which indicates the version used to handle the request.
56
+
Endpoints introduced after 2024 may return a `400` error code if the version is incorrect.
57
+
More information about versioning errors can be found [here](g://api-calls/permissions-and-errors/versioning-errors).
39
58
40
-
If the provided version is correct, a response is sent back to the client. The response also contains the `box-version` header if it was provided in the request. By default, this header is not present in the response. If the version is wrong, an error with the HTTP code `400` is returned to the client.
59
+
If your request doesn't include a version, the API defaults to the initial Box API version - `2024.0` - the version of endpoints available before
60
+
year-based versioning was introduced. However, relying on this behavior is not recommended when adopting deprecated
61
+
changes. To ensure consistency, always specify the API version, with each request. By making your application
62
+
version-aware, you anchor it to a specific set of features, ensuring consistent behavior throughout the supported
63
+
timeframe.
41
64
42
65
## Release schedule and naming convention
43
66
44
-
Box can introduce a new breaking change to certain endpoints **once per year**.
67
+
Box can introduce a new breaking change to certain endpoints **once per year**, which results in a new API version.
45
68
Introducing a new version of the Sign Request endpoint means that **all paths and HTTP methods** of an endpoint will support it.
46
69
47
70
For example, if Sign Request endpoints receive a new version it will apply to all endpoints listed in the table:
@@ -69,12 +92,6 @@ It also means, that a new version cannot be released sooner than every 12 months
69
92
70
93
We strongly recommend updating your apps to make requests to the latest stable API version. However, if your app uses a stable version that is no longer supported, then you will get a response with an HTTP error code `400 - Bad Request`. For details, see [Versioning Errors](g://api-calls/permissions-and-errors/versioning-errors).
71
94
72
-
If your request doesn't include a version, the API defaults to the initial Box API version—the version available before
73
-
year-based versioning was introduced. However, relying on this behavior is not recommended when adopting deprecated
74
-
changes. To ensure consistency, always specify the API version, with each request. By making your application
75
-
version-aware, you anchor it to a specific set of features, ensuring consistent behavior throughout the supported
76
-
timeframe.
77
-
78
95
### Endpoint versioning indication
79
96
80
97
To keep you informed about the current API state, and improve the readability of the versioned API reference, the affected endpoints are marked with a pill based on the `x-stability-level` tag or `deprecated` attribute.
@@ -83,22 +100,10 @@ To keep you informed about the current API state, and improve the readability of
83
100
84
101
| Schema element | Pill name | Description|
85
102
|---------------------|-----------|------------|
86
-
|`x-stability-level: beta`| Beta | Endpoints marked with **beta**, are offered subject to Box’s Main Beta Agreement, meaning the available capabilities may change at any time. Although beta endpoints not the same as versioned endpoints, they are a part of API lifecycle. |
87
-
|`x-stability-level: stable` or no `x-stability-level` tag | Latest version |The latest version applies to APIs that are already versioned. **Latest version** marks the most recent stable API version of an endpoint.|
103
+
|`x-stability-level: beta`| Beta | Endpoints marked with **beta**, are offered subject to Box’s Main Beta Agreement, meaning the available capabilities may change at any time. When the beta endpoint becomes stable, the **beta** indication is removed. |
104
+
|`x-stability-level: stable` or no `x-stability-level` tag | Latest version |**Latest version** marks the most recent stable API version of an endpoint.|
88
105
|`deprecated: true`| Deprecated | An endpoint is deprecated, which means it is still available for use, but no new features are added. Such an endpoint is annotated with the `deprecated` attribute set to `true`.|
89
106
90
-
## Calling an API version
91
-
92
-
Box API versions are explicitly declared in the `box-version` header that your app makes requests to. For example:
The client gets a list of all created sign requests and asks for version `2025.0`. There are several supported versions of the APIs available, and you specify the version that you want to use with the `box-version` header. There are three types of API versions: **stable**, **deprecated**, and **unstable**.
101
-
102
107
## Versioning errors
103
108
104
109
When using versioned API actions such as calling an incorrect API version in header or a deprecated version can lead to errors.
@@ -107,7 +112,7 @@ For details on possible errors, see [versioning errors](g://api-calls/permission
107
112
108
113
## How Box SDK versioning works
109
114
110
-
The versioning strategy applies only to [next generation generated SDKs](https://developer.box.com/sdks-and-tools/#next-generation-sdks).
115
+
The versioning strategy applies only to [next generation generated SDKs](page://sdks-and-tools/#next-generation-sdks).
111
116
112
117
Box SDKs support the **All Versions In** SDK approach.
113
118
This means that every release of SDK provides access to all endpoints in any version which is currently live. All generated SDKs use manager's approach - they group all endpoints with the same domain in one manager.
@@ -208,14 +213,14 @@ When new versions of the Box APIs and Box SDKs are released, earlier versions wi
208
213
sooner than after 24 months.
209
214
Similarly, for individual APIs that are generally available (GA), Box declares an API as `deprecated` at least 24 months in advance of removing it from the GA version.
210
215
211
-
When we increment the major version of the API (for example, from `2024.0` to `2025.0`), we're announcing that the current version (in this example, `2024.0`) is immediately deprecated and we'll no longer support it 24 months after the announcement. We might make exceptions to this policy for service security or health reliability issues.
216
+
When we increment the major version of the API (for example, from `2025.0` to `2026.0`), we're announcing that the current version (in this example, `2025.0`) is immediately deprecated and we'll no longer support it 24 months after the announcement. We might make exceptions to this policy for service security or health reliability issues.
212
217
213
218
When an API is marked as deprecated, we strongly recommend that you migrate to the latest version as soon as possible. In some cases, we'll announce that new applications will have to start using the new APIs a short time after the original APIs are deprecated.
214
219
215
220
When customer calls deprecated API endpoint, the response will contain a header:
@@ -225,8 +230,8 @@ The date tells clients when this version was marked as deprecated.
225
230
226
231
When building your request, consider the following:
227
232
228
-
* If you do not specify a version, the service will return the initial version that existed before year-based versioning was introduced. If the initial version does not exist, the response will return an HTTP error code `400 - Bad Request`.
229
-
* If the versionheader is specified but the requested version is unavailable, the response will return an HTTP error code `400 - Bad Request`.
233
+
* Endpoints in version `2024.0` can be called without specifying the version in the `box-version` header. If no version is specified and the `2024.0` version of the called endpoint does not exist, the response will return an HTTP error code `400 - Bad Request`.
234
+
* If the `box-version` version header is specified but the requested version does not exist, the response will return an HTTP error code `400 - Bad Request`.
230
235
231
236
For details, see [versioning errors](g://api-calls/permissions-and-errors/versioning-errors).
232
237
@@ -235,7 +240,7 @@ When Box deprecates a resource or a property of a resource in the API, the chang
235
240
* Calls that include the deprecated behavior return the response header `Box-API-Deprecated-Reason` and a link to get more information:
for solution to common errors encountered when working with the Box APIs.
45
45
46
46
### 400 Bad Request
47
47
48
48
<!-- i18n-enable localize-links -->
49
+
<!-- markdownlint-disable no-space-in-code -->
49
50
50
51
|||
51
52
| --- | -- |
@@ -107,7 +108,7 @@ for solution to common errors encountered when working with the Box APIs.
107
108
|||
108
109
|**Error**|`item_name_invalid`|
109
110
|**Message**| Item name invalid |
110
-
|**Solution**| Verify that the file's name is valid. Box only supports file or folder names that are 255 characters or less. File names containing non-printable characters, names containing the characters `/`, `\`, `<`, `>`, `:`, `|`, `?`, `*`, `—` , names with leading or trailing spaces, and the special names “.” and “..” are also unsupported. |
111
+
|**Solution**| Verify that the file's name is valid. Box only supports file or folder names that are 255 characters or less. File names containing non-printable characters, names containing the characters `/`, `\`, `<`, `>`, `:`, `|`, `?`, `*`, `-`, names with leading or trailing spaces, and the special names “.” and “..” are also unsupported. |
111
112
|||
112
113
|**Error**|`item_name_too_long`|
113
114
|**Message**| Item name too long |
@@ -145,6 +146,7 @@ for solution to common errors encountered when working with the Box APIs.
145
146
|**Solution**| The user that you are attempting to collaborate in on an item is already collaborated on that item. This request is not needed.|
146
147
|||
147
148
149
+
<!-- markdownlint-enable no-space-in-code -->
148
150
<!-- i18n-disable localize-links -->
149
151
150
152
### 401 Unauthorized
@@ -174,7 +176,7 @@ for solution to common errors encountered when working with the Box APIs.
174
176
|||
175
177
|**Error**|`access_from_location_blocked`|
176
178
|**Message**||
177
-
|**Solution**| You’re attempting to log in to Box from a location that has not been approved by your admin. Please talk to your admin to resolve this issue. |
179
+
|**Solution**| You’re attempting to log in to Box from a location that has not been approved by your admin. Talk to your admin to resolve this issue. |
@@ -232,17 +234,17 @@ for solution to common errors encountered when working with the Box APIs.
232
234
233
235
### 405 Method Not Allowed
234
236
235
-
|||
237
+
|||
236
238
| ------- | ------ |
237
-
|**Error**|`method_not_allowed`|
239
+
|**Error**|`method_not_allowed`|
238
240
|**Message**| Method Not Allowed |
239
241
|**Solution**| The HTTP method used for the API operation is not allowed. Check the API reference documentation for the HTTP verb needed for the API operation. |
240
242
241
243
### 409 Conflict
242
244
243
245
|||
244
246
| ------- | --------------- |
245
-
|**Error**|`conflict`|
247
+
|**Error**|`conflict`|
246
248
|**Message**| A resource with this value already exists |
247
249
|**Solution**| This error may be produced when the resource to be created already exists. Check the extended error message in the response body for more details. |
248
250
|||
@@ -292,11 +294,11 @@ for solution to common errors encountered when working with the Box APIs.
292
294
|||
293
295
| ------- | ------- |
294
296
|**Error**|`precondition_failed`|
295
-
|**Message**| The resource has been modified. Please retrieve the resource again and retry |
297
+
|**Message**| The resource has been modified. Retrieve the resource again and retry |
296
298
|**Solution**| Check the extended error message in the response body for more details. |
297
299
|||
298
300
|**Error**|`sync_state_precondition_failed`|
299
-
|**Message**| The resource has been modified. Please retrieve the resource again and retry |
301
+
|**Message**| The resource has been modified. Retrieve the resource again and retry |
300
302
|**Solution**| Check the extended error message in the response body for more details. |
301
303
302
304
### 413 Request Entity Too Large
@@ -320,7 +322,7 @@ for solution to common errors encountered when working with the Box APIs.
320
322
|||
321
323
| ---- | ---- |
322
324
|**Error**|`rate_limit_exceeded`|
323
-
|**Message**| Request rate limit exceeded, please try again later |
325
+
|**Message**| Request rate limit exceeded, try again later.|
324
326
|**Solution**| The client is performing operations too quickly and has been rate limited. Client is advised to retry their request after the amount of time specified by the `retry-after` header. There are [four rate limits](g://api-calls/permissions-and-errors/rate-limits) to be aware of. |
325
327
326
328
### 500 Internal Service Error
@@ -355,7 +357,7 @@ for solution to common errors encountered when working with the Box APIs.
355
357
| ------- | ------- |
356
358
|**Error**|`unavailable`|
357
359
|**Message**| Unavailable |
358
-
|**Solution**| If a Retry-After header is provided in the response, the client should retry the request according to the header value. In rare situations, a write operation may eventually persist its changes after the 503 response is received by the client, so the client should handle this case upon retry. If the issue persists, please check our [Status Site](https://status.box.com/) for any known outage information. |
360
+
|**Solution**| If a Retry-After header is provided in the response, the client should retry the request according to the header value. In rare situations, a write operation may eventually persist its changes after the 503 response is received by the client, so the client should handle this case upon retry. If the issue persists, check our [Status Site](https://status.box.com/) for any known outage information. |
0 commit comments