Skip to content

Commit

Permalink
Update api-versioning-strategy and base version notice
Browse files Browse the repository at this point in the history
  • Loading branch information
wsocha committed Dec 13, 2024
1 parent f0cb19e commit de9033e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 30 deletions.
34 changes: 17 additions & 17 deletions content/guides/api-calls/api-versioning-strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ API versioning empowers Box to continually enhance its platform, while also offe

<Message type='tip'>

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.
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.

</Message>

Expand All @@ -39,7 +39,7 @@ Box API supports versioning in `header`. To determine which version to use, look

### Versioning in `header`

Box API processes the `box-version` header which should contain a valid version name. For example, when the client wants
Box API processes the `box-version` header which should contain a valid version name. For example, when a client wants
to get a list of all sign requests using version `2025.0`, the request should look like this:

```curl
Expand All @@ -49,14 +49,14 @@ curl --location 'https://api.box.com/2.0/sign_requests' \
```

If the provided version is correct and supported by the endpoint, a response is sent to the client.
If the endpoint is available in multiple versions, the response will include the `box-version` header,
If the endpoint is available in multiple versions, the response will include the `box-version` header,
which indicates the version used to handle the request.
Endpoints introduced after 2024 may return a `400` error code if the version is incorrect.
More information about versioning errors can be found [here](g://api-calls/permissions-and-errors/versioning-errors).

## Release schedule and naming convention

Box can introduce a new breaking change to certain endpoints **once per year**.
Box can introduce a new breaking change to certain endpoints **once per year**, which results in a new API version.
Introducing a new version of the Sign Request endpoint means that **all paths and HTTP methods** of an endpoint will support it.

For example, if Sign Request endpoints receive a new version it will apply to all endpoints listed in the table:
Expand Down Expand Up @@ -84,10 +84,10 @@ It also means, that a new version cannot be released sooner than every 12 months

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).

If your request doesn't include a version, the API defaults to the initial Box API version—the version available before
year-based versioning was introduced. However, relying on this behavior is not recommended when adopting deprecated
changes. To ensure consistency, always specify the API version, with each request. By making your application
version-aware, you anchor it to a specific set of features, ensuring consistent behavior throughout the supported
If your request doesn't include a version, the API defaults to the initial Box API version—the version available before
year-based versioning was introduced. However, relying on this behavior is not recommended when adopting deprecated
changes. To ensure consistency, always specify the API version, with each request. By making your application
version-aware, you anchor it to a specific set of features, ensuring consistent behavior throughout the supported
timeframe.

### Endpoint versioning indication
Expand All @@ -98,8 +98,8 @@ To keep you informed about the current API state, and improve the readability of

| Schema element | Pill name | Description|
|---------------------|-----------|------------|
| `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. |
|`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.|
| `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. |
|`x-stability-level: stable` or no `x-stability-level` tag | Latest version | **Latest version** marks the most recent stable API version of an endpoint.|
| `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`.|

## Versioning errors
Expand All @@ -110,7 +110,7 @@ For details on possible errors, see [versioning errors](g://api-calls/permission

## How Box SDK versioning works

The versioning strategy applies only to [next generation generated SDKs](https://developer.box.com/sdks-and-tools/#next-generation-sdks).
The versioning strategy applies only to [next generation generated SDKs](page://sdks-and-tools/#next-generation-sdks).

Box SDKs support the **All Versions In** SDK approach.
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.
Expand Down Expand Up @@ -211,14 +211,14 @@ When new versions of the Box APIs and Box SDKs are released, earlier versions wi
sooner than after 24 months.
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.

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.
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.

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.
When customer calls deprecated API endpoint, the response will contain a header:
```sh
Deprecation: date="Fri, 11 Nov 2023 23:59:59 GMT"
Deprecation: date="Fri, 11 Nov 2026 23:59:59 GMT"
Box-API-Deprecated-Reason: https://developer.box.com/reference/deprecated
```
Expand All @@ -228,8 +228,8 @@ The date tells clients when this version was marked as deprecated.
When building your request, consider the following:
* 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`.
* If the version header is specified but the requested version is unavailable, the response will return an HTTP error code `400 - Bad Request`.
* 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`.
* 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`.
For details, see [versioning errors](g://api-calls/permissions-and-errors/versioning-errors).
Expand All @@ -238,7 +238,7 @@ When Box deprecates a resource or a property of a resource in the API, the chang
* Calls that include the deprecated behavior return the response header `Box-API-Deprecated-Reason` and a link to get more information:
```sh
box-version: 2023.0
box-version: 2025.0
Deprecation: version="version", date="date"
Box-API-Deprecated-Reason: https://developer.box.com/reference/deprecated
```
Expand All @@ -249,4 +249,4 @@ When Box deprecates a resource or a property of a resource in the API, the chang
## Additional resources
* [API reference](https://developer.box.com/reference/)
* [API reference](page://reference)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ When using versioned API calls, you can encounter versioning-related errors. Thi

## Calling with incorrect `box-version` header

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.
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.

The response will include one of the following status messages in `message` field:

Expand Down Expand Up @@ -53,12 +53,12 @@ Box documentation specifies API URLs. For instance, the Sign Requests endpoints
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:

```sh
Deprecation: date="Fri, 11 Nov 2023 23:59:59 GMT"
Deprecation: date="Fri, 11 Nov 2026 23:59:59 GMT"
Box-API-Deprecated-Reason: https://developer.box.com/reference/deprecated
```

You should monitor API responses to verify if the `Deprecation` header is present to accordingly plan the transition to a new API version.

## Calling a non-existent version

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.
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.
21 changes: 11 additions & 10 deletions content/microcopy/versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ about: About Box API versioning
resource_version_tooltip: This resource is used by endpoints in version %s

base_version_notice:
// endpoint: Notice that the endpoint has a version 2024.0
endpoint: |-
This endpoint is in the version 2024.0. No changes are required to continue
using it. For more details, see **[Box API versioning]
(g://api-calls/permissions-and-errors/versioning-errors)**.
// resource: Notice that the resource has a version 2024.0
resource: |-
This resource is used by enpoints in the version 2024.0.
For more details, see **[Box API versioning]
(g://api-calls/permissions-and-errors/versioning-errors)**.
__raw__:
// endpoint: Notice that the endpoint has a version 2024.0
endpoint: |-
This endpoint is in the version **2024.0**. No changes are required to
continue using it. For more details, see
**[Box API versioning](g://api-calls/api-versioning-strategy)**.
// resource: Notice that the resource has a version 2024.0
resource: |-
This resource is used by enpoints in the version **2024.0**.
For more details, see
**[Box API versioning](g://api-calls/api-versioning-strategy)**.
11 changes: 11 additions & 0 deletions docs/add-microcopy.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ webhook-tester:
Once created, lint the page using `yarn lint`. Any spelling mistakes or broken
links should pop up automatically.

## Important notes

If a microcopy entry contains formatting elements like backticks ``` `something` ``` or asterisks ``` **something** ``` it will be automatically htmlified. To avoid that, the entry path have to contain `__raw__` segment, for example:

```yml
notice:
__raw__:
// additional_info: Notice with additional info with link
additional_info: For more details, see **[Start here](g://getting-started)**.
```

---

[**Next:** Contributing a pull request](./pull-request.md)

0 comments on commit de9033e

Please sign in to comment.