Vehicle - Points of Interest
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 Point of interest
Gets details about a specific POI:
- GET /v1/point-of-interest/{guid}
Gets details about a specific POI
- Parameters
guid (string) – The guid of the POI
- Status Codes
200 OK – Success
- DELETE /v1/point-of-interest/{guid}
Marks a POI as deleted
- Parameters
guid (string) – The guid of the POI
- Status Codes
200 OK – Success
Returns a Json positive responde and the details of the point of interest corresponding to the guid
provided in the request:
{
"CreatedDate": "2020-09-14T07:25:24Z", // DateTime
"LastUpdated": "2020-09-14T07:25:24Z", // DateTime
"Name": "AGIP", // String
"ExternalKey": null, // String (nullable)
"Description": "AGIP Udine", // String (nullable)
"Guid": "a6c1ef6e-58c4-4ef9-8592-c0e85f40fb13", // Guid
"Address": "Piazza Primo Maggio", // String (nullable)
"City": "Udine", // String (nullable
"ReceptionLatitude": 46.06545585848919, // Double (nullable)
"ReceptionLongitude": 13.236948251724245, // Double (nullable)
"CanRefuelElectricVehicles": false, // Boolean
"CanRefuelICEVehicles": true, // Boolean
"Type": 0, // Int (enum PointOfInterestType)
"ID": 1 // Int
}
Value of the Type
property can be one of the PointOfInterestType enumeration.
Get list of POIs
Gets a list of all points of interest:
Returns a list of all the points of interest:
[
{
"CreatedDate": "2020-09-14T07:25:24Z", // DateTime
"LastUpdated": "2020-09-14T07:25:24Z", // DateTime
"Name": "AGIP", // String
"ExternalKey": null, // String (nullable)
"Description": "AGIP Udine", // String (nullable)
"Guid": "a6c1ef6e-58c4-4ef9-8592-c0e85f40fb13", // Guid
"Address": "Piazza Primo Maggio", // String (nullable)
"City": "Udine", // String (nullable)
"ReceptionLatitude": 46.06545585848919, // Double (nullable)
"ReceptionLongitude": 13.236948251724245, // Double (nullable)
"CanRefuelElectricVehicles": false, // Boolean
"CanRefuelICEVehicles": true, // Boolean
"Type": 0, // Int (enum PointOfInterestType)
"ID": 1 // Int
},
...
]
Value of the Type
property can be one of the PointOfInterestType enumeration.
Get POIs in area
Gets a list of POIs in a rectangle:
The body of the request is:
{
NorthBound: 51.51141341100053, // Double (Required)
EastBound: -0.12835598354284275, // Double (Required)
SouthBound: 51.51141341100053, // Double (Required)
WestBound: -0.12835598354284275, // Double (Required)
}
All four points are required for the request to be valid.
If the request is successful, a Json positive response will be returned toeghether with the list of all the points of interest within the specified rectangle:
[
{
"CreatedDate": "2020-09-14T07:25:24Z", // DateTime
"LastUpdated": "2020-09-14T07:25:24Z", // DateTime
"Name": "AGIP", // String
"ExternalKey": null, // String (nullable)
"Description": "AGIP Udine", // String (nullable)
"Guid": "a6c1ef6e-58c4-4ef9-8592-c0e85f40fb13", // Guid
"Address": "Piazza Primo Maggio", // String (nullable)
"City": "Udine", // String (nullable)
"ReceptionLatitude": 46.06545585848919, // Double (nullable)
"ReceptionLongitude": 13.236948251724245, // Double (nullable)
"CanRefuelElectricVehicles": false, // Boolean
"CanRefuelICEVehicles": true, // Boolean
"Type": 0, // Int (enum PointOfInterestType)
"ID": 1 // Int
}
]
Value of the Type
property can be one of the PointOfInterestType enumeration.
If some of the bound point is not valorized or if there is a problem processing the request, a plain Json negative response will be returned.
Add new or edit POI
Persists edits about a new or existing POI:
- POST /v1/point-of-interest
Persists edits about a new or existing POI
- Status Codes
200 OK – Success
The body of the request is:
{
ID: 123, // Int
Name: "Garage", // String
ExternalKey: "...", // String (nullable)
Address: "address of the point of interest", // String (nullable)
City: "London", // String (nullable)
Description: "Description of the POI", // String (nullable)
ReceptionLatitude: 51.51141341100053, // Double (nullable)
ReceptionLongitude: -0.12835598354284275, // Double (nullable)
Type: 1, // Int
CanRefuelElectricVehicles: false, // Boolean
CanRefuelICEVehicles: false // Boolean
}
Value of the Type
property must be one of the PointOfInterestType enumeration.
If the POI is a Refuel area (Type
= 0), the values for CanRefuelElectricVehicles
and CanRefuelICEVehicles
should be provided. If not specified, their default value if false.
If ID
(point of interest ID) is not provided or set to 0, then the request will create a new record.
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 error messages are:
err_InvalidElement
No Point of Interest to edit was found for the provided
ID
, or the providedName
is not valorizederr_DuplicateElement
The request is trying to add a record with different ID, that was not marked as deleted and has same Type and Name as an existing one
Delete POI
Marks a point of interest as deleted:
- GET /v1/point-of-interest/{guid}
Gets details about a specific POI
- Parameters
guid (string) – The guid of the POI
- Status Codes
200 OK – Success
- DELETE /v1/point-of-interest/{guid}
Marks a POI as deleted
- Parameters
guid (string) – The guid of the POI
- Status Codes
200 OK – Success
If the request is successful the corresponding point of interest will be marked as deleted and a plain Json positive response will be returned, otherwise a plain Json negative response will be returned.
Possible error messages are:
err_ElementDoesNotExist
There is no record corresponding to the
guid
provided in the requesterr_ElementAlreadyDeleted
The corresponding record has already been marked as deleted