Skip to content

Commit 2ae64e6

Browse files
committed
Merge branch 'DDOC-1208-docgen-guide' of github.com:box/developer.box.com into DDOC-1208-docgen-guide
2 parents 8dd608e + 7a493dc commit 2ae64e6

File tree

118 files changed

+3926
-3725
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+3926
-3725
lines changed

.alexrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"rejects",
66
"period",
77
"fire",
8-
"attacks"
8+
"attacks",
9+
"special",
10+
"straightforward"
911
]
1012
}

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
runs-on: ubuntu-latest
2525
timeout-minutes: 3
2626

27-
# We use node 14.X
27+
# We use node 18.X
2828
strategy:
2929
matrix:
30-
node-version: [14.x]
30+
node-version: [18.x]
3131

3232
# The following steps are performed for each lint job
3333
steps:
@@ -56,10 +56,10 @@ jobs:
5656
runs-on: ubuntu-latest
5757
timeout-minutes: 3
5858

59-
# We use node 14.X
59+
# We use node 18.X
6060
strategy:
6161
matrix:
62-
node-version: [14.x]
62+
node-version: [18.x]
6363

6464
# The following steps are performed for each lint job
6565
steps:
@@ -95,10 +95,10 @@ jobs:
9595
# Only run for the main branch
9696
if: github.ref == 'refs/heads/main'
9797

98-
# We use node 14.X
98+
# We use node 18.X
9999
strategy:
100100
matrix:
101-
node-version: [14.x]
101+
node-version: [18.x]
102102

103103
# Requires the lint and test jobs to pass first
104104
needs:
@@ -162,10 +162,10 @@ jobs:
162162
# Only run for the staging branch
163163
if: github.ref == 'refs/heads/staging'
164164

165-
# We use node 14.X
165+
# We use node 18.X
166166
strategy:
167167
matrix:
168-
node-version: [14.x]
168+
node-version: [18.x]
169169

170170
# Requires the lint and test jobs to pass first
171171
needs:
@@ -214,7 +214,7 @@ jobs:
214214
SLACK_AVATAR: "https://avatars3.githubusercontent.com/u/8659759?s=200&v=4"
215215
with:
216216
args: "Error running `deploy-staging` job in OpenAPI CI"
217-
217+
218218
# The deploy task actually deploys any changes to the en-staging branch
219219
push-to-en-abtest:
220220
# We run this on the latest ubuntu
@@ -223,10 +223,10 @@ jobs:
223223
# Only run for the staging branch
224224
if: github.ref == 'refs/heads/abtest'
225225

226-
# We use node 14.X
226+
# We use node 18.X
227227
strategy:
228228
matrix:
229-
node-version: [14.x]
229+
node-version: [18.x]
230230

231231
# Requires the lint and test jobs to pass first
232232
needs:

.github/workflows/notify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
node-version: [14.x]
20+
node-version: [18.x]
2121

2222
steps:
2323
- name: "Trigger Netlify deployment"

.spelling

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ lifecycle
306306
Fallbacks
307307
deprecations
308308
oasdiff
309+
CrowdStrike
309310
FIPS
310311
OpenAI
311312
XCode
@@ -333,4 +334,4 @@ Anthropic
333334
GPT-4o-2024-05-13
334335
text-embedding-ada-002
335336
params
336-
GPT-4o-mini
337+
GPT-4o-mini

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Using the latest Node 14
1+
# Using the latest Node 18
22
# FROM ubuntu:20.04
3-
FROM node:14
3+
FROM node:18
44

55
# Set a working directory to use
66
WORKDIR /code

content/guides/api-calls/api-versioning-strategy.md

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,58 @@ API versioning empowers Box to continually enhance its platform, while also offe
1313

1414
<Message type='tip'>
1515

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

1818
</Message>
1919

20-
## How Box API versioning works
21-
20+
<!-- Commenting this until we enable base version support in Public API Service
2221
<Message type='notice'>
2322
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.
2530
2631
</Message>
32+
-->
33+
34+
## How Box API versioning works
2735

28-
### Versioning in `path`
36+
<Message type='notice'>
2937

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

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

3642
### Versioning in `header`
3743

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:
46+
47+
```curl
48+
curl --location 'https://api.box.com/2.0/sign_requests' \
49+
--header 'box-version: 2025.0' \
50+
--header 'Authorization: Bearer …
51+
```
52+
53+
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).
3958

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

4265
## Release schedule and naming convention
4366

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.
4568
Introducing a new version of the Sign Request endpoint means that **all paths and HTTP methods** of an endpoint will support it.
4669

4770
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
6992

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

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-
7895
### Endpoint versioning indication
7996

8097
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
83100

84101
| Schema element | Pill name | Description|
85102
|---------------------|-----------|------------|
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.|
88105
| `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`.|
89106

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:
93-
94-
```curl
95-
curl --location 'https://api.box.com/2.0/sign_requests' \
96-
--header 'box-version: 2025.0' \
97-
--header 'Authorization: Bearer …
98-
```
99-
100-
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-
102107
## Versioning errors
103108

104109
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
107112

108113
## How Box SDK versioning works
109114

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

112117
Box SDKs support the **All Versions In** SDK approach.
113118
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
208213
sooner than after 24 months.
209214
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.
210215

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

213218
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.
214219
215220
When customer calls deprecated API endpoint, the response will contain a header:
216221
217222
```sh
218-
Deprecation: date="Fri, 11 Nov 2023 23:59:59 GMT"
223+
Deprecation: date="Fri, 11 Nov 2026 23:59:59 GMT"
219224
Box-API-Deprecated-Reason: https://developer.box.com/reference/deprecated
220225
```
221226
@@ -225,8 +230,8 @@ The date tells clients when this version was marked as deprecated.
225230
226231
When building your request, consider the following:
227232
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 version header 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`.
230235
231236
For details, see [versioning errors](g://api-calls/permissions-and-errors/versioning-errors).
232237
@@ -235,7 +240,7 @@ When Box deprecates a resource or a property of a resource in the API, the chang
235240
* Calls that include the deprecated behavior return the response header `Box-API-Deprecated-Reason` and a link to get more information:
236241
237242
```sh
238-
box-version: 2023.0
243+
box-version: 2025.0
239244
Deprecation: version="version", date="date"
240245
Box-API-Deprecated-Reason: https://developer.box.com/reference/deprecated
241246
```
@@ -246,4 +251,4 @@ When Box deprecates a resource or a property of a resource in the API, the chang
246251
247252
## Additional resources
248253
249-
* [API reference](https://developer.box.com/reference/)
254+
* [API reference](page://reference)

content/guides/api-calls/permissions-and-errors/common-errors.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,17 @@ returns a standard client error JSON object.
3636
}
3737
```
3838

39-
Please see the [Client Error resource](resource://client_error) for more details.
39+
See the [Client Error resource](resource://client_error) for more details.
4040

4141
## Common error codes
4242

43-
Please check our [Developer Troubleshooting Articles][articles]
43+
Check our [Developer Troubleshooting Articles][articles]
4444
for solution to common errors encountered when working with the Box APIs.
4545

4646
### 400 Bad Request
4747

4848
<!-- i18n-enable localize-links -->
49+
<!-- markdownlint-disable no-space-in-code -->
4950

5051
| | |
5152
| --- | -- |
@@ -107,7 +108,7 @@ for solution to common errors encountered when working with the Box APIs.
107108
| | |
108109
| **Error** | `item_name_invalid` |
109110
| **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. |
111112
| | |
112113
| **Error** | `item_name_too_long` |
113114
| **Message** | Item name too long |
@@ -145,6 +146,7 @@ for solution to common errors encountered when working with the Box APIs.
145146
| **Solution** | The user that you are attempting to collaborate in on an item is already collaborated on that item. This request is not needed.|
146147
| | |
147148

149+
<!-- markdownlint-enable no-space-in-code -->
148150
<!-- i18n-disable localize-links -->
149151

150152
### 401 Unauthorized
@@ -174,7 +176,7 @@ for solution to common errors encountered when working with the Box APIs.
174176
| | |
175177
| **Error** | `access_from_location_blocked` |
176178
| **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. |
178180
| | |
179181
| **Error** | `file_size_limit_exceeded` |
180182
| **Message** | File size exceeds the folder owner’s file size limit |
@@ -232,17 +234,17 @@ for solution to common errors encountered when working with the Box APIs.
232234

233235
### 405 Method Not Allowed
234236

235-
| | |
237+
| | |
236238
| ------- | ------ |
237-
| **Error** | `method_not_allowed` |
239+
| **Error** | `method_not_allowed` |
238240
| **Message** | Method Not Allowed |
239241
| **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. |
240242

241243
### 409 Conflict
242244

243245
| | |
244246
| ------- | --------------- |
245-
| **Error** | `conflict` |
247+
| **Error** | `conflict` |
246248
| **Message** | A resource with this value already exists |
247249
| **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. |
248250
| | |
@@ -292,11 +294,11 @@ for solution to common errors encountered when working with the Box APIs.
292294
| | |
293295
| ------- | ------- |
294296
| **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 |
296298
| **Solution** | Check the extended error message in the response body for more details. |
297299
| | |
298300
| **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 |
300302
| **Solution** | Check the extended error message in the response body for more details. |
301303

302304
### 413 Request Entity Too Large
@@ -320,7 +322,7 @@ for solution to common errors encountered when working with the Box APIs.
320322
| | |
321323
| ---- | ---- |
322324
| **Error** | `rate_limit_exceeded` |
323-
| **Message** | Request rate limit exceeded, please try again later |
325+
| **Message** | Request rate limit exceeded, try again later. |
324326
| **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. |
325327

326328
### 500 Internal Service Error
@@ -355,7 +357,7 @@ for solution to common errors encountered when working with the Box APIs.
355357
| ------- | ------- |
356358
| **Error** | `unavailable` |
357359
| **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. |
359361

360362
<!-- i18n-disable localize-links -->
361363

0 commit comments

Comments
 (0)