Relation API Guide
Get Relations by Sloid - Successfully
GET /v1/relations/ch:1:sloid:8507000:1
Path Variables
Path Variable | Type | Optional | Description |
---|---|---|---|
sloid |
String |
false |
Example request
$ curl 'http://localhost:8080/v1/relations/ch:1:sloid:8507000:1' -i -X GET
Example response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 666
[ {
"creationDate" : "2025-06-06T09:33:50.183017",
"creator" : "e123456",
"editionDate" : "2025-06-06T09:33:50.183067",
"editor" : "e123456",
"status" : "VALIDATED",
"id" : 1000,
"validFrom" : "2000-01-01",
"validTo" : "2000-12-31",
"etagVersion" : 0,
"parentServicePointSloid" : "ch:1:sloid:8507000",
"referencePointSloid" : "ch:1:sloid:123456",
"elementSloid" : "ch:1:sloid:8507000:1",
"tactileVisualMarks" : "YES",
"contrastingAreas" : "YES",
"stepFreeAccess" : "NO",
"referencePointElementType" : "PLATFORM",
"number" : {
"number" : 1234567,
"uicCountryCode" : 12,
"numberShort" : 34567,
"checkDigit" : 8
}
} ]
Update Relation - Successfully
PUT /v1/relations/1006
Path Variables
Path Variable | Type | Optional | Description |
---|---|---|---|
id |
Integer |
false |
Request Body Fields
Path | Type | Optional | Description |
---|---|---|---|
parentServicePointSloid |
String |
true |
Parent Service Point Sloid: Unique code for locations that is used in customer information. The structure is described in the “Swiss Location ID” specification, chapter 4.2. The document is available here: transportdatamanagement.ch/standards/ Example value: ch:1:sloid:18771 Length must be between 1 and 500 |
referencePointSloid |
String |
true |
Reference Point Sloid: Unique code for locations that is used in customer information. The structure is described in the “Swiss Location ID” specification, chapter 4.2. The document is available here: transportdatamanagement.ch/standards/ Example value: ch:1:sloid:18771 Length must be between 1 and 500 |
elementSloid |
String |
true |
Element Sloid: Unique code for locations that is used in customer information. The structure is described in the “Swiss Location ID” specification, chapter 4.2. The document is available here: transportdatamanagement.ch/standards/ Example value: ch:1:sloid:18771 Length must be between 1 and 500 |
tactileVisualMarks |
String |
false |
Must be one of ["TO_BE_COMPLETED","YES","NO","NOT_APPLICABLE","PARTIALLY","WITH_REMOTE_CONTROL"] |
contrastingAreas |
String |
false |
Must be one of ["TO_BE_COMPLETED","YES","NO","NOT_APPLICABLE","PARTIALLY"] |
stepFreeAccess |
String |
false |
Must be one of ["TO_BE_COMPLETED","YES","NO","NOT_APPLICABLE","YES_WITH_LIFT","YES_WITH_RAMP"] |
referencePointElementType |
String |
true |
Must be one of ["PLATFORM","CONTACT_POINT","TOILET","PARKING_LOT"] |
id |
Integer |
true |
This ID helps identify versions of a prm object 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 prm object. To do this, use the sloid or parentServicePointSloid in combination with the data range (valid from/valid until). Example value: 1 |
validFrom |
String |
false |
Valid from |
validTo |
String |
false |
Valid to |
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/relations/1006' -i -X PUT \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"creationDate" : "2025-06-06T09:33:50.796924",
"creator" : "e123456",
"editionDate" : "2025-06-06T09:33:50.796952",
"editor" : "e123456",
"status" : null,
"id" : null,
"validFrom" : "2001-01-01",
"validTo" : "2001-12-31",
"etagVersion" : 0,
"parentServicePointSloid" : "ch:1:sloid:7000",
"referencePointSloid" : "ch:1:sloid:7000:1",
"elementSloid" : "ch:1:sloid:123456:1",
"tactileVisualMarks" : "YES",
"contrastingAreas" : "NO",
"stepFreeAccess" : "NO",
"referencePointElementType" : null
}'
Example response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1321
[ {
"creationDate" : "2025-06-06T09:33:50.790116",
"creator" : "e123456",
"editionDate" : "2025-06-06T09:33:50.790148",
"editor" : "e123456",
"status" : "VALIDATED",
"id" : 1005,
"validFrom" : "2000-01-01",
"validTo" : "2000-12-31",
"etagVersion" : 1,
"parentServicePointSloid" : "ch:1:sloid:7000",
"referencePointSloid" : "ch:1:sloid:7000:1",
"elementSloid" : "ch:1:sloid:123456:1",
"tactileVisualMarks" : "YES",
"contrastingAreas" : "YES",
"stepFreeAccess" : "NO",
"referencePointElementType" : "PLATFORM",
"number" : {
"number" : 1234567,
"uicCountryCode" : 12,
"numberShort" : 34567,
"checkDigit" : 8
}
}, {
"creationDate" : "2025-06-06T09:33:50.796924",
"creator" : "e123456",
"editionDate" : "2025-06-06T09:33:50.972389",
"editor" : "e123456",
"status" : "VALIDATED",
"id" : 1006,
"validFrom" : "2001-01-01",
"validTo" : "2001-12-31",
"etagVersion" : 2,
"parentServicePointSloid" : "ch:1:sloid:7000",
"referencePointSloid" : "ch:1:sloid:7000:1",
"elementSloid" : "ch:1:sloid:123456:1",
"tactileVisualMarks" : "YES",
"contrastingAreas" : "NO",
"stepFreeAccess" : "NO",
"referencePointElementType" : "PLATFORM",
"number" : {
"number" : 1234567,
"uicCountryCode" : 12,
"numberShort" : 34567,
"checkDigit" : 8
}
} ]
Update Relation with constraints violation- Unsuccessfully
PUT /v1/relations/1003
Path Variables
Path Variable | Type | Optional | Description |
---|---|---|---|
id |
Integer |
false |
Request Body Fields
Path | Type | Optional | Description |
---|---|---|---|
parentServicePointSloid |
String |
true |
Parent Service Point Sloid: Unique code for locations that is used in customer information. The structure is described in the “Swiss Location ID” specification, chapter 4.2. The document is available here: transportdatamanagement.ch/standards/ Example value: ch:1:sloid:18771 Length must be between 1 and 500 |
referencePointSloid |
String |
true |
Reference Point Sloid: Unique code for locations that is used in customer information. The structure is described in the “Swiss Location ID” specification, chapter 4.2. The document is available here: transportdatamanagement.ch/standards/ Example value: ch:1:sloid:18771 Length must be between 1 and 500 |
elementSloid |
String |
true |
Element Sloid: Unique code for locations that is used in customer information. The structure is described in the “Swiss Location ID” specification, chapter 4.2. The document is available here: transportdatamanagement.ch/standards/ Example value: ch:1:sloid:18771 Length must be between 1 and 500 |
tactileVisualMarks |
String |
false |
Must be one of ["TO_BE_COMPLETED","YES","NO","NOT_APPLICABLE","PARTIALLY","WITH_REMOTE_CONTROL"] |
contrastingAreas |
String |
false |
Must be one of ["TO_BE_COMPLETED","YES","NO","NOT_APPLICABLE","PARTIALLY"] |
stepFreeAccess |
String |
false |
Must be one of ["TO_BE_COMPLETED","YES","NO","NOT_APPLICABLE","YES_WITH_LIFT","YES_WITH_RAMP"] |
referencePointElementType |
String |
true |
Must be one of ["PLATFORM","CONTACT_POINT","TOILET","PARKING_LOT"] |
id |
Integer |
true |
This ID helps identify versions of a prm object 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 prm object. To do this, use the sloid or parentServicePointSloid in combination with the data range (valid from/valid until). Example value: 1 |
validFrom |
String |
false |
Valid from |
validTo |
String |
false |
Valid to |
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/relations/1003' -i -X PUT \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"creationDate" : "2025-06-06T09:33:50.397038",
"creator" : "e123456",
"editionDate" : "2025-06-06T09:33:50.397064",
"editor" : "e123456",
"status" : null,
"id" : null,
"validFrom" : "2001-01-01",
"validTo" : "2001-12-31",
"etagVersion" : 0,
"parentServicePointSloid" : "ch:1:sloid:7000",
"referencePointSloid" : "ch:1:sloid:7000:1",
"elementSloid" : "ch:1:sloid:123456:1",
"tactileVisualMarks" : null,
"contrastingAreas" : null,
"stepFreeAccess" : null,
"referencePointElementType" : null
}'
Example response
HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 1141
{
"status" : 400,
"message" : "Constraint for requestbody was violated",
"error" : "Method argument not valid error",
"details" : [ {
"message" : "Value null rejected due to must not be null",
"field" : "stepFreeAccess",
"displayInfo" : {
"code" : "ERROR.CONSTRAINT",
"parameters" : [ {
"key" : "rejectedValue",
"value" : "null"
}, {
"key" : "cause",
"value" : "must not be null"
} ]
}
}, {
"message" : "Value null rejected due to must not be null",
"field" : "contrastingAreas",
"displayInfo" : {
"code" : "ERROR.CONSTRAINT",
"parameters" : [ {
"key" : "rejectedValue",
"value" : "null"
}, {
"key" : "cause",
"value" : "must not be null"
} ]
}
}, {
"message" : "Value null rejected due to must not be null",
"field" : "tactileVisualMarks",
"displayInfo" : {
"code" : "ERROR.CONSTRAINT",
"parameters" : [ {
"key" : "rejectedValue",
"value" : "null"
}, {
"key" : "cause",
"value" : "must not be null"
} ]
}
} ]
}
Update Relation when id not exists- Unsuccessfully
PUT /v1/relations/12345678
Path Variables
Path Variable | Type | Optional | Description |
---|---|---|---|
id |
Integer |
false |
Request Body Fields
Path | Type | Optional | Description |
---|---|---|---|
parentServicePointSloid |
String |
true |
Parent Service Point Sloid: Unique code for locations that is used in customer information. The structure is described in the “Swiss Location ID” specification, chapter 4.2. The document is available here: transportdatamanagement.ch/standards/ Example value: ch:1:sloid:18771 Length must be between 1 and 500 |
referencePointSloid |
String |
true |
Reference Point Sloid: Unique code for locations that is used in customer information. The structure is described in the “Swiss Location ID” specification, chapter 4.2. The document is available here: transportdatamanagement.ch/standards/ Example value: ch:1:sloid:18771 Length must be between 1 and 500 |
elementSloid |
String |
true |
Element Sloid: Unique code for locations that is used in customer information. The structure is described in the “Swiss Location ID” specification, chapter 4.2. The document is available here: transportdatamanagement.ch/standards/ Example value: ch:1:sloid:18771 Length must be between 1 and 500 |
tactileVisualMarks |
String |
false |
Must be one of ["TO_BE_COMPLETED","YES","NO","NOT_APPLICABLE","PARTIALLY","WITH_REMOTE_CONTROL"] |
contrastingAreas |
String |
false |
Must be one of ["TO_BE_COMPLETED","YES","NO","NOT_APPLICABLE","PARTIALLY"] |
stepFreeAccess |
String |
false |
Must be one of ["TO_BE_COMPLETED","YES","NO","NOT_APPLICABLE","YES_WITH_LIFT","YES_WITH_RAMP"] |
referencePointElementType |
String |
true |
Must be one of ["PLATFORM","CONTACT_POINT","TOILET","PARKING_LOT"] |
id |
Integer |
true |
This ID helps identify versions of a prm object 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 prm object. To do this, use the sloid or parentServicePointSloid in combination with the data range (valid from/valid until). Example value: 1 |
validFrom |
String |
false |
Valid from |
validTo |
String |
false |
Valid to |
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/relations/12345678' -i -X PUT \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"creationDate" : "2025-06-06T09:33:51.798648",
"creator" : "e123456",
"editionDate" : "2025-06-06T09:33:51.798675",
"editor" : "e123456",
"status" : null,
"id" : null,
"validFrom" : "2001-01-01",
"validTo" : "2001-12-31",
"etagVersion" : 0,
"parentServicePointSloid" : "ch:1:sloid:7000",
"referencePointSloid" : "ch:1:sloid:7000:1",
"elementSloid" : "ch:1:sloid:123456:1",
"tactileVisualMarks" : "YES",
"contrastingAreas" : "NO",
"stepFreeAccess" : "NO",
"referencePointElementType" : null
}'
Example response
HTTP/1.1 404 Not Found
Content-Type: application/json
Content-Length: 394
{
"status" : 404,
"message" : "Entity not found",
"error" : "Not found",
"details" : [ {
"message" : "Object with id 12345678 not found",
"field" : "id",
"displayInfo" : {
"code" : "ERROR.ENTITY_NOT_FOUND",
"parameters" : [ {
"key" : "field",
"value" : "id"
}, {
"key" : "value",
"value" : "12345678"
} ]
}
} ]
}
Get Relations with filter - Successfully
GET /v1/relations
Query Parameters
Parameter | Type | Optional | Description |
---|---|---|---|
referencePointElementTypes |
Array[String] |
true |
Must be one of ["PLATFORM","CONTACT_POINT","TOILET","PARKING_LOT"] |
referencePointSloids |
Array[String] |
true |
|
parentServicePointSloids |
Array[String] |
true |
|
servicePointNumbers |
Array[Integer] |
true |
|
sloids |
Array[String] |
true |
|
statusRestrictions |
Array[String] |
true |
Must be one of ["DRAFT","VALIDATED","IN_REVIEW","WITHDRAWN","REVOKED"] |
validOn |
String |
true |
|
fromDate |
String |
true |
|
toDate |
String |
true |
|
validToFromDate |
String |
true |
|
createdAfter |
String |
true |
|
modifiedAfter |
String |
true |
|
page |
Integer |
true |
|
size |
Integer |
true |
|
sort |
Array[String] |
true |
Example request
$ curl 'http://localhost:8080/v1/relations?servicePointNumbers=1234567&referencePointsloids=ch:1:sloid:7000:1&statusRestrictions=VALIDATED&sloids=ch:1:sloid:7000:11&fromDate=2000-01-01&toDate=2000-12-31&validOn=2000-06-28&createdAfter=2025-06-06%2009:33:50&modifiedAfter=2025-06-06%2009:33:51' -i -X GET
Example response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 745
{
"objects" : [ {
"creationDate" : "2025-06-06T09:33:51.465906",
"creator" : "e123456",
"editionDate" : "2025-06-06T09:33:51.465936",
"editor" : "e123456",
"status" : "VALIDATED",
"id" : 1010,
"validFrom" : "2000-01-01",
"validTo" : "2000-12-31",
"etagVersion" : 0,
"parentServicePointSloid" : "ch:1:sloid:7000",
"referencePointSloid" : "ch:1:sloid:7000:1",
"elementSloid" : "ch:1:sloid:7000:11",
"tactileVisualMarks" : "YES",
"contrastingAreas" : "YES",
"stepFreeAccess" : "NO",
"referencePointElementType" : "PLATFORM",
"number" : {
"number" : 1234567,
"uicCountryCode" : 12,
"numberShort" : 34567,
"checkDigit" : 8
}
} ],
"totalCount" : 1
}
Get Relations with filter without match - Successfully
GET /v1/relations
Query Parameters
Parameter | Type | Optional | Description |
---|---|---|---|
referencePointElementTypes |
Array[String] |
true |
Must be one of ["PLATFORM","CONTACT_POINT","TOILET","PARKING_LOT"] |
referencePointSloids |
Array[String] |
true |
|
parentServicePointSloids |
Array[String] |
true |
|
servicePointNumbers |
Array[Integer] |
true |
|
sloids |
Array[String] |
true |
|
statusRestrictions |
Array[String] |
true |
Must be one of ["DRAFT","VALIDATED","IN_REVIEW","WITHDRAWN","REVOKED"] |
validOn |
String |
true |
|
fromDate |
String |
true |
|
toDate |
String |
true |
|
validToFromDate |
String |
true |
|
createdAfter |
String |
true |
|
modifiedAfter |
String |
true |
|
page |
Integer |
true |
|
size |
Integer |
true |
|
sort |
Array[String] |
true |
Example request
$ curl 'http://localhost:8080/v1/relations?servicePointNumbers=1000000' -i -X GET
Example response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 41
{
"objects" : [ ],
"totalCount" : 0
}
Get Relations with filter array filter - Successfully
GET /v1/relations
Query Parameters
Parameter | Type | Optional | Description |
---|---|---|---|
referencePointElementTypes |
Array[String] |
true |
Must be one of ["PLATFORM","CONTACT_POINT","TOILET","PARKING_LOT"] |
referencePointSloids |
Array[String] |
true |
|
parentServicePointSloids |
Array[String] |
true |
|
servicePointNumbers |
Array[Integer] |
true |
|
sloids |
Array[String] |
true |
|
statusRestrictions |
Array[String] |
true |
Must be one of ["DRAFT","VALIDATED","IN_REVIEW","WITHDRAWN","REVOKED"] |
validOn |
String |
true |
|
fromDate |
String |
true |
|
toDate |
String |
true |
|
validToFromDate |
String |
true |
|
createdAfter |
String |
true |
|
modifiedAfter |
String |
true |
|
page |
Integer |
true |
|
size |
Integer |
true |
|
sort |
Array[String] |
true |
Example request
$ curl 'http://localhost:8080/v1/relations?servicePointNumbers=1234567&servicePointNumbers=1000000&referencePointSloid=ch:1:sloid:7000:1&sloids=ch:1:sloid:54321&sloids=ch:1:sloid:7000:11&ch:1:sloid:7000:111&fromDate=2000-01-01&toDate=2000-12-31&validOn=2000-06-28&createdAfter=2025-06-06%2009:33:50&modifiedAfter=2025-06-06%2009:33:51' -i -X GET
Example response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 745
{
"objects" : [ {
"creationDate" : "2025-06-06T09:33:51.578932",
"creator" : "e123456",
"editionDate" : "2025-06-06T09:33:51.578956",
"editor" : "e123456",
"status" : "VALIDATED",
"id" : 1011,
"validFrom" : "2000-01-01",
"validTo" : "2000-12-31",
"etagVersion" : 0,
"parentServicePointSloid" : "ch:1:sloid:7000",
"referencePointSloid" : "ch:1:sloid:7000:1",
"elementSloid" : "ch:1:sloid:7000:11",
"tactileVisualMarks" : "YES",
"contrastingAreas" : "YES",
"stepFreeAccess" : "NO",
"referencePointElementType" : "PLATFORM",
"number" : {
"number" : 1234567,
"uicCountryCode" : 12,
"numberShort" : 34567,
"checkDigit" : 8
}
} ],
"totalCount" : 1
}
Get Relations with ReferenceElementType filter - Successfully
GET /v1/relations
Query Parameters
Parameter | Type | Optional | Description |
---|---|---|---|
referencePointElementTypes |
Array[String] |
true |
Must be one of ["PLATFORM","CONTACT_POINT","TOILET","PARKING_LOT"] |
referencePointSloids |
Array[String] |
true |
|
parentServicePointSloids |
Array[String] |
true |
|
servicePointNumbers |
Array[Integer] |
true |
|
sloids |
Array[String] |
true |
|
statusRestrictions |
Array[String] |
true |
Must be one of ["DRAFT","VALIDATED","IN_REVIEW","WITHDRAWN","REVOKED"] |
validOn |
String |
true |
|
fromDate |
String |
true |
|
toDate |
String |
true |
|
validToFromDate |
String |
true |
|
createdAfter |
String |
true |
|
modifiedAfter |
String |
true |
|
page |
Integer |
true |
|
size |
Integer |
true |
|
sort |
Array[String] |
true |
Example request
$ curl 'http://localhost:8080/v1/relations?referencePointElementTypes=TOILET' -i -X GET
Example response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 743
{
"objects" : [ {
"creationDate" : "2025-06-06T09:33:51.282518",
"creator" : "e123456",
"editionDate" : "2025-06-06T09:33:51.282547",
"editor" : "e123456",
"status" : "VALIDATED",
"id" : 1008,
"validFrom" : "2000-01-01",
"validTo" : "2000-12-31",
"etagVersion" : 0,
"parentServicePointSloid" : "ch:1:sloid:7000",
"referencePointSloid" : "ch:1:sloid:7000:1",
"elementSloid" : "ch:1:sloid:7000:11",
"tactileVisualMarks" : "YES",
"contrastingAreas" : "YES",
"stepFreeAccess" : "NO",
"referencePointElementType" : "TOILET",
"number" : {
"number" : 1234567,
"uicCountryCode" : 12,
"numberShort" : 34567,
"checkDigit" : 8
}
} ],
"totalCount" : 1
}