API Version Override
The Traversal API is accessed via a compositor layer. This enables us to configure how you call the APIs. By default the compositor is forwarding to version 2, v2. Recently, the introduction of a breaking change, for Textarea, we had to introduce a new version, v3.
Because setting the default immediately to v3 would result in client front-ends breaking on those question/answer types, we have enabled a version override so you can develop, and use, our new version while others catch up with their development.
How It Works
The API version can be overridden by sending the x-api-version header with your API requests. The value should be the version identifier (e.g., v3).
1x-api-version: v3
Implementation Example
When using a proxy-based architecture, you can set the API version via a cookie which the proxy then converts to a header:
1// Store the API version preference
2Cookie.set("apiVersion", "v3");
3
4// In your proxy middleware
5onProxyReq: (proxyReq, req) => {
6 const cookies = cookie.parse(req.headers.cookie || "");
7 if (cookies.apiVersion) {
8 proxyReq.setHeader("x-api-version", cookies.apiVersion);
9 }
10}
Available Versions
| Version | Features |
|---|---|
| v2 | Default version with standard control types |
| v3 | Adds Textarea control type for multiline text input |
Version-Specific Features
v3 Features
- Textarea control type: A multiline text input supporting
minLengthandmaxLengthvalidation. See Textarea for example responses.
