Core - Movement Authorities
Module dedicated to movement authorities.
The base url for the APIs in this page is at:
/api/admin
A JSON file with OpenAPI data about all core-related admin APIs can be downloaded here
.
Get movement authority
Gets data about a specific movement authority:
- GET /v1/movement-authorities/{guid}
Gets data about a specific movement authority
- Parameters
guid (string) – The guid of the movement authority
- Status Codes
200 OK – Success
Returns a Json positive response and the data of the movement authority corresponding to the ID provided in the request:
{
"ID": 1234, // Int
"CreatedDate": "2001-01-01T01:01:01Z", // DateTime
"StartTime": "2001-01-01T01:01:01Z", // DateTime
"EndTime": "2001-01-01T01:01:01Z", // DateTime
"Username": "UserName", // String
"UserEmail": "user@email.com", // String
"EndLocationName": "Poole", // String
"EndLocationAddress": "134 High St, Poole BH15 1DN", // String
"StartLocationName": "London", // String
"StartLocationAddress": "Golden Lane Estate, London EC1Y 0RJ", // String
"StartLocationLatitude": 51.508742, // Double (nullable)
"StartLocationLongitude": -0.115986, // Double (nullable)
"EndLocationLatitude": 50.713852, // Double (nullable)
"EndLocationLongitude": -1.983430, // Double (nullable)
"OriginatorKey": "c8f0ff575299ba1a7cd414f46b882e4a20b13b7eb45ba...", // String
"OriginatorModule": "53155c4a-b2a0-412f-ab41-552d9ccdf783", // Guid
"Guid": "53155c4a-b2a0-412f-ab41-552d9ccdf784", // Guid
"IsConfirmed": true, // Boolean
"IsReadyToStart": true, // Boolean
"MinValidStartTime": "2001-01-01T01:01:01Z", // DateTime
"MaxValidEndTime": "2001-01-01T01:01:01Z", // DateTime
"EquipmentReference": "Vehicle Plate;Vehicle Sticker;Vehicle VIN", // String
"ServiceReference": "", // String
"MaxValidStartTime": "2001-01-01T01:01:01Z", // DateTime
"ActualTripCount": 5, // Int
"MaxTripCount": 30, // Int
"IsDeletable": true, // Boolean
"DeletionDate": "2001-01-01T01:01:01Z", // DateTime (nullable)
"TransportationRequest":
{
"CreatedDate": "2020-09-03T13:54:29Z", // DateTime
"LastUpdated": "2020-09-03T13:55:09Z", // DateTime
"StartLocationQuery": "Treviso", // String
"EndLocationQuery": "Treviso", // String
"StartTime": "2020-09-03T13:58:00Z", // DateTime
"EndTime": "2020-09-03T14:03:00Z", // DateTime (nullable)
"Guid": "9373cad4-59aa-417b-8342-b31dba928665", // Guid
"User":
{
"UserName": "jerry.lewis@gmail.com", // String
"CreatedDate": "2020-02-07T19:48:43Z", // DateTime
"Guid": "908d4483-e6fd-4315-9954-751e5ecb8e35", // Guid
"LastLogonTimestamp": "2020-09-03T13:49:44Z", // DateTime (nullable)
"LCID": 1040, // Int
"Language": "it-IT", // String
"IsConfirmed": true, // Boolean
"IsDisabled": false, // Boolean
"ManualApprovalDate": null, // DateTime (nullable)
"Email": "jerry.lewis@gmail.com", // String
"FullName": "Giovanni Trezzi", // String
"MobilePhoneNumber": null, // String
"DeletionDate": null, // DateTime (nullable)
"ID": 2101 // Int
},
"DeletionDate": null, // dateTime (nullable)
"ID": 1829 // Int
},
}
Get reservations
Gets the list of confirmed movement authorities between two time points (it’s a Paged List APIs, as explained in the introduction):
- GET /v1/movement-authorities/reservations/list
Gets the list of confirmed movement authorities between two time points
- Query Parameters
from (string) – The starting time point
to (string) – The ending time point
- Status Codes
200 OK – Success
These parameters can be passed as URL query params:
from: (DateTime i.e. “05/01/2009 14:57:00”) to: (DateTime i.e. “05/01/2009”)
They are not required: if only one is sent the reservations will be filtered only by one end (from/to), if neither of them is sent the full list of reservation is returned
Returns a list of the all reservation between the specified interval of time, or all reservations if no time interval is provided. It is also possible to pass just one of the two parameters (it’s a Paged List APIs, as explained in the introduction):
[
{
"CreatedDate": "2019-05-29T09:08:06Z", // DateTime
"StartTime": "2019-05-30T09:07:00Z", // DateTime
"EndTime": "2019-05-31T10:07:00Z", // DateTime
"Username": "donalduk@mail.com", // String
"UserEmail": "donalduk@mail.com", // String
"EndLocationName": "London Heathrow Airport", // String
"EndLocationAddress": "Canberra", // String
"StartLocationName": "London Gatwick Airport", // String
"StartLocationAddress": "Perimeter", // String
"StartLocationLatitude": 51.153, // Double (nullable)
"StartLocationLongitude": -0.19, // Double (nullable)
"EndLocationLatitude": 51.47, // Double (nullable)
"EndLocationLongitude": -0.45, // Double (nullable)
"OriginatorKey": "c8f0ff575299ba1a7cd414f46b882e4a20...", // String
"OriginatorModule": "32b297a5-8180-420f-9482-84bfc7f55efe", // Guid
"Guid": "fc12897d-7e9d-4704-a352-fb448dcbef4d", // Guid
"IsConfirmed": true, // Boolean
"IsReadyToStart": false, // Boolean
"TransportationRequest":
{
"CreatedDate": "2019-05-29T09:08:06Z", // DateTime
"LastUpdated": "2019-05-30T08:40:10Z", // DateTime
"StartLocationQuery": "London", // String
"EndLocationQuery": "London", // String
"StartTime": "2019-05-30T09:07:00Z", // DateTime
"EndTime": "2019-05-31T10:07:00Z", // DateTime (nullable)
"Guid": "5df1441c-a151-4142-937d-14fead492ae2", // Guid
"User":
{
"UserName": "donalduk@mail.com", // String
"CreatedDate": "2019-05-28T11:41:25Z", // DateTime
"Guid": "6799f6ac-637a-4c0e-83f0-8f15108d87ee", // Guid
"LastLogonTimestamp": "2020-02-13T14:24:08Z", // DateTime (nullable)
"LCID": 0, // Int
"Language": "en-US", // String
"IsConfirmed": true, // Boolean
"IsDisabled": false, // Boolean
"ManualApprovalDate": null, // DateTime (nullable)
"Email": "donalduk@mail.com", // String
"FullName": "Aaron Bon", // String
"MobilePhoneNumber": null, // String
"DeletionDate": null, // DateTime (nullable)
"ID": 303 // Int
},
"DeletionDate": null, // DateTime (nullable)
"ID": 5 // Int
},
"MinValidStartTime": "2019-05-30T08:37:00Z", // DateTime
"MaxValidEndTime": "2019-05-31T10:37:00Z", // DateTime
"EquipmentReference": null, // String
"ServiceReference": null, // String
"MaxValidStartTime": "2019-05-30T09:22:00Z", // DateTime
"ActualTripCount": 0, // Int
"MaxTripCount": 1, // Int
"IsDeletable": true, // Boolean
"DeletionDate": "2019-05-29T13:20:26Z", // DateTime (nullable)
"ID": 17 // Int
},
...
]
Get movement authorities by transportation request
Gets the list of movement authorities for the specified transportation request:
- GET /v1/movement-authorities/list-by-tr/{tr}
Gets the list of movement authorities for the specified transportation request
- Parameters
tr (string) – The guid of the transportation requests
- Status Codes
200 OK – Success
Returns a Json positive response with the list of movement authorities for the requested transportation request (the passed parameter must be a Guid):
[
{
"CreatedDate": "2019-05-29T09:08:06Z", // DateTime
"StartTime": "2019-05-30T09:07:00Z", // DateTime
"EndTime": "2019-05-31T10:07:00Z", // DateTime
"Username": "donalduk@mail.com", // String
"UserEmail": "donalduk@mail.com", // String
"EndLocationName": "London Heathrow Airport", // String
"EndLocationAddress": "Canberra", // String
"StartLocationName": "London Gatwick Airport", // String
"StartLocationAddress": "Perimeter", // String
"StartLocationLatitude": 51.153, // Double (nullable)
"StartLocationLongitude": -0.19, // Double (nullable)
"EndLocationLatitude": 51.47, // Double (nullable)
"EndLocationLongitude": -0.45, // Double (nullable)
"OriginatorKey": "c8f0ff575299ba1a7cd414f46b882e4a20...", // String
"OriginatorModule": "32b297a5-8180-420f-9482-84bfc7f55efe", // Guid
"Guid": "fc12897d-7e9d-4704-a352-fb448dcbef4d", // Guid
"IsConfirmed": true, // Boolean
"IsReadyToStart": false, // Boolean
"MinValidStartTime": "2019-05-30T08:37:00Z", // DateTime
"MaxValidEndTime": "2019-05-31T10:37:00Z", // DateTime
"EquipmentReference": null, // String
"ServiceReference": null, // String
"MaxValidStartTime": "2019-05-30T09:22:00Z", // DateTime
"ActualTripCount": 0, // Int
"MaxTripCount": 1, // Int
"IsDeletable": true, // Boolean
"DeletionDate": "2019-05-29T13:20:26Z", // DateTime (nullable)
"ID": 17 // Int
},
...
]
Get reservations opened by the user
Gets the list of confirmed reservation for a specified user, that are not revoked and yet to start/end:
- GET /v1/movement-authorities/open-authorities/{user}
Gets the list of valid reservations for a specified user
- Parameters
user (string) – The id of the user
- Status Codes
200 OK – Success
Returns a Json positive response and the list of reservations (the parameter must be a Guid):
[
{
"CreatedDate": "2019-05-29T09:08:06Z", // DateTime
"StartTime": "2019-05-30T09:07:00Z", // DateTime
"EndTime": "2019-05-31T10:07:00Z", // DateTime
"Username": "donalduk@mail.com", // String
"UserEmail": "donalduk@mail.com", // String
"EndLocationName": "London Heathrow Airport", // String
"EndLocationAddress": "Canberra", // String
"StartLocationName": "London Gatwick Airport", // String
"StartLocationAddress": "Perimeter", // String
"StartLocationLatitude": 51.153, // Double (nullable)
"StartLocationLongitude": -0.19, // Double (nullable)
"EndLocationLatitude": 51.47, // Double (nullable)
"EndLocationLongitude": -0.45, // Double (nullable)
"OriginatorKey": "c8f0ff575299ba1a7cd414f46b882e4a20...", // String
"OriginatorModule": "32b297a5-8180-420f-9482-84bfc7f55efe", // Guid
"Guid": "fc12897d-7e9d-4704-a352-fb448dcbef4d", // Guid
"IsConfirmed": true, // Boolean
"IsReadyToStart": false, // Boolean
"TransportationRequest":
{
"CreatedDate": "2019-05-29T09:08:06Z", // DateTime
"LastUpdated": "2019-05-30T08:40:10Z", // DateTime
"StartLocationQuery": "London", // String
"EndLocationQuery": "London", // String
"StartTime": "2019-05-30T09:07:00Z", // DateTime
"EndTime": "2019-05-31T10:07:00Z", // DateTime (nullable)
"Guid": "5df1441c-a151-4142-937d-14fead492ae2", // Guid
"User":
{
"UserName": "donalduk@mail.com", // String
"CreatedDate": "2019-05-28T11:41:25Z", // DateTime
"Guid": "6799f6ac-637a-4c0e-83f0-8f15108d87ee", // Guid
"LastLogonTimestamp": "2020-02-13T14:24:08Z", // DateTime (nullable)
"LCID": 0, // Int
"Language": "en-US", // String
"IsConfirmed": true, // Boolean
"IsDisabled": false, // Boolean
"ManualApprovalDate": null, // DateTime (nullable)
"Email": "donalduk@mail.com", // String
"FullName": "Aaron Bon", // String
"MobilePhoneNumber": null, // String
"DeletionDate": null, // DateTime (nullable)
"ID": 303 // Int
},
"DeletionDate": null, // DateTime (nullable)
"ID": 5 // Int
},
"MinValidStartTime": "2019-05-30T08:37:00Z", // DateTime
"MaxValidEndTime": "2019-05-31T10:37:00Z", // DateTime
"EquipmentReference": null, // String
"ServiceReference": null, // String
"MaxValidStartTime": "2019-05-30T09:22:00Z", // DateTime
"ActualTripCount": 0, // Int
"MaxTripCount": 1, // Int
"IsDeletable": true, // Boolean
"ID": 17 // Int
},
...
]
Get active reservation count
Gets the number of confirmed reservations that are not revoked and not yet ended:
- GET /v1/movement-authorities/count-active
Gets the count of active reservations for all users
- Status Codes
200 OK – Success
Returns a Json positive response and the count of reservations:
{
123 // Int
}
Confirm movement authority
Confirms a specified movement authority:
- POST /v1/movement-authorities/confirm/{ma}
Confirms a specified movement authority
- Parameters
ma (string) – The guid of the movement authority to confirm
- Status Codes
200 OK – Success
The API returns a Json positive response and the passed parameter if the request was successful (the passed parameter must be a Guid):
{
"53155c4a-b2a0-412f-ab41-552d9ccdf784" // Guid
}
Possible error messages are:
err_ConfirmAuthority
The provided guid does not correspond to an existing movement authority
Revoke movement authority
Revokes a confirmed movement authority:
- POST /v1/movement-authorities/revoke/{ma}
Revokes a confirmed movement authority
- Parameters
ma (string) – The guid of the movement authority to revoke
- Status Codes
200 OK – Success
Returns a Json positive response if the request was successful (the parameter must be a Guid).
Possible error messages are:
err_RevokeAuthority
The provided guid does not correspond to an existing confirmed movement authority
err_CannotRevoke
The requested was either already revoked, expired or with an opened trip
Delete movement authority
Marks a movement authority as revoked:
- DELETE /v1/movement-authorities/{id}
Marks a movement authority as deleted
- Parameters
id (integer) – The id of the movement authority
- Status Codes
200 OK – Success
The request returns a plain Json positive response if the record was successfully deleted.
Possible error messages are:
err_ElementDoesNotExist
No movement authority corresponding to the ID provided in the request
err_ElementAlreadyDeleted
The ID provided in the request corresponds to an already deleted record
err_CannotDelete
The movement authority cannot be deleted
Get trips by movement authority
Gets the list of trips started by a specified movement authority (it’s a Paged List APIs, as explained in the introduction):
- GET /v1/movement-authorities/{id}/trips
Gets the list of trips started by a specified movement authority
- Parameters
id (integer) – The id of the movement authority
- Status Codes
200 OK – Success
Returns the list of trips:
[
{
"ID": 522, // Int
"StartTimestamp": "2020-09-02T15:55:11Z", // DateTime
"CreatedDate": "2020-09-02T15:54:09Z", // DateTime
"Guid": "75ddfa8a-ce6d-4db4-80cc-b75ee3f736e5", // Guid
"IsCompleted": true, // Boolean
"IsBillable": false, // Boolean
"BillableReason": null, // String (nullable)
"StartLocationName": "Treviso", // String
"EndLocationName": "Treviso", // String
"StartLocationLatitude": 45.669532661484325, // Double (nullable)
"StartLocationLongitude": 12.161521911621096, // Double (nullable)
"EndLocationLatitude": 45.669532661484325, // Double (nullable)
"EndLocationLongitude": 12.161521911621096, // Double (nullable)
"EndTimestamp": "2020-09-02T16:01:48Z", // DateTime (nullable)
"ActualMileageKm": 0, // Int
"ActualDurationSeconds": 397, // Int
"EquipmentReference": "Vehicle Plate;Vehicle Sticker;Vehicle VIN", // String
"ServiceReference": null, // String (nullable)
"Duration": 397, // Int
"Status": 4, // Int (enum TripStatus)
"DeletionDate": null, // DateTime (nullable)
},
...
]
The value of the Status
property can be one of the TripStatus enumeration.
The BillableReason
property may be valorized only if IsBillable
is set to true.
Get movement details by movement authority
Gets the list of movement details for a specified movement authority (it’s a Paged List APIs, as explained in the introduction):
- GET /v1/movement-authorities/{id}/movement-details
Gets the list of movement details for a specified movement authority
- Parameters
id (integer) – The id of the movement authority
- Status Codes
200 OK – Success
Returns a list of the movement details for the requested movement authority:
[
{
"OriginatorKey": "ma-vehicle-device-secret-0", // String
"CreatedDate": "2020-09-02T15:53:46Z", // DateTime
"Labels": "{\"en\":\"Manufacturer:\",\"it\":\"Produttore:\",...}", // String
"ValueLabels": "{\"en\":\"English text\",\"it\":\"Testo in italiano\",...}", // String
"Value": "Toyota", // String
"ValueType": 2, // Int (enum AdditionalValueType)
"DeletionDate": null, // DateTime (nullable)
"ID": 24392 // Int
}
...
]
The value of the OriginatorKey
property can be one of the value described in Movement Authorities.
The value of the ValueType
property can be one of the AdditionalValueTypes enumeration.
The fields Labels
and ValueLabels
contain a stringified Json containing pairs “language code”:”localized value”
The type of the contents of the Value
field depends on the value specified in ValueType
field
Gets approaching reservations without vehicle
Gets the list of reservations starting within a given time frame (defined by the configuration variable
MA_CONFIRM_ADVANCE_MINUTES
) and without an assigned vehicle:
- GET /v1/movement-authorities/approaching-without-vehicle
Gets the list of reservations approaching without an assigned vehicle
- Status Codes
200 OK – Success
Returns a Json positive response and a list of the reservations:
[
{
"CreatedDate": "2019-05-29T09:08:06Z", // DateTime
"StartTime": "2019-05-30T09:07:00Z", // DateTime
"EndTime": "2019-05-31T10:07:00Z", // DateTime
"Username": "donalduk@mail.com", // String
"UserEmail": "donalduk@mail.com", // String
"EndLocationName": "London Heathrow Airport", // String
"EndLocationAddress": "Canberra", // String
"StartLocationName": "London Gatwick Airport", // String
"StartLocationAddress": "Perimeter", // String
"StartLocationLatitude": 51.153, // Double (nullable)
"StartLocationLongitude": -0.19, // Double (nullable)
"EndLocationLatitude": 51.47, // Double (nullable)
"EndLocationLongitude": -0.45, // Double (nullable)
"OriginatorKey": "c8f0ff575299ba1a7cd414f46b882e4a20...", // String
"OriginatorModule": "32b297a5-8180-420f-9482-84bfc7f55efe", // Guid
"Guid": "fc12897d-7e9d-4704-a352-fb448dcbef4d", // Guid
"IsConfirmed": true, // Boolean
"IsReadyToStart": false, // Boolean
"MinValidStartTime": "2019-05-30T08:37:00Z", // DateTime
"MaxValidEndTime": "2019-05-31T10:37:00Z", // DateTime
"EquipmentReference": null, // String, always null
"ServiceReference": null, // String (nullable)
"MaxValidStartTime": "2019-05-30T09:22:00Z", // DateTime
"ActualTripCount": 0, // Int
"MaxTripCount": 1, // Int
"IsDeletable": true, // Boolean
"ID": 17 // Int
},
...
]
Get list of news
Gets the list of news regarding attention reason for reservations:
- GET /v1/movement-authorities/attention-reason-news
Gets the list of news regarding attention reason for reservations
- Status Codes
200 OK – Success
Returns a Json positive response and a list of news:
{
[ Guid array ] // Guid Array
}
Returns a plain Json negative response if the request is not successful.