Configuration API - motown-io/motown GitHub Wiki

Functional Overview

The charging station configuration API is a JSON REST API to the charging station configuration add-on. The details of the add-on and the proces of configuring a charging station can be found here.

This API can be used to create, get, update and delete configuration resources.

Versioning

API versioning is done using vendor media MIME types. These are used in the Accept (all HTTP methods) and Content-Type (POST and PUT only) HTTP headers.

The Configuration API version 1 MIME type is application/vnd.io.motown.charging-station-configuration-api-v1+json.

Paging

Some API's support paging. When calling an API that supports paging the following request parameters can be passed:

  • offset: the starting point for the return data. The lowest offset possible is 0
  • limit: the maximum number of elements that should be returned

If the parameters are not passed a default value will be used.

The requests samples will not show the request parameters for paging. Paged responses contain 'previous', 'next', 'first' and 'last' URL's to navigate through the set of resources.

Examples:

URL Explanation
/config/chargingstationtypes?offset=0&limit=10 returns the first 10 charging station types.
/config/chargingstationtypes?limit=10 same as previous.
/config/chargingstationtypes?offset=10&limit=10 returns charging station types 11 - 20.

Resources

ChargingStationType

The charging station type is the main resource in the configuration. It contains the following:

  • id of the configuration
  • a code
  • a reference to a manufacturer
  • a set of evses

The code and manufacturer are used to find the configuration for a charging station. The process of configuring a charging station is described here.

URL HTTP method Paging Description Links
/config/chargingstationtypes GET X List all charging station types with attached objects Sample
/config/chargingstationtypes POST Create charging station type Sample
/config/chargingstationtypes/{id} GET Get charging station type, with attached objects, by id Sample
/config/chargingstationtypes/{id} PUT Update charging station type by id Sample
/config/chargingstationtypes/{id} DELETE Delete charging station type by id Sample

Evse

The logical unit in a charging station that supplies electric energy via a connector for recharging. An evse can have one or multiple connectors.

URL HTTP method Paging Description Links
/config/chargingstationtypes/{id}/evses GET X Get all evses for a charging station type Sample
/config/chargingstationtypes/{id}/evses POST Create evse Sample
/config/chargingstationtypes/{id}/evses/{id} GET Get evse by id Sample
/config/chargingstationtypes/{id}/evses/{id} PUT Update evse by id Sample
/config/chargingstationtypes/{id}/evses/{id} DELETE Delete evse by id Sample

Connector

A connector is an independently operated and managed electrical outlet on an evse. This corresponds to a single physical outlet. The connector contains the properties of the physical outlet:

  • maximum amperage
  • phase
  • voltage
  • charging protocol
  • current
  • connector type
URL HTTP method Paging Description Links
/config/chargingstationtypes/{id}/evses/{id}/connectors GET X Get all connectors for a evse Sample
/config/chargingstationtypes/{id}/evses/{id}/connectors POST Create connector Sample
/config/chargingstationtypes/{id}/evses/{id}/connectors/{id} GET Get connector by id Sample
/config/chargingstationtypes/{id}/evses/{id}/connectors/{id} PUT Update connector by id Sample
/config/chargingstationtypes/{id}/evses/{id}/connectors/{id} DELETE Delete connector by id Sample

Manufacturer

The manufacturer of the charging station type.

URL HTTP method Paging Description Links
/config/manufacturers GET X List all manufacturers Sample
/config/manufacturers POST Create manufacturer Sample
/config/manufacturers/{id} GET Get manufacturer by id Sample
/config/manufacturers/{id} PUT Update manufacturer by id Sample
/config/manufacturers/{id} DELETE Delete manufacturer id Sample

Examples

List all charging station types

Request

Empty

Response

{
    "href": "/config/chargingstationtypes?offset=0&limit=10",
    "previous": {
        "href": ""
    },
    "next": {
        "href": ""
    },
    "first": {
        "href": "/config/chargingstationtypes?offset=0&limit=10"
    },
    "last": {
        "href": "/config/chargingstationtypes?offset=0&limit=10"
    },
    "elements": [
        {
            "id": 1,
            "manufacturer": {
                "id": 1,
                "code": "MOTOWN"
            },
            "code": "MODEL1",
            "evses": [
                {
                    "id": 1,
                    "identifier": 1,
                    "connectors": [
                        {
                            "id": 2,
                            "maxAmp": 16,
                            "phase": 3,
                            "voltage": 480,
                            "chargingProtocol": "MODE3",
                            "current": "AC",
                            "connectorType": "S_TYPE_2"
                        },
                        {
                            "id": 1,
                            "maxAmp": 16,
                            "phase": 3,
                            "voltage": 480,
                            "chargingProtocol": "MODE3",
                            "current": "AC",
                            "connectorType": "C_TYPE_2"
                        }
                    ]
                },
                {
                    "id": 2,
                    "identifier": 2,
                    "connectors": [
                        {
                            "id": 4,
                            "maxAmp": 16,
                            "phase": 3,
                            "voltage": 240,
                            "chargingProtocol": "MODE3",
                            "current": "AC",
                            "connectorType": "C_G105"
                        }
                    ]
                }
            ]
        },
        {
            "id": 2,
            "manufacturer": {
                "id": 2,
                "code": "ACME"
            },
            "code": "CORP1",
            "evses": [
                {
                    "id": 4,
                    "identifier": 2,
                    "connectors": [
                        {
                            "id": 11,
                            "maxAmp": 16,
                            "phase": 3,
                            "voltage": 240,
                            "chargingProtocol": "MODE3",
                            "current": "AC",
                            "connectorType": "TESLA"
                        },
                        {
                            "id": 12,
                            "maxAmp": 16,
                            "phase": 3,
                            "voltage": 240,
                            "chargingProtocol": "MODE3",
                            "current": "AC",
                            "connectorType": "CEE_7_7"
                        },
                        {
                            "id": 10,
                            "maxAmp": 16,
                            "phase": 3,
                            "voltage": 240,
                            "chargingProtocol": "MODE3",
                            "current": "AC",
                            "connectorType": "C_G105"
                        }
                    ]
                }
            ]
        }
    ]
}

Create charging station type

Request

{
   "manufacturer": {
      "id": 1,
      "code": "MOTOWN"
   },
   "code": "MODEL2",
   "evses": [
      {
         "identifier": 1,
         "connectors": [
            {
               "maxAmp": 16,
               "phase": 3,
               "voltage": 240,
               "chargingProtocol": "MODE3",
               "current": "AC",
               "connectorType": "C_G105"
            }
         ]
      },
      {
         "identifier": 2,
         "connectors": [
            {
               "maxAmp": 16,
               "phase": 3,
               "voltage": 480,
               "chargingProtocol": "MODE3",
               "current": "AC",
               "connectorType": "S_TYPE_2"
            },
            {
               "maxAmp": 16,
               "phase": 3,
               "voltage": 480,
               "chargingProtocol": "MODE3",
               "current": "AC",
               "connectorType": "C_TYPE_2"
            }
         ]
      }
   ]
}

Response

{
   "id": 5,
   "manufacturer": {
      "id": 1,
      "code": "MOTOWN"
   },
   "code": "MODEL2",
   "evses": [
      {
         "id": 6,
         "identifier": 2,
         "connectors": [
            {
               "id": 15,
               "maxAmp": 16,
               "phase": 3,
               "voltage": 480,
               "chargingProtocol": "MODE3",
               "current": "AC",
               "connectorType": "C_TYPE_2"
            },
            {
               "id": 14,
               "maxAmp": 16,
               "phase": 3,
               "voltage": 480,
               "chargingProtocol": "MODE3",
               "current": "AC",
               "connectorType": "S_TYPE_2"
            }
         ]
      },
      {
         "id": 5,
         "identifier": 1,
         "connectors": [
            {
               "id": 13,
               "maxAmp": 16,
               "phase": 3,
               "voltage": 240,
               "chargingProtocol": "MODE3",
               "current": "AC",
               "connectorType": "C_G105"
            }
         ]
      }
   ]
}

Get charging station type by id

Request

Empty

Response

{
   "id": 1,
   "manufacturer": {
      "id": 1,
      "code": "MOTOWN"
   },
   "code": "MODEL1",
   "evses": [
      {
         "id": 1,
         "identifier": 1,
         "connectors": [
            {
               "id": 1,
               "maxAmp": 16,
               "phase": 3,
               "voltage": 480,
               "chargingProtocol": "MODE3",
               "current": "AC",
               "connectorType": "C_TYPE_2"
            },
            {
               "id": 2,
               "maxAmp": 16,
               "phase": 3,
               "voltage": 480,
               "chargingProtocol": "MODE3",
               "current": "AC",
               "connectorType": "S_TYPE_2"
            }
         ]
      },
      {
         "id": 2,
         "identifier": 2,
         "connectors": [
            {
               "id": 4,
               "maxAmp": 16,
               "phase": 3,
               "voltage": 240,
               "chargingProtocol": "MODE3",
               "current": "AC",
               "connectorType": "C_G105"
            }
         ]
      }
   ]
}

Update charging station type by id

Request

{
   "id": 1,
   "manufacturer": {
      "id": 1,
      "code": "MOTOWN"
   },
   "code": "MODEL1",
   "evses": [
      {
         "id": 1,
         "identifier": 1,
         "connectors": [
            {
               "id": 1,
               "maxAmp": 16,
               "phase": 3,
               "voltage": 480,
               "chargingProtocol": "MODE3",
               "current": "AC",
               "connectorType": "C_TYPE_2"
            }
         ]
      },
      {
         "id": 2,
         "identifier": 2,
         "connectors": [
            {
               "id": 4,
               "maxAmp": 32,
               "phase": 3,
               "voltage": 240,
               "chargingProtocol": "MODE3",
               "current": "DC",
               "connectorType": "C_G105"
            }
         ]
      }
   ]
}

Response

{
   "id": 1,
   "manufacturer": {
      "id": 1,
      "code": "MOTOWN"
   },
   "code": "MODEL1",
   "evses": [
      {
         "id": 2,
         "identifier": 2,
         "connectors": [
            {
               "id": 4,
               "maxAmp": 32,
               "phase": 3,
               "voltage": 240,
               "chargingProtocol": "MODE3",
               "current": "DC",
               "connectorType": "C_G105"
            }
         ]
      },
      {
         "id": 1,
         "identifier": 1,
         "connectors": [
            {
               "id": 1,
               "maxAmp": 16,
               "phase": 3,
               "voltage": 480,
               "chargingProtocol": "MODE3",
               "current": "AC",
               "connectorType": "C_TYPE_2"
            }
         ]
      }
   ]
}

Delete charging station type by id

Request

Empty

Response

Empty

Get connectors

Request

Empty

Response

[
    {
        "id": 13,
        "maxAmp": 16,
        "phase": 1,
        "voltage": 240,
        "chargingProtocol": "MODE3",
        "current": "AC",
        "connectorType": "TESLA"
    },
    {
        "id": 7,
        "maxAmp": 16,
        "phase": 1,
        "voltage": 240,
        "chargingProtocol": "MODE3",
        "current": "AC",
        "connectorType": "TESLA"
    }
]

Create connector

Request

{
    "maxAmp": 16,
    "phase": 1,
    "voltage": 240,
    "chargingProtocol": "MODE3",
    "current": "AC",
    "connectorType": "TESLA"
}

Response

{
    "id": 13,
    "maxAmp": 16,
    "phase": 1,
    "voltage": 240,
    "chargingProtocol": "MODE3",
    "current": "AC",
    "connectorType": "TESLA"
}

Get connector by id

Request

Empty

Response

{
   "id": 1,
   "maxAmp": 16,
   "phase": 3,
   "voltage": 480,
   "chargingProtocol": "MODE3",
   "current": "AC",
   "connectorType": "C_TYPE_2"
}

Update connector by id

Request

{
   "id": 1,
   "maxAmp": 32,
   "phase": 3,
   "voltage": 240,
   "chargingProtocol": "MODE3",
   "current": "AC",
   "connectorType": "C_TYPE_2"
}

Response

{
   "id": 1,
   "maxAmp": 32,
   "phase": 3,
   "voltage": 240,
   "chargingProtocol": "MODE3",
   "current": "AC",
   "connectorType": "C_TYPE_2"
}

Delete connector by id

Request

Empty

Response

Empty

Get evses

Request

Empty

Response

[
    {
        "id": 4,
        "identifier": 2,
        "connectors": [
            {
                "id": 12,
                "maxAmp": 16,
                "phase": 3,
                "voltage": 240,
                "chargingProtocol": "MODE3",
                "current": "AC",
                "connectorType": "CEE_7_7"
            },
            {
                "id": 10,
                "maxAmp": 16,
                "phase": 3,
                "voltage": 240,
                "chargingProtocol": "MODE3",
                "current": "AC",
                "connectorType": "C_G105"
            },
            {
                "id": 11,
                "maxAmp": 16,
                "phase": 3,
                "voltage": 240,
                "chargingProtocol": "MODE3",
                "current": "AC",
                "connectorType": "TESLA"
            }
        ]
    },
    {
        "id": 3,
        "identifier": 1,
        "connectors": [
            {
                "id": 13,
                "maxAmp": 16,
                "phase": 1,
                "voltage": 240,
                "chargingProtocol": "MODE3",
                "current": "AC",
                "connectorType": "TESLA"
            },
            {
                "id": 7,
                "maxAmp": 16,
                "phase": 1,
                "voltage": 240,
                "chargingProtocol": "MODE3",
                "current": "AC",
                "connectorType": "TESLA"
            }
        ]
    }
]

Create evse

Request

{
    "identifier": 6,
    "connectors": [
        {
            "id": 12,
            "maxAmp": 16,
            "phase": 3,
            "voltage": 240,
            "chargingProtocol": "MODE3",
            "current": "AC",
            "connectorType": "CEE_7_7"
        },
        {
            "id": 10,
            "maxAmp": 16,
            "phase": 3,
            "voltage": 240,
            "chargingProtocol": "MODE3",
            "current": "AC",
            "connectorType": "C_G105"
        },
        {
            "id": 11,
            "maxAmp": 16,
            "phase": 3,
            "voltage": 240,
            "chargingProtocol": "MODE3",
            "current": "AC",
            "connectorType": "TESLA"
        }
    ]
}

Response

{
    "id": 6,
    "identifier": 6,
    "connectors": [
        {
            "id": 17,
            "maxAmp": 16,
            "phase": 3,
            "voltage": 240,
            "chargingProtocol": "MODE3",
            "current": "AC",
            "connectorType": "CEE_7_7"
        },
        {
            "id": 19,
            "maxAmp": 16,
            "phase": 3,
            "voltage": 240,
            "chargingProtocol": "MODE3",
            "current": "AC",
            "connectorType": "TESLA"
        },
        {
            "id": 18,
            "maxAmp": 16,
            "phase": 3,
            "voltage": 240,
            "chargingProtocol": "MODE3",
            "current": "AC",
            "connectorType": "C_G105"
        }
    ]
}

Get evse by id

Request

Empty

Response

{
    "id": 6,
    "identifier": 6,
    "connectors": [
        {
            "id": 17,
            "maxAmp": 16,
            "phase": 3,
            "voltage": 240,
            "chargingProtocol": "MODE3",
            "current": "AC",
            "connectorType": "CEE_7_7"
        },
        {
            "id": 19,
            "maxAmp": 16,
            "phase": 3,
            "voltage": 240,
            "chargingProtocol": "MODE3",
            "current": "AC",
            "connectorType": "TESLA"
        },
        {
            "id": 18,
            "maxAmp": 16,
            "phase": 3,
            "voltage": 240,
            "chargingProtocol": "MODE3",
            "current": "AC",
            "connectorType": "C_G105"
        }
    ]
}

Update evse by id

Request

{
    "id": 5,
    "identifier": 5,
    "connectors": [
        {
            "maxAmp": 16,
            "phase": 3,
            "voltage": 240,
            "chargingProtocol": "MODE3",
            "current": "AC",
            "connectorType": "CEE_7_7"
        }
    ]
}

Response

{
    "id": 5,
    "identifier": 5,
    "connectors": [
        {
            "id": 20,
            "maxAmp": 16,
            "phase": 3,
            "voltage": 240,
            "chargingProtocol": "MODE3",
            "current": "AC",
            "connectorType": "CEE_7_7"
        }
    ]
}

Delete evse by id

Request

Empty

Response

Empty

List all manufacturers

Request

Empty

Response

{
    "href": "/config/manufacturers?offset=0&limit=10",
    "previous": {
        "href": ""
    },
    "next": {
        "href": ""
    },
    "first": {
        "href": "/config/manufacturers?offset=0&limit=10"
    },
    "last": {
        "href": "/config/manufacturers?offset=0&limit=10"
    },
    "elements": [
        {
            "id": 1,
            "code": "MOTOWN"
        },
        {
            "id": 2,
            "code": "ACME"
        }
    ]
}

Get manufacturer by id

Request

Empty

Response

{
    "id": 1,
    "code": "MOTOWN"
}

Create manufacturer

Request

{
    "code": "MyCode"
}

Response

{
    "id": 3,
    "code": "MyCode"
}

Update manufacturer by id

Request

{
    "code": "MyNewCode"
}

Response

{
    "id": 3,
    "code": "MyNewCode"
}

Delete manufacturer by id

Request

Empty

Response

Empty