Preview a version
1 min
POST
{baseUrl}/idgen/templates/{name}/versions/preview
Path Parameters
- namestringrequiredDescription
Body Parameters
- bodyPreviewRequestrequiredDescription
- versionVersionDraftDtorequiredDescription
- separatorstringrequiredDescription
- segmentsSegmentDto[]Description
- typestringrequiredDescription
- valuestringDescription
- startinteger<int64>DescriptionFormatint64
- endinteger<int64>DescriptionFormatint64
- stepinteger<int64>DescriptionFormatint64
- paddinginteger<int32>DescriptionFormatint32
- charsetstringDescription
- charsstringDescription
- lengthinteger<int32>DescriptionFormatint32
- startTextstringDescription
- endTextstringDescription
- blockSizeinteger<int32>DescriptionFormatint32
- continuesFrominteger<int32>DescriptionFormatint32
- countinteger<int32>DescriptionFormatint32
Responses
200
- PreviewDtoDescription
- idsstring[]Description
- violationsstring[]Description
400
- ErrorDtoDescription
- errorstringrequiredDescription
- messagestringrequiredDescription
- statusinteger<int32>requiredDescriptionFormatint32
- detailsmap<string, string>requiredDescription
- linksmap<string, string>requiredDescription
401
- ErrorDtoDescription
- errorstringrequiredDescription
- messagestringrequiredDescription
- statusinteger<int32>requiredDescriptionFormatint32
- detailsmap<string, string>requiredDescription
- linksmap<string, string>requiredDescription
403
- ErrorDtoDescription
- errorstringrequiredDescription
- messagestringrequiredDescription
- statusinteger<int32>requiredDescriptionFormatint32
- detailsmap<string, string>requiredDescription
- linksmap<string, string>requiredDescription
500
- ErrorDtoDescription
- errorstringrequiredDescription
- messagestringrequiredDescription
- statusinteger<int32>requiredDescriptionFormatint32
- detailsmap<string, string>requiredDescription
- linksmap<string, string>requiredDescription
503
- ErrorDtoDescription
- errorstringrequiredDescription
- messagestringrequiredDescription
- statusinteger<int32>requiredDescriptionFormatint32
- detailsmap<string, string>requiredDescription
- linksmap<string, string>requiredDescription
curl
curl --request POST \
--url http://localhost:8080/idgen/templates/{name}/versions/preview \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"version": {
"separator": "",
"segments": [
{
"type": ""
}
]
}
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"version": {
"separator": "",
"segments": [
{
"type": ""
}
]
}
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("http://localhost:8080/idgen/templates/{name}/versions/preview", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("http://localhost:8080/idgen/templates/{name}/versions/preview")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"version": {
"separator": "",
"segments": [
{
"type": ""
}
]
}
})
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "http://localhost:8080/idgen/templates/{name}/versions/preview"
payload = json.dumps({
"version": {
"separator": "",
"segments": [
{
"type": ""
}
]
}
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// The sample IDs and violations.
{
"ids": [
""
],
"violations": [
""
]
}400
// INVALID_REQUEST: a malformed path, query or body value.
{
"error": "",
"message": "",
"status": "",
"details": "",
"links": ""
}401
// UNAUTHENTICATED: missing, expired or invalid credentials.
{
"error": "",
"message": "",
"status": "",
"details": "",
"links": ""
}403
// FORBIDDEN: the caller lacks the idgen.templates.read permission, or its tenant or site scope does not match.
{
"error": "",
"message": "",
"status": "",
"details": "",
"links": ""
}500
// INTERNAL_ERROR: an unexpected failure. Retry once, then report it with the x-request-id.
{
"error": "",
"message": "",
"status": "",
"details": "",
"links": ""
}503
// AUTH_UNAVAILABLE or BACKEND_UNAVAILABLE (both retryable): retry with backoff.
{
"error": "",
"message": "",
"status": "",
"details": "",
"links": ""
}