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:
Copy file name to clipboardExpand all lines: content/guides/api-calls/permissions-and-errors/versioning-errors.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,15 +11,15 @@ Box provides versioning capabilities for selected API endpoints. The version con
11
11
12
12
API versioning empowers Box to continually enhance its platform, while also offering third-party developers a reliable avenue for feature updates and deprecations.
13
13
14
-
To stay informed about the API modifications, monitor the [Changelog](https://developer.box.com/changelog/) and maintain a current email address in the **App Info** section of the Developer Console.
14
+
To stay informed about the API modifications, monitor the [Changelog](page://changelog) and maintain a current email address in the **App Info** section of the Developer Console.
15
15
16
16
## Error examples
17
17
18
18
When using versioned API calls, you can encounter versioning-related errors. This reference lists the most common cases when errors appear and provides you with examples of such errors.
19
19
20
20
## Calling with incorrect `box-version` header
21
21
22
-
If you call an API using an incorrect `box-version` header, the API will respond with an `HTTP error code 400 - Bad Request` error and provide the supported versions in the response message.
22
+
If you call an API using an incorrect `box-version` header, the API will respond with an `HTTP error code 400 - Bad Request` error and provide the supported versions in the response message.
23
23
24
24
The response will include one of the following status messages in `message` field:
25
25
@@ -53,12 +53,12 @@ Box documentation specifies API URLs. For instance, the Sign Requests endpoints
53
53
When you use an API version that Box has marked as deprecated, the API will respond as usual. Additionally, it will append a `Deprecation` header, stating the deprecation date. For example:
You should monitor API responses to verify if the `Deprecation` header is present to accordingly plan the transition to a new API version.
61
61
62
62
## Calling a non-existent version
63
63
64
-
If you attempt to use an outdated API version, such as `2023.0` which has reached its end-of-life, the response will return an `HTTP error code 404 - Not Found`. See [Calling an incorrect API version in the URL](#calling-an-incorrect-api-version-in-the-url) for more information.
64
+
If you attempt to use an outdated API version, such as `2025.0` which has reached its end-of-life, the response will return an `HTTP error code 404 - Not Found`. See [Calling an incorrect API version in the URL](#calling-an-incorrect-api-version-in-the-url) for more information.
0 commit comments