Vehicle - Communities

This module is dedicated to the management of the entities related to the communities

The base url for the APIs in this page is at:

/api/vehicle-admin

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

Get Tree of communities

Gets the tree of communities:

GET /v1/communities/tree

Gets the tree of communities

Status Codes

The request will return a positive Json response and the tree of communities as per the following example:

[
  {
    "ID": 3,                                              // Int
    "Guid": "33836bc0-3f66-43d8-9ff9-c04da29d414c",       // Guid
    "Name": "Community master",                           // String
    "Level": 0,                                           // Int
    "Parent": null,                                       // Guid (nullable)
    "Children":                                           // Object Array (nullable)
    [
      {
        "ID": 4,                                          // Int
        "Guid": "1d25c557-23f4-4e2e-b61e-f3a14f553e9b",   // Guid
        "Name": "Subcommunity",                           // String
        "Level": 1,                                       // Int
        "Parent": "33836bc0-3f66-43d8-9ff9-c04da29d414c", // Guid
        "Children": []                                    // Object Array
      },
      ...
    ]
  },
  ...
]

Get list of community vehicle groups

Gets the list of vehicle groups linked to a specific community (it’s a Paged List APIs, as explained in the introduction):

GET /v1/communities/{guid}/groups

Gets the list of vehicle groups linked to a community

Parameters
  • guid (string) – The guid of the community

Status Codes
guid: Community Guid (Guid)

The request will return list of the groups (only the records contained in the current page) as per the following example:

[
  {
    Guid: "ef5bcca7-fd6b-4f53-8176-b10f4b6a1083",     // Guid
    CreatedDate: "2001-01-01T01:01:01Z",              // DateTime
    LastUpdated: "2001-01-01T01:01:01Z",              // DateTime
    Name: "Name of the group",                        // String
    Description: "Descripion of the group",           // Description
    VehicleCount: 10                                  // Int (Number of vehicles belonging to the vehicle group)
  },
  ...
]

Get list of community group IDs

Gets the list of ID of the groups linked to specific community:

GET /v1/communities/{guid}/groups-id

Gets the list of group IDs linked to a specific community

Parameters
  • guid (string) – The id of the community

Status Codes
guid: Community Guid (Guid)

The request will return a positive Json response and a list of the groups ID filtered by the community provided:

{
  [ID1, ID2, ID3, ...]                // Int Array
}

Set vehicle groups

Persists the list of the vehicle groups linked to a specific community:

POST /v1/communities/groups

Persists the list of vehicle groups linked to a specific community

Status Codes

The request requires the guid of the specific community:

{
  Guid: "0a8d6e54-3282-45e2-8df8-3f138b16f587",  // Guid of the community
  Groups: [1, 2, 3, ...]                         // Array of group IDs
}

If the request is successful, a positive Json response will be returned.

The following errors will be returned:

err_InvalidElement

No community has been found for the specified guid

Get list of community vehicle zones

Gets the list of zones linked to a specific community (it’s a Paged List APIs, as explained in the introduction):

GET /v1/communities/{guid}/zones

Gets the list of zones linked to a community

Parameters
  • guid (string) – The guid of the community

Status Codes
guid: Community Guid (Guid)

The request will return list of the zones (only the records contained in the current page) as per the following example:

[
  {
    ID: 1,
    CreatedDate: "2019-05-28T11:40:28Z",                  // DateTime
    LastUpdated: "2020-01-17T08:48:56Z",                  // DateTime
    Guid: "ed32e44f-80d3-4746-bf46-5bf178750486",         // Guid
    Name: "London Heathrow Airport",                      // String
    MainEntranceAddress: "Canberra Rd",                   // String (nullable)
    MainEntranceCity: "Longford, Hounslow, UK",           // String (nullable)
    MainEntranceLatitude: 51.471158, (nullable)           // Double (nullable)
    MainEntranceLongitude: -0.456838, (nullable)          // Double (nullable)
    CentroidLatitude: 51.471305940640484, (nullable)      // Double (nullable)
    CentroidLongitude: -0.4564368748722245, (nullable)    // Double (nullable)
    Geometry: "tN8E3Td2/ChIJJaJEenW8SUARsL4/kYLxJQBE...", // ByteArray (as String)
    MainEntranceOpeningHours: "08:30 - 19:00",            // String (nullable)
    MainEntranceTermsConditions: "Terms and conditions",  // String (nullable)
    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.47027674914711,                    // Double
          Longitude: -0.4572844680571065                  // Double
        },
        ...
      ]
    },
    UtcOffsetMinutes: 60,                                 // Int
    CommunityCount: 1                                     // Int (How many communities is the zone linked to)
  }
]

Get list of community zone IDs

Gets the list of ID of the zones linked to specific community:

GET /v1/communities/{guid}/zones-id

Gets the list of zone IDs linked to a specific community

Parameters
  • guid (string) – The id of the community

Status Codes
guid: Community Guid (Guid)

The request will return a positive Json response and a list of the groups ID filtered by the community provided:

{
  [ID1, ID2, ID3, ...]        // Int Array
}

Set zones

Persists the list of the vehicle zones linked to a specific community:

POST /v1/communities/zones

Persists the list of zones linked to a specific community

Status Codes

The request requires the guid of the specific community:

{
  Guid: "0a8d6e54-3282-45e2-8df8-3f138b16f587", // Guid (Community guid)
  Zones: [1, 2, 3, ...]                         // Int Array (Array of zone IDs)
}

If the request is successful, a positive Json response will be returned.

The following errors will be returned:

err_InvalidElement

No community has been found for the specified guid