Next Reserved Value
Returns the value that is generated by the generator when the next ID value is requested by the Create/Update entity process.
Overview
This operation returns the ID that would be returned when a new ID is requested from the generator. The purpose of this API is to let you query the next ID generated. The response contains the value of {generator_name} of what is going to be generated next (in a common case).
SEQUENTIAL
type of
generator. An exception is thrown if the request body has the generator type that is
anything other than SEQUENTIAL
Request
GET https://{serverURL}/generators/{generator_name}/nextReservedValue
Parameters | Name | Required | Description |
---|---|---|---|
Headers |
|
Yes |
Information about authentication access token in format
|
Content-Type |
Yes | Should be Content-Type:application/json . |
Response
DECIMAL: 10
HEX: A
UUID: 33fefdbf-4b79-44b2-a39a-59600755eefa
Examples
- Create a generator such as the
following:
[ { "name": "DemoNextReservedValue", "type": "SEQUENTIAL", "valueType": "DECIMAL", "rangeStart": "3", "step": "10" } ]
Important: The sequence generator generates unique IDs across our distributed architecture based on the specified alphanumeric characters. Individual IDs may not necessarily be generated in a series. - Execute the Rest API:
GET https://{serverURL}/generators/DemoNextReservedValue/nextReservedValue
- The response is
3
. - No values have been generated, and the next generated value will be
equal to the value of
"rangeStart”
.
- The response is
- Execute the Rest API (or create an entity with the generated ID value):
GET https://{serverURL}/generators/DemoNextReservedValue/generate
Note: The response is3
because a new value is generated. - Execute the Rest API:
GET https://{serverURL}/generators/DemoNextReservedValue/nextReservedValue
The response is
13
(13 = previous "3" + "step": "10").