Vehicle - Movement Rules

Movement rules link a vehicle group to a list of zones, specifying if the vehicle belonging to the group are allowed or denied to park in said zones.

The Admin interface handles web service calls from the Admin web gui. The base url for this is at:

/api/vehicle-admin

A JSON file with OpenAPI data about all vehicle-related admin APIs can be downloaded here.

Get Movement rule

Gets details about a specific movement rule:

GET /v1/movement-rules/{id}

Gets details about a specific movement rule

Parameters
  • id (integer) – The id of the rule

Status Codes
DELETE /v1/movement-rules/{id}

Marks a movement rule as deleted

Parameters
  • id (integer) – The id of the rule

Status Codes
id: Rule ID (int)

Returns a Json positive response and the details of the specified movement rule:

{
  "ID": 1,                                                    // Int
  "Group":
  {
    "Name": "London",                                         // String
    "Description": "London zones",                            // String
    "Guid": "cd5619ac-b5bf-4ed7-95e4-e7c02029d6cd",           // Guid
    "Originator": "32b297a5-8180-420f-9482-84bfc7f55efe"      // Guid
  },                                                          //
  "Zones": [ 1, 2, 3... ],                                    // Int Array
  "ZoneNames": "London Heathrow Airport, London ...",         // String
  "Type": 0,                                                  // Int (enum RuleType)
  "DayOfWeekStart": null,                                     // Int (nullable)
  "DayOfWeekEnd": null,                                       // Int (nullable)
  "MinuteOfDayStart": null,                                   // Int (nullable)
  "MinuteOfDayEnd": null,                                     // Int (nullable)
  "DayOfMonthStart": null,                                    // Int (nullable)
  "DayOfMonthEnd": null,                                      // Int (nullable)
  "DayStart": null,                                           // DateTime (nullable)
  "DayEnd": null                                              // DateTime (nullable)
}

Value types of Type can only assume values of 0 (Allow) or 1 (Deny) as in the RuleType enumeration.

The properties Zones and ZoneNames are the list of IDs of the involved zones and a string comprised of their names divided by a comma, respectively.

Get movement rules list

Gets the list of movement rules (it’s a Paged List APIs, as explained in the introduction):

GET /v1/movement-rules/list

Gets the list of movement rules

Status Codes

Returns the list of movement rules:

[
  {
    "ID": 1,                                                    // Int
    "Group":                                                    // Group
    {
      "Name": "London",                                         // String
      "Description": "London zones",                            // String (nullable)
      "Guid": "cd5619ac-b5bf-4ed7-95e4-e7c02029d6cd",           // Guid
      "Originator": "32b297a5-8180-420f-9482-84bfc7f55efe"      // Guid
    },                                                          //
    "Zones": [ 1, 2, 3... ],                                    // Int Array
    "ZoneNames": "London Heathrow Airport, London ...",         // String
    "Type": 0,                                                  // Int
    "DayOfWeekStart": null,                                     // Int (nullable)
    "DayOfWeekEnd": null,                                       // Int (nullable)
    "MinuteOfDayStart": null,                                   // Int (nullable)
    "MinuteOfDayEnd": null,                                     // Int (nullable)
    "DayOfMonthStart": null,                                    // Int (nullable)
    "DayOfMonthEnd": null,                                      // Int (nullable)
    "DayStart": null,                                           // DateTime (nullable)
    "DayEnd": null                                              // DateTime (nullable)
  },
  ...
]

Value types of Type can only assume values of 0 (Allow) or 1 (Deny) as in the RuleType enumeration

The properties Zones and ZoneNames are the list of IDs of the involved zones and a string comprised of their names divided by a comma, respectively.

Add new or edit existing movement rule

Persists edits about a new or existing movement rule:

POST /v1/movement-rules

Persists edits about a new or existing movement rule

Status Codes

With a request body like this:

{
  ID: 123,                                            // Int
  Type: 0,                                            // Int
  MinuteOfDayStart:1,                                 // Int (nullable)
  MinuteOfDayEnd:59,                                  // Int (nullable)
  DayOfWeekStart: 1,                                  // Int (nullable)
  DayOfWeekEnd: 5,                                    // Int (nullable)
  DayOfMonthStart: 1,                                 // Int (nullable)
  DayOfMonthEnd: 30,                                  // Int (nullable)
  DayStart: 2020/01/01 00:00:00,                      // DateTime (nullable)
  DayEnd: 2020/01/01 00:00:00,                        // DateTime (nullable)
  GroupGuid: "53155c4a-b2a0-412f-ab41-552d9ccdf784",  // Guid (Required)
  Zones: [1,2,3...]                                   // Int Array
}

Value types of Type can only assume values of 0 (Allow) or 1 (Deny) as in the RuleType enumeration.

If ID (vehicle movement rule ID) is not provided or set to 0, then the request will create a new record.

If setting up Day, DaysOfWeek or DaysOfMonth rules, both start and end values must be provided. The start values must not be greater than values of the respective end fields.

Only one between Day, DaysOfWeek or DayOfMonth can be active at any time in one vehicle movement rule.

If the record has been successfully added or modified, the request will return a plain Json positive answer. Otherwise a plain Json negative response will be returned.

Possible errors are:

err_MinutesIncorrect

Only one of MinuteOfDayStart and MinuteOfDayEnd are valorised. If they are both null, no error is returned

err_StartEndOrder

Some of the start values (MinuteOfDayStart, DayStart, DayOfWeekStart, DayOfMonthStart) are greater than the respective end values (MinuteOfDayEnd, , DayEnd, DayOfWeekEnd, DayOfMonthEnd).

err_DaysOfWeekIncorrect

Only one field for DaysOfWeek was provided, both start and end are required when setting DaysOfWeek interval

err_DaysOfMonthIncorrect

Only one field for DaysOfMonth was provided, both start and end are required when setting DaysOfMonth interval

err_MultipleSelectionTypes

Two or more of DaysOfWeek, DaysOfMonth or Day values have been set, only one type can be set

err_NoGroup

No group is assigned to the movement rule

err_InvalidElement

The provided type field contains a non-accepted value, or no rule to edit has been found for the provided ID

err_CommunityIncompatibility

Both group and zone(s) are linked to a specific community, and they have no community in common

Delete movement rule

Marks a movement rule as deleted:

GET /v1/movement-rules/{id}

Gets details about a specific movement rule

Parameters
  • id (integer) – The id of the rule

Status Codes
DELETE /v1/movement-rules/{id}

Marks a movement rule as deleted

Parameters
  • id (integer) – The id of the rule

Status Codes
id: Rule ID (int)

If the request is successful, the movement rule will be marked as deleted and a plain Json positive response will be returned.

Possible error messages are:

err_ElementDoesNotExist

No movement rule corresponds to the ID provided in the request

err_ElementAlreadyDeleted

The specified movement rule has already been markes as deleted

Get movement rule zones

Gets the list of zones operated on by the rule (it’s a Paged List APIs, as explained in the introduction):

GET /v1/movement-rules/{id}/zones

Gets the list of zones operated on by the rule

Parameters
  • id (integer) – The id of the rule

Status Codes
id: Rule ID (int)

Returns a Json positive response and the list of all zones where the specified movement rules applies:

[
  {
    "ID": 1,                                           // Int
    "CreatedDate": "2020-09-09T11:45:15Z",             // DateTime
    "LastUpdated": "2020-09-09T11:45:15Z",             // DateTime
    "Guid": "6d705861-31e0-4b5f-aef4-135517b5c715",    // Guid
    "Name": "London Heathrow Airport",                 // String
    "MainEntranceAddress": "Canberra Rd",              // String
    "MainEntranceCity": "Longford, Hounslow, UK",      // String
    "MainEntranceLatitude": 51.471158,                 // Double
    "MainEntranceLongitude": -0.456838,                // Double
    "CentroidLatitude": 51.471158,                     // Double
    "CentroidLongitude": -0.45683800000000474,         // Double
    "Geometry": "ChIJ9fkoIy68SUAR...",                 // ByteArray as String
    "MainEntranceOpeningHours": null,                  // String
    "MainEntranceTermsConditions": null,               // String
    "IsPaidParking": true,                             // Boolean
    "CanRefuelElectricVehicles": true,                 // Boolean
    "CanRefuelICEVehicles": false,                     // Boolean
    "IsFreefloatingArea": false,                       // Boolean
    "IsRoundtripArea": false,                          // Boolean
    "IsAvailable": true,                               // Boolean
    "ParkingSpots": 0,                                 // Int
    "Type": 0,                                         // Int
    "Polygon":
    {
      "Points":
      [
        {
            "Latitude": 51.470158000000005,            // Double
            "Longitude": -0.457838                     // Double
        },                                             //
        ...
      ]
    },
    "UtcOffsetMinutes": 60,                            // Int
    "CommunityCount": 0                               // Int
  },
      ...
]

Value types of the property Type can be one of the ZoneType enumeration.

Returns a Json negative response with no data if there is no movement rule corresponding to the ID provided in the request, or if the specified movement rule is a type of rule that does not apply to zones.