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
+46-64Lines changed: 46 additions & 64 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ related_guides: []
5
5
required_guides: []
6
6
---
7
7
8
-
# API Versioning Strategy
8
+
# API versioning strategy
9
9
10
10
Box provides versioning capabilities for selected API endpoints. The version control system guarantees seamless functioning of existing endpoint versions, even if Box introduces new ones.
11
11
@@ -25,24 +25,26 @@ Box API supports versioning in URL `path` and `header`. To determine which versi
25
25
26
26
</Message>
27
27
28
+
### Versioning in `path`
29
+
28
30
The default version of the API used in any requests is specified in the URL of the endpoint you call.
29
-
An example flow looks like this:
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.
30
32
31
-
1. When calling the [upload](`https://upload.box.com/api/2.0/files/content`) endpoint without any version header specified, you hit the `2.0` version defined in the URL.
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`.
32
35
33
-
2. Box API processes the `box-version`header which should:
36
+
### Versioning in `header`
34
37
35
-
- contain a valid version name, that is `box-version: 2025.0`
36
-
- be directed at `https://api.box.com/2.0/files/:file_id/metadata`.
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`.
37
39
38
-
3. 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.
39
-
40
-
If there is a significant change to API behavior, the new endpoint will be exposed under the new URL.
41
-
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
+
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.
42
41
43
42
## Release schedule and naming convention
44
43
45
-
Box can introduce a new breaking change to certain endpoints **once per year**. An endpoint encompasses all supported HTTP methods within a specific API root. For example, the Sign Request endpoints include:
44
+
Box can introduce a new breaking change to certain endpoints **once per year**.
45
+
Introducing a new version of the Sign Request endpoint means that **all paths and HTTP methods** of an endpoint will support it.
46
+
47
+
For example, if Sign Request endpoints receive a new version it will apply to all endpoints listed in the table:
@@ -52,15 +54,15 @@ Box can introduce a new breaking change to certain endpoints **once per year**.
52
54
| POST |`https://api.box.com/2.0/sign_requests/:id/resend`| Sends a specific sign request again. |
53
55
| POST |`https://api.box.com/2.0/sign_requests/:id/cancel`| Cancels a specific sign request. |
54
56
55
-
Introducing a new version of the sign request endpoint means that all paths and HTTP methods listed above will support it. You can find comprehensive information about the endpoint version in the [Box API Reference](https://developer.box.com/reference/).
56
-
57
57
### Naming convention
58
58
59
59
New API versions are labeled according to the calendar year of their release.
60
-
For example, if a new version of the Sign Requests endpoint is released in 2025, it will be named `2025.0`.
61
60
62
-
Box can issue a new breaking change to API endpoints once per year, reserving the right to release an additional breaking change to address security or privacy concerns. In such cases, the new version will be incremented by one in the suffix.
63
-
For example, if security issues need addressing in the previously released version `2025.0` of Sign Requests, the new version will be labeled `2025.1`.
61
+
**Example**: If a new version of the Sign Requests endpoint is released in 2025, it will be named `2025.0`.
62
+
63
+
Box can issue a new breaking change to API endpoints **once** per year, reserving the right to release an additional breaking change to address security or privacy concerns. In such cases, the new version will be incremented by one in the suffix.
64
+
65
+
**Example**: If security issues need addressing in the previously released version `2025.0` of Sign Requests, the new version will be labeled `2025.1`.
64
66
65
67
Each stable version is supported for a minimum of 12 months. This means that when a new version is released, the previous version becomes deprecated and will be available for use, but no new features will be added.
66
68
It also means, that a new version cannot be released sooner than every 12 months.
@@ -69,10 +71,20 @@ We strongly recommend updating your apps to make requests to the latest stable A
69
71
70
72
If your request doesn't include a version, the API defaults to the initial Box API version—the version available before
71
73
year-based versioning was introduced. However, relying on this behavior is not recommended when adopting deprecated
72
-
changes. To ensure consistency, always specify the API version with each request. By making your application
74
+
changes. To ensure consistency, always specify the API version, with each request. By making your application
73
75
version-aware, you anchor it to a specific set of features, ensuring consistent behavior throughout the supported
74
76
timeframe.
75
77
78
+
### Endpoint marking
79
+
80
+
To keep you informed about the current API state, and improve the readability of the versioned API reference, the affected endpoints are marked with the following terms:
81
+
82
+
***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.
83
+
84
+
***Latest version**: The latest version applies to APIs that are already versioned. **Latest version** marks the most recent API version of an endpoint.
85
+
86
+
***Deprecated**: If a version is deprecated, it is still available for use, but no new features are added. Such a version is marked with **Deprecated**.
87
+
76
88
## Calling an API version
77
89
78
90
Box API versions are explicitly declared in the `box-version` header that your app makes requests to. For example:
@@ -87,48 +99,18 @@ The client gets a list of all created sign requests and asks for version `2025.0
87
99
88
100
## Versioning errors
89
101
90
-
### Calling an incorrect API version in the header
91
-
92
-
If the API version provided in the `box-version` header is incorrect, the response will return an `HTTP 400 - Bad Request error`.
93
-
The error response will have the following structure:
94
-
95
-
```json
96
-
{
97
-
"type": "error",
98
-
"status": 400,
99
-
"code": "invalid_api_version",
100
-
"message": "Some error message",
101
-
"context_info": {
102
-
"conflicts": [
103
-
"box_version value must be in the format of YYYY.MM"
The error message will contain information about the error and possible correct values for the `box-version` header. For example:
111
-
112
-
-`The 'box-version' header supports only one header value per request, do not use comas.` - when the header contains multiple values separated by commas.
113
-
-`Missing required box-version header.` - when the header is missing but required.
114
-
-`Unsupported API version specified in 'box-version' header. Supported API versions: [LIST_OF_SUPPORTED_VERSIONS_COMA_SEPARATED]` - when the version specified is not supported by the API.
102
+
When using versioned API actions such as calling an incorrect API version in header or a deprecated version can lead to errors.
115
103
116
-
### Calling a deprecated API
117
-
118
-
When a customer uses an API version that Box has marked as deprecated, the API will respond as usual. However, it will append a `Deprecation` header, stating the deprecation date, for example:
Customers should monitor API responses and take note when this header appears, signaling the need to plan for the transition to a new API version.
104
+
For details on possible errors, see [versioning errors](g://api-calls/permissions-and-errors/versioning-errors).
126
105
127
106
## How Box SDK versioning works
128
107
129
-
The versioning strategy is only applied to [next generation generated SDKs](https://developer.box.com/sdks-and-tools/#next-generation-sdks).
108
+
The versioning strategy applies only to [next generation generated SDKs](https://developer.box.com/sdks-and-tools/#next-generation-sdks).
109
+
130
110
Box SDKs support the **All Versions In** SDK approach.
131
-
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. For example `FolderManager` contains methods to: `create_folder`, `get_folder_by_id`, `update_folder_by_id`, `delete_folder_by_id`, `get_folder_items` and `copy_folder`.This division is done based on the value of `x-box-tag` field, which is assigned to each method in Public API Service specification. It mostly corresponds to the root of the endpoint URL, but not necessarily. For example: `FolderManager` contains methods with `https://api.box.com/2.0/folders` root URL, but the same base URL is also used in some methods of `SharedLinkFoldersManager`.
111
+
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.
112
+
113
+
For example `FolderManager` contains methods to: `create_folder`, `get_folder_by_id`, `update_folder_by_id`, `delete_folder_by_id`, `get_folder_items` and `copy_folder`. This division is done based on the value of `x-box-tag` field, which is assigned to each method in Public API Service specification. It mostly corresponds to the root of the endpoint URL, but not necessarily. For example: `FolderManager` contains methods with `https://api.box.com/2.0/folders` root URL, but the same base URL is also used in some methods of `SharedLinkFoldersManager`.
132
114
References to all managers are stored under one Box Client object.
133
115
134
116
See an example of the endpoint's lifecycle:
@@ -188,7 +170,7 @@ See an example of the endpoint's lifecycle:
188
170
189
171
## Breaking vs non-breaking changes
190
172
191
-
Breaking changes in the Box API occur within versioned releases, typically accompanied by a newmajorAPIversion. Minor adjustments, which do not disrupt existing functionality, can be integrated into an existing APIversion. The following table offers illustrations of both breaking and non-breaking changes.
173
+
Breaking changes in the Box API occur within versioned releases, typically accompanied by a newmajorAPIversion. Minor adjustments, which do not disrupt existing functionality, can be integrated into an existing APIversion. The following table lists both breaking and non-breaking changes.
@@ -211,7 +193,7 @@ Breaking changes in the Box API occur within versioned releases, typically accom
211
193
212
194
<Message type='tip'>
213
195
214
-
We use [oasdiff](https://github.com/Tufin/oasdiff/blob/main/BREAKING-CHANGES-EXAMPLES.md) tool to detect most of the possible breaking changes.
196
+
The [oasdiff](https://github.com/Tufin/oasdiff/blob/main/BREAKING-CHANGES-EXAMPLES.md) tool allows detecting most of the possible breaking changes.
215
197
</Message>
216
198
217
199
## AI agent configuration versioning
@@ -241,25 +223,25 @@ The date tells clients when this version was marked as deprecated.
241
223
242
224
When building your request, consider the following:
243
225
244
-
- If you do not specify a version, the service will return the initial version—the 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.
245
-
- If the version header is specified but the requested version is unavailable, the response will return an HTTP error code 400 - Bad Request.
226
+
* If you do not specify a version, the service will return the initial versionthat 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`.
227
+
* If the version header is specified but the requested version is unavailable, the response will return an HTTP error code `400 - Bad Request`.
246
228
247
-
You can check [Versioning Errors](#versioning-errors) for more information.
229
+
For details, see [versioning errors](g://api-calls/permissions-and-errors/versioning-errors).
248
230
249
231
When Box deprecates a resource or a property of a resource in the API, the change is communicated in one or more of the following ways:
250
232
251
-
- Calls that include the deprecated behavior return the response header `Box-API-Deprecated-Reason` and a link to get more information:
233
+
* Calls that include the deprecated behavior return the response header `Box-API-Deprecated-Reason` and a link to get more information:
- A notice about the deprecation is posted in the developer changelog.
260
-
- The API reference is updated to identify the affected resource and any action you need to take.
261
-
- If there is an imminent backwards-incompatible change that affects your app, then the contact email for your app might be contacted about the deprecation.
241
+
* A deprecation announcement is posted in the developer changelog.
242
+
* The API reference is updated to identify the affected resource and any action you need to take. Affected endpoints are marked with **deprecated** pill.
243
+
* If there is an imminent backwards-incompatible change that affects your app, then the contact email for your app might be contacted about the deprecation.
0 commit comments