Sequence
Last updated on 13-May-2020 by Jakob Jakobsen Boysen
On this page
Sequences are used for generating ID, Name, Barcode and DisplayID. See how on the query page.
Get sequences
GET /api/sequence
Response
A list of sequences:
[...
{
"id": string,
"prefix": string,
"minDigits": number,
"nextValue": number,
"type": string,
"pattern": string
}
...]
Where:
id
This is what is referenced using the !-notation. Must be unique.prefix
Short prefix.minDigits
Minimum number of digits.nextValue
The next used number.type
Optional type.pattern
Readable example pattern.
Add or update sequence
POST /api/sequence
Scope: ADMIN
Add or update sequence.
Request
Body
A JSON object with the structure as described above (except pattern
).
Examples
A unique sequence for a project.
{
"id": "PRJ0001-DS-Seq",
"prefix": "UN-SEQ-",
"minDigits": 4,
"type": "ProjectSequence",
}
This will generate sequences starting with: UN-SEQ-0001
;
Another unique sequence for a project starting from 1000.
{
"id": "PRJ0001-DS-Seq2",
"prefix": "UN-SEQ2-",
"minDigits": 4,
"nextValue": 1000,
"type": "ProjectSequence",
}
This will generate sequences starting with: UN-SEQ2-1000
;