Set a numbering template
const url = 'https://app.dev.buildtrace.eu/api/numbering-schemes/SERIAL';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"template":"example","nextValue":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://app.dev.buildtrace.eu/api/numbering-schemes/SERIAL \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "template": "example", "nextValue": 1 }'Sets the organization-wide template for a scope and, optionally, moves its next value forward (at most 999999999999). The next value can’t go below the current one, so no number is issued twice. Only SERIAL, BUILD_ORDER and REWORK_ORDER can be set; LOT and DEVICE are refused with a 400, since BuildTrace doesn’t generate those numbers.
Required scope: settings:write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Omit to keep the current next value. Can’t be below the current one.
Example generated
{ "template": "example", "nextValue": 1}Responses
Section titled “Responses”OK
object
Literal text plus tokens: {YYYY} {YY} {MM} and {SEQ} or {SEQ:n} (zero-padded to n digits, 1-9).
The sequence value the next number will use.
The next number, formatted now.
The longest number this scope can store.
Example
{ "scope": "SERIAL"}Bad request (invalid template, next value out of range, unknown scope or one BuildTrace doesn’t generate numbers for)
object
Example generated
{ "error": "example"}Unauthorized
Forbidden