NAV
shell

Introduction

Used to interact with sharebox... WIP

Event

Called when a locker is opened by a customer to drop a key

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

Called when a locker is opened by a member and the reservation's exchange method is set to in.

HTTP Request

POST /v1/events/content_delivered_by_receiver

The request Body payload is:

{
    "locker_no": 0,
    "subscription_id": 0,
    "reservation_id": 0,
    "event_type": "",
    "event_timestamp": "0001-01-01T00:00:00Z",
    "subscription_name": ""
}

The request JSON response is:

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

Request schema

Parameter Type Required Description
locker_no int true
subscription_id SubscriptionID true
reservation_id int true
event_type string true
event_timestamp time.Time true
subscription_name string true

Response schema

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

Called when a locker is opened by an employee to pick up key

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

Called when a locker is opened by a member marked as is_employee and the reservation's exchange method is set to in.

HTTP Request

POST /v1/events/content_picked_up_by_employee

The request Body payload is:

{
    "locker_no": 0,
    "subscription_id": 0,
    "reservation_id": 0,
    "event_type": "",
    "event_timestamp": "0001-01-01T00:00:00Z",
    "subscription_name": ""
}

The request JSON response is:

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

Request schema

Parameter Type Required Description
locker_no int true
subscription_id SubscriptionID true
reservation_id int true
event_type string true
event_timestamp time.Time true
subscription_name string true

Response schema

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

Called when a locker is opened by an employee to drop a key

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

Called when a locker is closed by a member marked as is_employee and the reservation's exchange method is set to out.

HTTP Request

POST /v1/events/content_delivered_by_employee

The request Body payload is:

{
    "locker_no": 0,
    "subscription_id": 0,
    "reservation_id": 0,
    "event_type": "",
    "event_timestamp": "0001-01-01T00:00:00Z",
    "subscription_name": ""
}

The request JSON response is:

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

Request schema

Parameter Type Required Description
locker_no int true
subscription_id SubscriptionID true
reservation_id int true
event_type string true
event_timestamp time.Time true
subscription_name string true

Response schema

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

Called when a locker is opened by a customer to pick up key

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

Called when a locker is opened by a member and the reservation's exchange method is set to out.

HTTP Request

POST /v1/events/content_picked_up_by_receiver

The request Body payload is:

{
    "locker_no": 0,
    "subscription_id": 0,
    "reservation_id": 0,
    "event_type": "",
    "event_timestamp": "0001-01-01T00:00:00Z",
    "subscription_name": ""
}

The request JSON response is:

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

Request schema

Parameter Type Required Description
locker_no int true
subscription_id SubscriptionID true
reservation_id int true
event_type string true
event_timestamp time.Time true
subscription_name string true

Response schema

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

Employee

Opens a Sharebox Locker for an Employee who wants to pick up a key

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

Opens a Sharebox Locker for an Employee who wants to pick up a key. This will call Sharebox to update their subscription name, which allows events/door_opened to identify which request to ignore. Then open the locker for the employee. Claire appointment is updated

HTTP Request

POST /v1/employees/pickup

The request Body payload is:

{
    "appointment_id": 0,
    "sharebox_location_id": ""
}

The request JSON response is:

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

Request schema

Parameter Type Required Description
appointment_id AppointmentID true Appointment Identifier for an Employee to pick up key
sharebox_location_id string true Sharebox Location Identifier for an Employee to pick up key

Response schema

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

Opens a Sharebox Locker for an Employee who wants to drop a key

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

Opens a Sharebox Locker for an Employee who wants to drop a key. This will call Sharebox to update their subscription name, which allows events/door_opened to identify which request to ignore. Then open the locker for the employee. Claire appointment is updated

HTTP Request

POST /v1/employees/drop_key_back

The request Body payload is:

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

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 int true Sharebox Keylocker Identifier
appointment_id AppointmentID true Appointment Identifier for an Employee to pick up key
appointment_note_id model.AppointmentNoteID false Identifier for a temp driver appointment note, if someone was at the location on behalf of the actual driver

Response schema

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

Opens a Sharebox Locker for an Employee who wants to pickup a key for a Customer

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

Opens a Sharebox Locker for an Employee who wants to pickup a key for a Customer. This will call Sharebox to update their subscription name, which allows events/door_opened to identify which request to ignore. Then open the locker for the employee. Claire appointment is updated

HTTP Request

POST /v1/employees/assist_pick_up

The request Body payload is:

{
    "appointment_id": 0,
    "sharebox_location_id": ""
}

The request JSON response is:

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

Request schema

Parameter Type Required Description
appointment_id AppointmentID true Appointment Identifier for an Employee to pick up key
sharebox_location_id string true Sharebox Location Identifier for an Employee to pick up key

Response schema

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

Cabinet

Get a list of cabinets that are available

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

Get a list of cabinets that are available They must be of the DealerLocation and have at least one active, empty locker

HTTP Request

POST /v1/cabinets/list_available

The request Body payload is:

{
    "appointment_id": 0
}

The request JSON response is:

{
    "cabinets": []
}

Request schema

Parameter Type Required Description
appointment_id AppointmentID true Appointment Identifier to locate available cabinets

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
cabinets []entities.Cabinet

Log

List Sharebox Logs

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

This endpoint returns a paginated list of sharebox logs that have occurred for a location.

HTTP Request

POST /v1/logs/list

The request Body payload is:

{
    "dealer_location_id": 0,
    "page": 0
}

The request JSON response is:

{
    "items": [],
    "nb_pages": 0
}

Request schema

Parameter Type Required Description
dealer_location_id DealerLocationID true Location Identifier
page int true Page to display, default value is 1

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
items []model.ShareboxLog
nb_pages int

Models and Enumeration

ShareboxResult Enumeration

Value Description
1 The event was not handled correctly and resulted in an error
2 The event could not be identified
3 Event was handled

ShareboxTrigger Enumeration

Value Description
1 Whenever the door is opened. This is legacy and not logged anymore
2 Customer has dropped key
3 Employee has picked up the key
4 Employee dropped back the key
5 Customer has picked back up the key

Cabinet Model

Field Type Description
ReservationID int
SubscriptionID int
SubscriptionName string
CabinetID int
LockerID int
LockerNO int
LocationID int
Location string
LocationSerialNO string
IsCabinetOnline int
IsCabinetError int
IsLockerActive int
IsLockerOpen int
IsLockerError int

ShareboxLog Model

Field Type Description
ID ShareboxLogID Sharebox Log ID
TriggerID ShareboxTrigger Sharebox Event type
ResultID ShareboxResult Result of handling the Sharebox Event
Reason string Reason for a Sharebox Event failing
LockerNo int Sharebox Locker number
SubscriptionID int Sharebox Subscription ID
SubscriptionName string Sharebox Subscription Name
ReservationID int Sharebox Reservation ID
EventType string Sharebox Event Type
EventTimestamp time.Time Sharebox Event timestamp
DealerLocationID DealerLocationID Location Identifier from which the Sharebox Event originates

Webhook Model

Field Type Description
LockerNo int
SubscriptionID SubscriptionID
ReservationID int
EventType string
EventTimestamp time.Time
SubscriptionName string