Line API Guide
Get Line Overview - Successfully
GET /v1/lines
Query Parameters
Parameter | Type | Optional | Description |
---|---|---|---|
swissLineNumber |
String |
true |
|
searchCriteria |
Array[String] |
true |
|
statusRestrictions |
Array[String] |
true |
Must be one of ["DRAFT","VALIDATED","IN_REVIEW","WITHDRAWN","REVOKED"] |
typeRestrictions |
Array[String] |
true |
Must be one of ["ORDERLY","TEMPORARY","OPERATIONAL","DISPOSITION","TECHNICAL","CONCESSION"] |
elementRestrictions |
Array[String] |
true |
Must be one of ["LINE","SUBLINE"] |
businessOrganisation |
String |
true |
|
validOn |
String |
true |
|
fromDate |
String |
true |
|
toDate |
String |
true |
|
validToFromDate |
String |
true |
|
page |
Integer |
true |
|
size |
Integer |
true |
|
sort |
Array[String] |
true |
Example request
$ curl 'http://localhost:8080/v1/lines?page=0&size=5&sort=swissLineNumber,asc' -i -X GET
Example response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 387
{
"objects" : [ {
"swissLineNumber" : "swissLineNumber",
"status" : "DRAFT",
"lidiElementType" : "ORDERLY",
"elementType" : "LINE",
"slnid" : "ch:1:slnid:1000009",
"number" : "number",
"description" : "description",
"validFrom" : "2020-01-01",
"validTo" : "2020-12-31",
"businessOrganisation" : "businessOrganisation"
} ],
"totalCount" : 1
}
Get Line with not found error
GET /v1/lines/versions/123
Path Variables
Path Variable | Type | Optional | Description |
---|---|---|---|
slnid |
String |
false |
Example request
$ curl 'http://localhost:8080/v1/lines/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: 393
{
"status" : 404,
"message" : "Entity not found",
"error" : "Not found",
"details" : [ {
"message" : "Object with slnid 123 not found",
"field" : "slnid",
"displayInfo" : {
"code" : "ERROR.ENTITY_NOT_FOUND",
"parameters" : [ {
"key" : "field",
"value" : "slnid"
}, {
"key" : "value",
"value" : "123"
} ]
}
} ]
}
Get LineVersion Get Line V2
GET /v2/lines/versions/ch:1:slnid:1000011
Path Variables
Path Variable | Type | Optional | Description |
---|---|---|---|
slnid |
String |
false |
Example request
$ curl 'http://localhost:8080/v2/lines/versions/ch:1:slnid:1000011' -i -X GET
Example response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 657
[ {
"creationDate" : "2025-08-19T08:35:09.234852",
"creator" : "e123456",
"editionDate" : "2025-08-19T08:35:09.235006",
"editor" : "e123456",
"status" : "VALIDATED",
"id" : 1011,
"slnid" : "ch:1:slnid:1000011",
"longName" : "longName",
"validFrom" : "2020-01-01",
"validTo" : "2020-12-31",
"businessOrganisation" : "businessOrganisation",
"comment" : "comment",
"etagVersion" : 0,
"lineVersionWorkflows" : [ ],
"description" : "description",
"number" : "number",
"swissLineNumber" : "swissLineNumber",
"lineConcessionType" : "COLLECTION_LINE",
"shortNumber" : "6",
"offerCategory" : "IC",
"lineType" : "ORDERLY"
} ]
Get LineVersion V2 Get Line Not Found
GET /v2/lines/versions/123
Path Variables
Path Variable | Type | Optional | Description |
---|---|---|---|
slnid |
String |
false |
Example request
$ curl 'http://localhost:8080/v2/lines/versions/123' -i -X GET
Example response
HTTP/1.1 404 Not Found
Content-Type: application/json
Content-Length: 393
{
"status" : 404,
"message" : "Entity not found",
"error" : "Not found",
"details" : [ {
"message" : "Object with slnid 123 not found",
"field" : "slnid",
"displayInfo" : {
"code" : "ERROR.ENTITY_NOT_FOUND",
"parameters" : [ {
"key" : "field",
"value" : "slnid"
}, {
"key" : "value",
"value" : "123"
} ]
}
} ]
}
Create LineVersion V2
POST /v2/lines/versions
Request Body Fields
Path | Type | Optional | Description |
---|---|---|---|
lineType |
String |
false |
LineType Must be one of ["ORDERLY","DISPOSITION","TEMPORARY","OPERATIONAL"] |
description |
String |
false |
Description Example value: Meiringen - Innertkirchen Must conform to regex [\u0000-\u00ff]* Length must be between 2 and 255 |
number |
String |
false |
Number Example value: L1 Must conform to regex [\u0000-\u00ff]* Length must be between 0 and 8 |
swissLineNumber |
String |
true |
SwissLineNumber Example value: b1.L1 Must conform to regex [-.:_0-9a-zA-Z]* Length must be between 1 and 50 |
lineConcessionType |
String |
true |
ConcessionType Must be one of ["FEDERALLY_LICENSED_OR_APPROVED_LINE","VARIANT_OF_A_LICENSED_LINE","FEDERAL_ZONE_CONCESSION","LINE_OF_A_ZONE_CONCESSION","CANTONALLY_APPROVED_LINE","RIGHT_FREE_LINE","NOT_LICENSED_UNPUBLISHED_LINE","COLLECTION_LINE","LINE_ABROAD"] |
shortNumber |
String |
true |
ShortNumber Example value: 61 Must conform to regex [\u0000-\u00ff]* Length must be between 1 and 10 |
offerCategory |
String |
false |
offerCategory Must be one of ["EV","IC","EC","EN","IR","RE","R","S","SN","PE","EXT","ATZ","ICE","TGV","RJ","TE2","TER","RB","IRE","T","TN","M","CAX","CAR","EXB","B","BN","RUB","BP","FUN","PB","GB","SL","ASC","BAT","FAE"] |
id |
Integer |
true |
This ID helps identify versions of a line 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 line. To do this, use the slnid in combination with the data range (valid from/valid until). Example value: 1 |
slnid |
String |
true |
SLNID Example value: ch:1:slnid:10001234 |
longName |
String |
true |
LongName Example value: Spiseggfräser; Talstation - Bergstation; Ersatzbus Must conform to regex [\u0000-\u00ff]* Length must be between 1 and 255 |
validFrom |
String |
false |
Valid from |
validTo |
String |
false |
Valid to |
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 |
Comment Example value: Comment regarding the line 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 |
lineVersionWorkflows |
Array[Object] |
true |
Workflows related to the line version |
lineVersionWorkflows[].workflowId |
Integer |
true |
Workflow Id |
lineVersionWorkflows[].workflowProcessingStatus |
String |
true |
WorkflowProcessingStatus Must be one of ["EVALUATED","IN_PROGRESS"] |
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/v2/lines/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,
"slnid" : null,
"longName" : "long name",
"validFrom" : "2000-01-01",
"validTo" : "2000-12-31",
"businessOrganisation" : "sbb",
"comment" : "comment",
"etagVersion" : null,
"lineVersionWorkflows" : [ ],
"description" : "description",
"number" : "number",
"swissLineNumber" : "swissLineNumber",
"lineConcessionType" : "COLLECTION_LINE",
"shortNumber" : "6",
"offerCategory" : "IC",
"lineType" : "ORDERLY"
}'
Example response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 633
{
"creationDate" : "2025-08-19T08:35:09.436455",
"creator" : "e123456",
"editionDate" : "2025-08-19T08:35:09.436491",
"editor" : "e123456",
"status" : "DRAFT",
"id" : 1012,
"slnid" : "ch:1:slnid:1000012",
"longName" : "long name",
"validFrom" : "2000-01-01",
"validTo" : "2000-12-31",
"businessOrganisation" : "sbb",
"comment" : "comment",
"etagVersion" : 0,
"lineVersionWorkflows" : [ ],
"description" : "description",
"number" : "number",
"swissLineNumber" : "swissLineNumber",
"lineConcessionType" : "COLLECTION_LINE",
"shortNumber" : "6",
"offerCategory" : "IC",
"lineType" : "ORDERLY"
}
Update LineVersion V2
PUT /v2/lines/versions/1010
Path Variables
Path Variable | Type | Optional | Description |
---|---|---|---|
id |
Integer |
false |
Request Body Fields
Path | Type | Optional | Description |
---|---|---|---|
description |
String |
false |
Description Example value: Meiringen - Innertkirchen Must conform to regex [\u0000-\u00ff]* Length must be between 2 and 255 |
number |
String |
false |
Number Example value: L1 Must conform to regex [\u0000-\u00ff]* Length must be between 0 and 8 |
swissLineNumber |
String |
true |
SwissLineNumber Example value: b1.L1 Must conform to regex [-.:_0-9a-zA-Z]* Length must be between 1 and 50 |
lineConcessionType |
String |
true |
ConcessionType Must be one of ["FEDERALLY_LICENSED_OR_APPROVED_LINE","VARIANT_OF_A_LICENSED_LINE","FEDERAL_ZONE_CONCESSION","LINE_OF_A_ZONE_CONCESSION","CANTONALLY_APPROVED_LINE","RIGHT_FREE_LINE","NOT_LICENSED_UNPUBLISHED_LINE","COLLECTION_LINE","LINE_ABROAD"] |
shortNumber |
String |
true |
ShortNumber Example value: 61 Must conform to regex [\u0000-\u00ff]* Length must be between 1 and 10 |
offerCategory |
String |
false |
offerCategory Must be one of ["EV","IC","EC","EN","IR","RE","R","S","SN","PE","EXT","ATZ","ICE","TGV","RJ","TE2","TER","RB","IRE","T","TN","M","CAX","CAR","EXB","B","BN","RUB","BP","FUN","PB","GB","SL","ASC","BAT","FAE"] |
id |
Integer |
true |
This ID helps identify versions of a line 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 line. To do this, use the slnid in combination with the data range (valid from/valid until). Example value: 1 |
slnid |
String |
true |
SLNID Example value: ch:1:slnid:10001234 |
longName |
String |
true |
LongName Example value: Spiseggfräser; Talstation - Bergstation; Ersatzbus Must conform to regex [\u0000-\u00ff]* Length must be between 1 and 255 |
validFrom |
String |
false |
Valid from |
validTo |
String |
false |
Valid to |
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 |
Comment Example value: Comment regarding the line 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 |
lineVersionWorkflows |
Array[Object] |
true |
Workflows related to the line version |
lineVersionWorkflows[].workflowId |
Integer |
true |
Workflow Id |
lineVersionWorkflows[].workflowProcessingStatus |
String |
true |
WorkflowProcessingStatus Must be one of ["EVALUATED","IN_PROGRESS"] |
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/v2/lines/versions/1010' -i -X PUT \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"creationDate" : "2025-08-19T08:35:08.436998",
"creator" : "e123456",
"editionDate" : "2025-08-19T08:35:08.437023",
"editor" : "e123456",
"status" : "VALIDATED",
"id" : 1010,
"slnid" : null,
"longName" : "long name",
"validFrom" : "2020-01-01",
"validTo" : "2020-12-31",
"businessOrganisation" : "PostAuto",
"comment" : "comment",
"etagVersion" : 0,
"lineVersionWorkflows" : [ ],
"description" : "description",
"number" : "number",
"swissLineNumber" : "b0.IC2",
"lineConcessionType" : "COLLECTION_LINE",
"shortNumber" : "6",
"offerCategory" : "IC"
}'
Example response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 633
[ {
"creationDate" : "2025-08-19T08:35:08.436998",
"creator" : "e123456",
"editionDate" : "2025-08-19T08:35:08.920925",
"editor" : "e123456",
"status" : "DRAFT",
"id" : 1010,
"slnid" : "ch:1:slnid:1000010",
"longName" : "long name",
"validFrom" : "2020-01-01",
"validTo" : "2020-12-31",
"businessOrganisation" : "PostAuto",
"comment" : "comment",
"etagVersion" : 2,
"lineVersionWorkflows" : [ ],
"description" : "description",
"number" : "number",
"swissLineNumber" : "b0.IC2",
"lineConcessionType" : "COLLECTION_LINE",
"shortNumber" : "6",
"offerCategory" : "IC",
"lineType" : "ORDERLY"
} ]