NAV
shell

Introduction

Welcome to the Claire ACSES API !

Endpoints method, url, request/response schema and their description are presented on the left. The right side contains example requests (via curl) and reponses (in JSON).

For more information on types and possible value, refer to the Models and Enumeration section.

If this is your first time reading the docs, check out the Authentication section.

The changelog section contains all updates related to this API.

Event

List webhook history

curl "API_BASE/v1/events/history"
    -H "Authorization: Bearer $token"
    -H "Content-Type: application/json"

Webhook events are logged by acses, this endpoint returns the full history

HTTP Request

POST /v1/events/history

The request Body payload is:

{
    "dealer_location_id": 0
}

The request JSON response is:

{
    "history": []
}

Request schema

Parameter Type Required Description
dealer_location_id DealerLocationID true DealerLocation Identifier

Response schema

This endpoint return an object with the following fields, please refer to the JSON response column on the right for an example.

Parameter Type
history []entities.WebhookHistory

Handles events from acses

curl "API_BASE/v1/events/handler"
    -H "Authorization: Bearer $token"
    -H "Content-Type: application/json"

Webhooks events are posted by acses, this endpoint process the events and update the appointment in the Claire

HTTP Request

POST /v1/events/handler

The request Body payload is:

{
    "tablekey": "",
    "lockersystem": "",
    "cellnumber": "",
    "eventName": "",
    "eventDate": "0001-01-01T00:00:00Z",
    "booking": {
        "tablekey": "",
        "name": "",
        "tag": "",
        "state": "",
        "startDate": "0001-01-01T00:00:00Z",
        "endDate": "0001-01-01T00:00:00Z",
        "code": "",
        "create": "0001-01-01T00:00:00Z",
        "lastaction": "",
        "lockercell": "",
        "lockercellTablekey": "",
        "objectTablekey": "",
        "siteTablekey": ""
    }
}

The request JSON response is:

This endpoint does not return anything, only the HTTP status code matters.

Request schema

Parameter Type Required Description
tablekey WebhookEventID true Webhook event identifier
lockersystem LockerSystemID true Locker system identifier
cellnumber LockerCellNumber true Cell number of the locker
eventName ObjectStatus true Name of the event
eventDate time.Time true Time stamp of the event
booking Booking true Booking details

Response schema

This endpoint does not return anything, only the HTTP status code matters.

Simulate opening the door

curl "API_BASE/v1/events/simulate?location_id=...&locker_system_id=...&code=...&action=..."
    -H "Authorization: Bearer $token"

In dev only, this endpoints allows to simulate opening the door to drop or pick a key

HTTP Request

GET /v1/events/simulate?location_id=...&locker_system_id=...&code=...&action=...

The request JSON response is:

This endpoint does not return anything, only the HTTP status code matters.

Request schema

Parameter Type Required Description
location_id DealerLocationID true
locker_system_id LockerSystemID true
code string true
action ObjectStatus true

Response schema

This endpoint does not return anything, only the HTTP status code matters.

Employee Controller

Allows a user to interact with ACSES lockers

Allows a user to pickup, dropback and assist the customer with picking up keys from ACSES lockers.


Whenever you want to open a door with a PIN code that you received, you have to open this link (once)

https://clairedev.nl/api/acses/v1/events/simulate?location_id=82&locker_system_id=151&code={PIN_CODE}&action={ACTION}

And replace PIN_CODE with the pin code you received and ACTION with either dropoff when dropping a key or checkout when you're picking up a key.

The location_id is the claire dev location_id for Visser Werplaats where we have the ACSES locker setup.

The locker_system_id is the id of the locker in ACSES system (we have only one).

List available lockers

curl "API_BASE/v1/employees/list_available_lockers"
    -H "Authorization: Bearer $token"
    -H "Content-Type: application/json"

Return the list of available lockers for the given location ID

HTTP Request

POST /v1/employees/list_available_lockers

The request Body payload is:

{
    "dealer_location_id": 0
}

The request JSON response is:

{
    "lockers": []
}

Request schema

Parameter Type Required Description
dealer_location_id DealerLocationID true DealerLocation Identifier

Response schema

This endpoint return an object with the following fields, please refer to the JSON response column on the right for an example.

Parameter Type
lockers []entities.LockerSystem

Pickup

curl "API_BASE/v1/employees/pickup"
    -H "Authorization: Bearer $token"
    -H "Content-Type: application/json"

Return the PIN for the locker to pickup the keys

HTTP Request

POST /v1/employees/pickup

The request Body payload is:

{
    "appointment_id": 0
}

The request JSON response is:

{
    "acses_pin": null
}

Request schema

Parameter Type Required Description
appointment_id AppointmentID true Appointment Identifier

Response schema

This endpoint return an object with the following fields, please refer to the JSON response column on the right for an example.

Parameter Type
acses_pin string

Assist Pickup

curl "API_BASE/v1/employees/assist_pickup"
    -H "Authorization: Bearer $token"
    -H "Content-Type: application/json"

Returns the PIN of the locker for assisted pick up of keys

HTTP Request

POST /v1/employees/assist_pickup

The request Body payload is:

{
    "appointment_id": 0
}

The request JSON response is:

{
    "acses_pin": null
}

Request schema

Parameter Type Required Description
appointment_id AppointmentID true Appointment Identifier

Response schema

This endpoint return an object with the following fields, please refer to the JSON response column on the right for an example.

Parameter Type
acses_pin string

Dropback

curl "API_BASE/v1/employees/drop_back"
    -H "Authorization: Bearer $token"
    -H "Content-Type: application/json"

Returns the PIN of the locker for dropping back the keys

HTTP Request

POST /v1/employees/drop_back

The request Body payload is:

{
    "locker_system_id": "",
    "appointment_id": 0,
    "appointment_note_id": null
}

The request JSON response is:

{
    "acses_pin": null
}

Request schema

Parameter Type Required Description
locker_system_id LockerSystemID true Locker system identifier
appointment_id AppointmentID true Appointment identifier
appointment_note_id model.AppointmentNoteID false Appointment note identifier

Response schema

This endpoint return an object with the following fields, please refer to the JSON response column on the right for an example.

Parameter Type
acses_pin string

Models and Enumeration

BookingState Enumeration

Value Description
BOOKED
USED
EXPIRED

ObjectStatus Enumeration

Value Description
registered
dropoff
checkout
expired

Booking Model

Field Type Description
ID BookingID Booking Identifier
Name string Name of the booking
Tag string Tag associated with the booking
State BookingState State of the booking
StartDate time.Time Start date of the booking
EndDate time.Time End date of the booking
Code string Code for the locker
Create time.Time Date of booking creation
LastAction ObjectStatus Last action related to the booking
LockerCellNumber LockerCellNumber Cell number of the locker
LockerCellID LockerCellID Cell id of the locker
ObjectID ObjectID Object identifier
LockerSystemID LockerSystemID Locker system identifier

LockerSystem Model

Field Type Description
ID LockerSystemID LockerSystem Identifier
Name string Name given
Active bool The LockerSystem is active

WebhookEvent Model

Field Type Description
WebhookEventID WebhookEventID Webhook event identifier
LockerSystemID LockerSystemID Locker system identifier
LockerCellNumber LockerCellNumber Cell number of the locker
EventName ObjectStatus Name of the event
EventDate time.Time Time stamp of the event
Booking Booking Booking details

WebhookHistory Model

Field Type Description
WebhookEventID WebhookEventID Webhook event identifier
SentContent string Serialized content that has been sent to the webhook
ResponseStatus string Response status received from the webhook
ResponseContent string Response content received from the webhook
SentDate time.Time Timestamp of the webhook sent

Changelog

This section contains changes related to the ACSES service. Changes will be included if:

Initial release - 29.03.2024.

The following endpoints are included with initial release:

Errors

The Claire Automotive Support APIs uses the following error codes:

Error Code Meaning
400 Bad Request : Your request is invalid.
401 Unauthorized : Your API key is wrong.
404 Not Found : The specified endpoint could not be found.
405 Method Not Allowed : You tried to access server with an invalid method.
429 Too Many Requests : You're making too many requests.
500 Internal Server Error : We had a problem with our server. Try again later.
503 Service Unavailable : We're temporarily offline for maintenance. Please try again later.