Skip to content

ors.messages

System messages that can be sent with API responses following simple rules.

The ors.messages block expects a list of elements, each of which having the following:

keytypedescriptionexample value
activebooleanEnables or disables this messagetrue
textstringThe message textThe message text
conditionlistoptional; may contain any of the conditions from the table below

condition

Properties beneath ors.messages.condition:

keyvaluedescription
time_beforeISO 8601 datetime stringmessage sent if server local time is before given point in time
time_afterISO 8601 datetime stringmessage sent if server local time is after given point in time
api_version1 or 2message sent if API version requested through matches value
api_formatString with output formats ("json", "geojson", "gpx"), comma separatedmessage sent if requested output format matches value
request_serviceString with service names ("routing", "matrix", "isochrones", "snap"), comma separatedmessage sent if requested service matches one of the given names
request_profileString with profile names, comma separatedmessage sent if requested profile matches one of the given names
request_preferenceString with preference (weightings for routing, metrics for matrix, rangetype for isochrones) names, comma separatedmessage sent if requested preference matches one of the given names

If multiple conditions are given, all must be fulfilled to trigger the sending of the corresponding message.

Example:

messages:
  - active: true
    text: This message would be sent with every routing bike fastest request
    condition:
      - request_service: routing
      - request_profile: cycling-regular,cycling-mountain,cycling-road,cycling-electric
      - request_preference: fastest
  - active: true
    text: This message would be sent with every request for geojson response
    condition:
      - api_format: geojson
  - active: true
    text: This message would be sent with every request on API v1 from January 2020 until June 2050
    condition:
      - api_version: 1
      - time_after: 2020-01-01T00:00:00Z
      - time_before: 2050-06-01T00:00:00Z
  - active: true
    text: This message would be sent with every request