Timetable field number API Guide
Create version - Successfully
POST /v1/field-numbers/versions
Request Body Fields
Path | Type | Optional | Description |
---|---|---|---|
id |
Integer |
true |
This ID helps identify versions of a timetable field number in the use case front end and/or update. This ID can be deleted if the version is no longer present. Do not use this ID to map your object to a timetable field number. To do this, use the ttfnid in combination with the data range (valid from/valid until). Example value: 1 |
ttfnid |
String |
true |
Timetable field number identifier Example value: ch:1:ttfnid:100000 |
description |
String |
true |
Description Example value: Fribourg/Freiburg - Bern - Thun (S-Bahn Bern, Linien S1, S2) Must conform to regex [\u0000-\u00ff]* Length must be between 0 and 255 |
number |
String |
false |
Number Example value: 100; 80.099; 2700 Must conform to regex [.0-9]* Length must be between 1 and 50 |
swissTimetableFieldNumber |
String |
false |
Timetable field number Example value: b0.123 Must conform to regex [-.:_0-9a-zA-Z]* Length must be between 1 and 50 |
status |
String |
true |
Status Must be one of ["DRAFT","VALIDATED","IN_REVIEW","WITHDRAWN","REVOKED"] |
validFrom |
String |
false |
Date - valid from Example value: 2021-11-23 |
validTo |
String |
false |
Date - valid to Example value: 2021-12-01 |
businessOrganisation |
String |
false |
BusinessOrganisation SBOID Example value: ch:1:sboid:100001 Must conform to regex [\u0000-\u00ff]* Length must be between 1 and 50 |
comment |
String |
true |
Additional comment Example value: Hier kann für interne Zwecke ein Kommentar welcher das Fahrplanfeld betrifft erfasst werden. Must conform to regex [\u0000-\u00ff]* Length must be between 0 and 1500 |
etagVersion |
Integer |
true |
Optimistic locking version - instead of ETag HTTP Header (see RFC7232:Section 2.3) Example value: 5 |
creationDate |
String |
true |
Object creation date Example value: 01.01.2000 |
creator |
String |
true |
User creator Example value: u123456 |
editionDate |
String |
true |
Last edition date Example value: 01.01.2000 |
editor |
String |
true |
User editor Example value: u123456 |
status |
String |
true |
Status Must be one of ["DRAFT","VALIDATED","IN_REVIEW","WITHDRAWN","REVOKED"] |
Example request
$ curl 'http://localhost:8080/v1/field-numbers/versions' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"creationDate" : null,
"creator" : null,
"editionDate" : null,
"editor" : null,
"status" : "VALIDATED",
"id" : null,
"ttfnid" : "123",
"description" : "description",
"number" : "123",
"swissTimetableFieldNumber" : "swissLineNumber",
"validFrom" : "2000-01-01",
"validTo" : "2000-12-31",
"businessOrganisation" : "sbb",
"comment" : null,
"etagVersion" : null
}'
Example response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 462
{
"creationDate" : "2025-08-19T08:35:31.634282",
"creator" : "e123456",
"editionDate" : "2025-08-19T08:35:31.634308",
"editor" : "e123456",
"status" : "VALIDATED",
"id" : 1013,
"ttfnid" : "ch:1:ttfnid:1000000",
"description" : "description",
"number" : "123",
"swissTimetableFieldNumber" : "swissLineNumber",
"validFrom" : "2000-01-01",
"validTo" : "2000-12-31",
"businessOrganisation" : "sbb",
"comment" : null,
"etagVersion" : 0
}
Update version with rest optimistic locking error
POST /v1/field-numbers/versions/1008
Path Variables
Path Variable | Type | Optional | Description |
---|---|---|---|
id |
Integer |
false |
Request Body Fields
Path | Type | Optional | Description |
---|---|---|---|
id |
Integer |
true |
This ID helps identify versions of a timetable field number in the use case front end and/or update. This ID can be deleted if the version is no longer present. Do not use this ID to map your object to a timetable field number. To do this, use the ttfnid in combination with the data range (valid from/valid until). Example value: 1 |
ttfnid |
String |
true |
Timetable field number identifier Example value: ch:1:ttfnid:100000 |
description |
String |
true |
Description Example value: Fribourg/Freiburg - Bern - Thun (S-Bahn Bern, Linien S1, S2) Must conform to regex [\u0000-\u00ff]* Length must be between 0 and 255 |
number |
String |
false |
Number Example value: 100; 80.099; 2700 Must conform to regex [.0-9]* Length must be between 1 and 50 |
swissTimetableFieldNumber |
String |
false |
Timetable field number Example value: b0.123 Must conform to regex [-.:_0-9a-zA-Z]* Length must be between 1 and 50 |
status |
String |
true |
Status Must be one of ["DRAFT","VALIDATED","IN_REVIEW","WITHDRAWN","REVOKED"] |
validFrom |
String |
false |
Date - valid from Example value: 2021-11-23 |
validTo |
String |
false |
Date - valid to Example value: 2021-12-01 |
businessOrganisation |
String |
false |
BusinessOrganisation SBOID Example value: ch:1:sboid:100001 Must conform to regex [\u0000-\u00ff]* Length must be between 1 and 50 |
comment |
String |
true |
Additional comment Example value: Hier kann für interne Zwecke ein Kommentar welcher das Fahrplanfeld betrifft erfasst werden. Must conform to regex [\u0000-\u00ff]* Length must be between 0 and 1500 |
etagVersion |
Integer |
true |
Optimistic locking version - instead of ETag HTTP Header (see RFC7232:Section 2.3) Example value: 5 |
creationDate |
String |
true |
Object creation date Example value: 01.01.2000 |
creator |
String |
true |
User creator Example value: u123456 |
editionDate |
String |
true |
Last edition date Example value: 01.01.2000 |
editor |
String |
true |
User editor Example value: u123456 |
status |
String |
true |
Status Must be one of ["DRAFT","VALIDATED","IN_REVIEW","WITHDRAWN","REVOKED"] |
Example request
$ curl 'http://localhost:8080/v1/field-numbers/versions/1008' -i -X POST \
-H 'Content-Type: application/json' \
-d '{
"creationDate" : "2025-08-19T08:35:31.135783",
"creator" : "e123456",
"editionDate" : "2025-08-19T08:35:31.135807",
"editor" : "e123456",
"status" : "VALIDATED",
"id" : 1008,
"ttfnid" : "ch:1:ttfnid:100000",
"description" : "FPFN Description",
"number" : "10.100",
"swissTimetableFieldNumber" : "b0.100",
"validFrom" : "2020-01-01",
"validTo" : "2020-12-31",
"businessOrganisation" : "sbb",
"comment" : "Neuer Kommentar wurde erfasst",
"etagVersion" : 0
}'
Example response
HTTP/1.1 412 Precondition Failed
Content-Type: application/json
Content-Length: 523
{
"status" : 412,
"message" : "Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [TimetableFieldNumberVersion#version]",
"error" : "Stale object state error",
"details" : [ {
"message" : "Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [TimetableFieldNumberVersion#version]",
"field" : "etagVersion",
"displayInfo" : {
"code" : "COMMON.NOTIFICATION.OPTIMISTIC_LOCK_ERROR",
"parameters" : [ ]
}
} ]
}
Update version with no changes after versioning error
POST /v1/field-numbers/versions/1006
Path Variables
Path Variable | Type | Optional | Description |
---|---|---|---|
id |
Integer |
false |
Request Body Fields
Path | Type | Optional | Description |
---|---|---|---|
id |
Integer |
true |
This ID helps identify versions of a timetable field number in the use case front end and/or update. This ID can be deleted if the version is no longer present. Do not use this ID to map your object to a timetable field number. To do this, use the ttfnid in combination with the data range (valid from/valid until). Example value: 1 |
ttfnid |
String |
true |
Timetable field number identifier Example value: ch:1:ttfnid:100000 |
description |
String |
true |
Description Example value: Fribourg/Freiburg - Bern - Thun (S-Bahn Bern, Linien S1, S2) Must conform to regex [\u0000-\u00ff]* Length must be between 0 and 255 |
number |
String |
false |
Number Example value: 100; 80.099; 2700 Must conform to regex [.0-9]* Length must be between 1 and 50 |
swissTimetableFieldNumber |
String |
false |
Timetable field number Example value: b0.123 Must conform to regex [-.:_0-9a-zA-Z]* Length must be between 1 and 50 |
status |
String |
true |
Status Must be one of ["DRAFT","VALIDATED","IN_REVIEW","WITHDRAWN","REVOKED"] |
validFrom |
String |
false |
Date - valid from Example value: 2021-11-23 |
validTo |
String |
false |
Date - valid to Example value: 2021-12-01 |
businessOrganisation |
String |
false |
BusinessOrganisation SBOID Example value: ch:1:sboid:100001 Must conform to regex [\u0000-\u00ff]* Length must be between 1 and 50 |
comment |
String |
true |
Additional comment Example value: Hier kann für interne Zwecke ein Kommentar welcher das Fahrplanfeld betrifft erfasst werden. Must conform to regex [\u0000-\u00ff]* Length must be between 0 and 1500 |
etagVersion |
Integer |
true |
Optimistic locking version - instead of ETag HTTP Header (see RFC7232:Section 2.3) Example value: 5 |
creationDate |
String |
true |
Object creation date Example value: 01.01.2000 |
creator |
String |
true |
User creator Example value: u123456 |
editionDate |
String |
true |
Last edition date Example value: 01.01.2000 |
editor |
String |
true |
User editor Example value: u123456 |
status |
String |
true |
Status Must be one of ["DRAFT","VALIDATED","IN_REVIEW","WITHDRAWN","REVOKED"] |
Example request
$ curl 'http://localhost:8080/v1/field-numbers/versions/1006' -i -X POST \
-H 'Content-Type: application/json' \
-d '{
"creationDate" : "2025-08-19T08:35:30.857468",
"creator" : "e123456",
"editionDate" : "2025-08-19T08:35:30.857561",
"editor" : "e123456",
"status" : "VALIDATED",
"id" : 1006,
"ttfnid" : "ch:1:ttfnid:100000",
"description" : "FPFN Description",
"number" : "10.100",
"swissTimetableFieldNumber" : "b0.100",
"validFrom" : "2020-01-01",
"validTo" : "2020-12-31",
"businessOrganisation" : "sbb",
"comment" : null,
"etagVersion" : 0
}'
Example response
HTTP/1.1 520
Content-Type: application/json
Content-Length: 359
{
"status" : 520,
"message" : "No entities were modified after versioning execution.",
"error" : "No changes after versioning",
"details" : [ {
"message" : "No entities were modified after versioning execution.",
"field" : null,
"displayInfo" : {
"code" : "ERROR.WARNING.VERSIONING_NO_CHANGES",
"parameters" : [ ]
}
} ]
}
Get versions with not found error
GET /v1/field-numbers/versions/123
Path Variables
Path Variable | Type | Optional | Description |
---|---|---|---|
ttfnId |
String |
false |
Example request
$ curl 'http://localhost:8080/v1/field-numbers/versions/123' -i -X GET \
-H 'Content-Type: application/json;charset=UTF-8'
Example response
HTTP/1.1 404 Not Found
Content-Type: application/json
Content-Length: 396
{
"status" : 404,
"message" : "Entity not found",
"error" : "Not found",
"details" : [ {
"message" : "Object with ttfnid 123 not found",
"field" : "ttfnid",
"displayInfo" : {
"code" : "ERROR.ENTITY_NOT_FOUND",
"parameters" : [ {
"key" : "field",
"value" : "ttfnid"
}, {
"key" : "value",
"value" : "123"
} ]
}
} ]
}