Skip to content

Reservations API

Reservations API allow users to manage connector reservations for charging.

API Usage

You must be authorized to use Reservations API. See Token Management API for more information on how to create and use the access token.

Add Reservation

This method allows you to add a reservation.

Prepare Request

To prepare a request body, perform the following steps.

  1. Set Charger ID to the request path parameter chargerId.
  2. Set Connector ID to the request path parameter connectorId.
  3. Set Charging Session Start time to the request body parameter ReservationStart.
  4. Set Charging Session End time to the request body parameter ReservationEnd.
  5. Set mode of authorization to the request body parameter AuthorizationType.
  6. Set authorization id value which is RFID Tag Number in this case, to the request body parameter AuthorizationValue.

Sample Request Body

{
    "ReservationStart": "2024-01-01T08:30:19.220Z",
    "ReservationEnd": "2024-01-01T11:30:19.220Z",
    "AuthorizationType": "RFID",
    "AuthorizationValue": "89C4704A"
}

Example Request

Note

Use the server URL applicable to your region. See API Reference for available server URLs applicable to your region.

export ACCESS_TOKEN = <YOUR_ACCESS_TOKEN>

export CHARGER_ID = <YOUR_CHARGER_ID>
export CONNECTOR_ID = <YOUR_CONNECTOR_ID>

export RESERVATION_START = <YOUR_RESERVATION_START> # Example "2022-11-22T19:54:10.143Z"
export RESERVATION_END = <YOUR_RESERVATION_END> # Example "2022-11-22T21:54:10.143Z"
export AUTHORIZATION_TYPE = <YOUR_AUTHORIZATION_TYPE> # Example "RFID"
export AUTHORIZATION_VALUE = <YOUR_AUTHORIZATION_VALUE> # Example "59170C5D"


curl --location --request POST 'https://api.eu.depot.emobility.io/v1/reservations/chargers/$CHARGER_ID/connectors/$CONNECTOR_ID' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--data '{
    "ReservationStart": $RESERVATION_START,
    "ReservationEnd": $RESERVATION_END,
    "AuthorizationType": $AUTHORIZATION_TYPE,
    "AuthorizationValue": $AUTHORIZATION_VALUE,
}'

Response Body

Successful response returns 201 HTTP status code with response body of ReservationSuccessResponse schema.

Example Response

{
    "ChargerReservationID": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "message": "Charger Reservation is successful."
}

Remove Reservation

This method allows you to remove booking based on reservation ID.

Prepare Request

You can prepare the request with path parameter reservationId which was received in the response at the time of booking.

Note

Use the server URL applicable to your region. See API Reference for available server URLs applicable to your region.

Example Request

export ACCESS_TOKEN = <YOUR_ACCESS_TOKEN>
export RESERVATION_ID = <YOUR_RESERVATION_ID>

curl --location --request DELETE 'https://api.eu.depot.emobility.io/v1/reservations/$RESERVATION_ID' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $ACCESS_TOKEN'

Response Body

Successful response returns 201 HTTP status code with response body of ReservationRemovedSuccessResponse schema.

Example Response

{
    "code": 200,
    "message": "Reservation is deleted successful."
}

For more information, see Reservations API Reference.

Community

Connect and Collaborate with Industrial Professionals and Join the Community!

Click to load comments