- Introduction
- Authentication
- List Filtering
- Webhooks
- API Reference
- Users
- Methods
- Properties
- GET /users/{id}
- GET /users/
- POST /users/
- PUT /users/{id}
- DELETE /users/{id}
- Locks
- Methods
- Properties
- GET /locks/{id}
- GET /locks
- Activities
- Methods
- Properties
- GET /locks/{id}/activities/{activityId}
- GET /locks/{id}/activities
- Lock Activity Codes & Descriptions
- Lock Access Actions
- Methods
- Properties
- POST /lockaccess
- Packages
- Methods
- Properties
- GET /packages/{id}
- POST /packages
- POST /import
- PUT /packages/{id}
- DELETE /packages/{id}
- Locations
- Methods
- Properties
- GET /locations/{id}
- GET /locations
- POST /locations
- PUT /locations/{id}
- DELETE /locations/{id}
- Barcodes
- Methods
- Properties
- GET /barcodes/{id}
- GET /barcodes
- POST /barcodes
- PUT /barcodes
- DELETE /barcodes/{id}
Introduction
Welcome to the BoxLock Control API! You can use our API to access information about your organization, manage locations, locks, barcodes, access activity logs and a variety of other things.
All of our endpoint examples are written in Shell using curl, which should allow them to be easily generalizable to any programming language you're using to integrate BoxLock into your application.
BoxLock uses API keys to allow access to the API.
Authentication
BoxLock uses API Key to allow access to the API. The API Info for your account is available under Account β API in BoxLock Control. If you need additional API Keys generated or the API Key is not populated, please reach out to your BoxLock Customer Success Representative.
The BoxLock Control API expects the API Key to be included in all API requests to the server. X-API-Key as the header key and your API Key as the value.
List Filtering
You can filter most of our data objects by their field properties (ie locks, barcodes, and packages).
- Supported Operators - eq, gt, gte, lt, lte, ne, between, notBetween, in, notIn, overlap, contains, contained, like
- Paging - limit,offset
- Sorting - sort (sort=updatedAt or sort=-updatedAt)
Example Requests
GET https://apis.getboxlock.com/barcode/v2/control/barcodes/?name=eq:MyBarcode&locationId=eq:{id}&sort=updatedAt&limit=10&offset=1
GET https://apis.getboxlock.com/lock/v2/control/locks/activities/?activityType=in:18,20
GET https://apis.getboxlock.com/lock/v2/control/locks/activities/?createdAt=between:2021-03-18,2021-03-27
Webhooks
Properties
endpointType
- helps to identify the object typeeventType
- the type of event that triggered the notificationobject
- data object for the event message (Package)
Webhook Payload JSON Representation
{
"id": 1234,
"endpointType": "string",
"eventType": "package.delivery.secured",
"object": {
"id": 123,
"userId": 456,
"trackingNumber": "DK3I3DKC",
"carrierName": "Carrier Name",
"shipperName": "Shipper Name",
"url": "string",
"description": "Cool Package",
"status": "delivered",
"deliveredAt": 2020 - 03 - 19 T07: 22 Z,
"createdAt": 2020 - 03 - 19 T07: 22 Z,
"updatedAt": 2020 - 03 - 19 T07: 22 Z
},
"createdAt": 2020 - 03 - 19 T07: 22 Z,
}
API Reference
Users
A user represents a BoxLock Control organization user.
Methods
info
- returns info about a BoxLock Control Userlist
- returns a list of BoxLock Control usersinsert
- create a new user recordupdate
- update a user recorddelete
- delete a user record
Properties
id
- unique identifiername
- the users full nameemail
- the users email addresslocationId
- the id of the location the user is assigned togroup
- the group/role assigned to the user
GET /users/{id}
This endpoint retrieves an individual user.
Example Request
curl -X GET https://apis.getboxlock.com/user/v2/control/users{id}
-H βX-API-Key: <ApiKey>β
The above command returns JSON structured like this:
{
"id": "int",
"name": "string",
"email": "string",
"locationId": "int",
"group": "string",
"createdAt": "date",
"updatedAt": "date"
}
GET /users/
This endpoint retrieves a list of users for the currently authenticated organization.
Example Request
curl -X GET https://apis.getboxlock.com/user/v2/control/users
-H βX-API-Key: <ApiKey>β
The above command returns JSON structured like this:
{
"data": [{
"id": "int",
"name": "string",
"email": "string",
"locationId": "int",
"group": "string",
"createdAt": "date",
"updatedAt": "date"
}]
}
POST /users/
This endpoint creates a user for the currently authenticated organization.
Properties
name
- first name and last name of the useremail
- email address for the userlocationId
- the location assigned to the user. not required. (Only used for users create in the LocationAdmin group)group
- OrganizationAdmin - Can write, delete, update an object for assigned Org.
- OrganizationManager - Same as OrganizationAdmin but canβt create users.
- OrganizationAnalyst - Can read an object for Org.
- LocationAdmin - Can write, delete, update an object for assigned location.
Example Request
curl -X GET https://apis.getboxlock.com/user/v2/control/users
-H βX-API-Key: <ApiKey>β
-d {"name":"John Smith","email":"john.smith@getboxlock.com","locationId":3,"group":"LocationAdmin"}
The above command returns JSON structured like this:
{
"id": "int",
"name": "string",
"email": "string",
"locationId": "int",
"group": "string",
"createdAt": "date",
"updatedAt": "date"
}
PUT /users/{id}
This endpoint updates a user for the currently authenticated organization.
Properties
name
- first name and last name of the useremail
- email address for the userlocationId
- the location assigned to the user. not required. (Only used for users create in the LocationAdmin group)group
- OrganizationAdmin - Can write, delete, update an object for assigned Org.
- OrganizationManager - Same as OrganizationAdmin but canβt create users.
- OrganizationAnalyst - Can read an object for Org.
- LocationAdmin - Can write, delete, update an object for assigned location.
Example Request
curl -X GET https://apis.getboxlock.com/user/v2/control/users
-H βX-API-Key: <ApiKey>β
-d {"name":"John Smith"}
The above command returns JSON structured like this:
{
"id": "int",
"name": "string",
"email": "string",
"locationId": "int",
"group": "string",
"createdAt": "date",
"updatedAt": "date"
}
DELETE /users/{id}
This endpoint deletes a user for the currently authenticated organization.
Properties
id
- unique identifier
Example Request
curl -X DELETE https://apis.getboxlock.com/user/v2/control/users/{id}
-H βX-API-Key: <ApiKey>β
The above command returns JSON structured like this:
if successful, this request returns a 204 (No content)
Locks
A lock represents a BoxLock users lock.
Methods
info
- returns info about a locationlist
- list of locations
Properties
id
- unique identifieruserId
- id for the lock ownerlocationId
- the location the lock is assigned toname
- default name for a lockniceName
- user friendly name for a locklockOpen
- lock state 0=closed, 1=open, 2=unknownbatteryLevel
- lock battery level 0-100batteryCharging
- the charging state of the lockdisconnectedAt
- timestamp when the lock disconnected
GET /locks/{id}
This endpoint retrieves a lock for the currently authenticated organization.
Properties
id
- unique identifier
Example Request
curl -X GET https://apis.getboxlock.com/lock/v2/control/locks/{id}
-H βX-API-Key: <ApiKey>β
The above command returns JSON structured like this:
{
"id": "int",
"name": "string",
"locationId": "int",
"niceName": "string",
"lockOpen": "enum",
"batteryLevel": "int",
"batteryCharging": "int",
"disconnectedAt": "date",
"createdAt": "date",
"updatedAt": "date"
}
GET /locks
This endpoint retrieves a list of locks for the currently authenticated organization.
Example Request
curl -X GET https://apis.getboxlock.com/lock/v2/control/locks
-H βX-API-Key: <ApiKey>β
The above command returns JSON structured like this:
{
"data": [{
"id": "int",
"name": "string",
"locationId": "int",
"niceName": "string",
"lockOpen": "enum",
"batteryLevel": "int",
"batteryCharging": "int",
"disconnectedAt": "date",
"createdAt": "date",
"updatedAt": "date"
}]
}
Activities
An activity represents a logging of lock events.
Methods
info
- returns info about a locklist
- returns a list of locks
Properties
id
- unique identifieractivityType
- unique activity codeuserId
- id for the lock ownerorganizationId
- the organization that owns the locklocationId
- the location associated with the activitybarcodeId
- the barcode associated with the activitylockId
- the lock associated with the activitytitle
- activity titledetails
- Additional details about the activitymodeMmc
- Mobile-tomobile convergence when the activity happenedmodeLac
- Mobile Network Code when the activity happenedmodeLac
- Location Area Code when the activity happenedmodeCid
- Base transceiver station identifierlat
- latitude value when the activity happenedlng
- longitude value when the activity happened
GET /locks/{id}/activities/{activityId}
This endpoint retrieves a lock activity for the currently authenticated organization.
Property
id
- lock unique identifieractivityId
- lock activity unique identifier
Example Request
curl -X GET https://apis.getboxlock.com/lock/v2/control/locks/{id}/activities/{id}
-H βX-API-Key: <ApiKey>β
The above command returns JSON structured like this:
{
"id": "int",
"activityType": "int",
"userId": "int",
"organizationId": "int",
"locationId": "int",
"barcodeId": "int",
"title": "string",
"modeMmc": "int",
"modeMnc": "int",
"modeLac": "int",
"modeCid": "int",
"lat": "float",
"lng": "float",
"createdAt": "date",
"updatedAt": "date"
}
GET /locks/{id}/activities
This endpoint retrieves a list of lock activities for the currently authenticated organization.
Properties
id
- lock unique identifier
Example Request
curl -X GET https://apis.getboxlock.com/lock/v2/control/locks/{id}/activities/{id}
-H βX-API-Key: <ApiKey>β
Lock Activity Codes & Descriptions
Package Delivery
User Barcode Scan
Unlock over Bluetooth
Master Barcode Scan
User Added to Account
Battery Issue
Wifi Issue
Lock Issue (Left open, etc)
Unrecognized Package/Barcode Scanned
Own Package Scanned When Not "Out for Delivery"
Own Package Scanned When Already Delivered
Expired Barcode Scanned
Unauthorized Unlock Attempt
Lock Closed
Expired Press Unlock Access
Successful Press Unlock
Status Update
Parsyl Update
Lock Already Connected
Lock Added
Lock Access Actions
A lockAccess represents an action that can be taken on a Lock. Currently the only action that is allowed is βPush to Unlockβ.
Methods
insert
- returns info about a BoxLock Control user.
Properties
id
- unique identifierlockId
- locks unique identifieraccessType
- always 0duration
- access duration in secondsaccessor
- always 1
POST /lockaccess
This endpoint creates a lockAccess record for the currently authenticated organization target lock. (βPush To Openβ)
Properties
lockID
- target lock to allow accessaccessType
- type of access needed (0 is βPush to Unlockβ)accessor
- the type of accessor (should be 1)duration
- how long the auction in valid for
Example Request
curl -X POST https://apis.getboxlock.com/lockaccess/v2/control/lockaccess
-H βX-API-Key: <ApiKey>β
-d {βlockId": 1111,βaccessType":0,"accessor":1,"duration":30}
The above command returns JSON structured like this:
{
"id": "int",
"lockId": "int",
"duration": "int",
"accessType": "int",
"Accessor": "int",
"createdAt": "date",
"updatedAt": "date"
}
Packages
A package represents a parcel belonging to a BoxLock user.
Methods
info
- returns info about a packageinsert
- create one or more packagesupdate
- update a packagedelete
- delete a package
Properties
id
- unique identifieruserId
- id for the package ownerlocationId
- the location the package is assigned totrackingNumber
- tracking identifier provided by the shippercarrierName
- name for the carriershipperName
- name for the shipperurl
- the tracking url provided by the carrierdescription
- a description for the package.status
- can be βout_for_deliveryβ, βin_transit", or "delivered"deliveredAt
- the stamp for a delivered package
GET /packages/{id}
This endpoint retrieves a package for the currently authenticated organization.
Request Parameters
id
- unique identifiertrackingNumber
- tracking number can be used in place of the {id}
Example Request
curl -X GET https://apis.getboxlock.com/package/v2/control/packages/1234
-H βX-API-Key: <ApiKey>β
The above command returns JSON structured like this:
{
"id": int,
"userId": int,
"locationID": int,
"trackingNumber": int,
"carrierName": "string",
"shipperName": "string",
"url": "string",
"description": "string",
"status": "string"
"deliveredAt": date,
"createdAt": date,
"updatedAt": date
}
POST /packages
This endpoint creates a package for the currently authenticated organization.
Request Parameters
trackingNumber
- tracking identifier provided by the shipperlocationId
- the assigned location for the packagecarrierName
- name for the carriershipperName
- name for the shipperurl
- the tracking url provided by the carrierdescription
- a description for the package.status
- can be βout_for_deliveryβ, βin_transit", or "delivered"
Example Request
curl -X POST https://apis.getboxlock.com/package/v2/control/packages
-H βX-API-Key: <ApiKey>β
-d {"trackingNumber":"374DJNWLKEID","carrierName":"Carrier Name","shipperName":"Shipper Name","url":"https://apis.getboxlock.com/v2/control/packages","description":"My Package","status":"out_for_delivery"}
The above command returns JSON structured like this:
{
"id": int,
"userId": int,
"locationID": int,
"trackingNumber": int,
"carrierName": "string",
"shipperName": "string",
"url": "string",
"description": "string",
"status": "string"
"deliveredAt": date,
"createdAt": date,
"updatedAt": date
}
POST /import
This endpoint creates multiple packages for the currently authenticated organization.
Request Body
Parameters
items[Package]
- list of packages to create
Example Request
curl -X POST https://apis.getboxlock.com/package/v2/control/import
-H βX-API-Key: <ApiKey>β
-d [{"userId":456,"trackingNumber":"374DJNWLKEID","carrierName":"Carrier Name","shipperName":"Shipper Name","url":"https://apis.getboxlock.com/v2/control/packages/import","description":"My Package","status":"out_for_delivery"}]
The above command returns JSON structured like this:
{
"id": int,
"userId": int,
"locationID": int,
"trackingNumber": int,
"carrierName": "string",
"shipperName": "string",
"url": "string",
"description": "string",
"status": "string"
"deliveredAt": date,
"createdAt": date,
"updatedAt": date
}
PUT /packages/{id}
This endpoint updates a package for the currently authenticated organization.
Request Body
Parameters
url
- the tracking url provided by the carrierdescription
- a description for the package.status
- can be βout_for_deliveryβ, βin_transit", or "delivered"
Example Request
curl -X PUT https://apis.getboxlock.com/package/v2/control/packages/1234
-H βX-API-Key: <ApiKey>β
-d {"url":"http://track.getboxlock.com/barcodes/barcodeVis.php?barcode=D8DJSKKDIE","description":"My Package","status":"out_for_delivery"}
The above command returns JSON structured like this:
{
"id": int,
"userId": int,
"locationID": int,
"trackingNumber": int,
"carrierName": "string",
"shipperName": "string",
"url": "string",
"description": "string",
"status": "string"
"deliveredAt": date,
"createdAt": date,
"updatedAt": date
}
DELETE /packages/{id}
This endpoint deletes a package for the currently authenticated organization.
Request Body
Parameters
id
- unique identifiertrackingNumber
- tracking number can be used in place of the {id}
Example Request
curl -X DELETE https://apis.getboxlock.com/package/v2/control/packages/1234
-H βX-API-Key: <ApiKey>
The above command returns JSON structured like this:
If successful, this request returns a 204 (No Content)
Locations
A location represents a place within an organizations hierarchy.
Methods
info
- returns info about a locationlist
- list of locationsinsert
- create one or more locationsupdate
- update a locationdelete
- delete a location
Properties
id
- unique identifierorganizationId
- identifier for the location's organization owneraddress1
- street address for the locationaddress2
- additional address information (ex. Suite, Apt, Unit)state
- the state for the locationcity
- the city for the locationzip
- the zip/postal code for the locationcountry
- the country for the locationcontactName
- the name of the primary contact for the locationcontactPhoneNumber
- the name of the primary contact for the locationstatus
- Indicates whether the location is active
GET /locations/{id}
This endpoint retrieves a location for the currently requesting organization
Example Request
curl -X GET https://apis.getboxlock.com/location/v2/control/locations/1234
-H βX-API-Key: <ApiKey>β
Example Response
{
"id": "int",
"organizationId": "int",
"address1": "string",
"address2": "string",
"state": "string",
"city": "string",
"zip": "string",
"country": "string",
"contactName": "string",
"contactPhoneNumber": "string",
"status": "int",
"createdAt": "date",
"updatedAt": "date"
}
GET /locations
This endpoint retrieves a locations for the currently requesting organization.
Example Request
curl -X GET https://apis.getboxlock.com/location/v2/control/locations
-H βX-API-Key: <ApiKey>β
Example Response
{
"data": [{
"id": "int",
"organizationId": "int",
"address1": "string",
"address2": "string",
"state": "string",
"city": "string",
"zip": "string",
"country": "string",
"contactName": "string",
"contactPhoneNumber": "string",
"status": "int",
"createdAt": "date",
"updatedAt": "date"
}]
}
POST /locations
This endpoint creates a location for the currently requesting organization.
Request Body
Parameters
address1
- tracking identifier provided by the shipperaddress2
- additional address information (ex. Suite, apt)state
- the state of the locationcity
- the tracking url provided by the carrierzip
- the zip/postal code for the locationcountry
- the country for the locationcontactName
- primary contacts namecontactPhoneNumber
- primary contact phone number (format ex. +17708515123)status
- can be 0 (inactive) or 1 (active)
Example Request
curl -X POST https://apis.getboxlock.com/location/v2/control/locations/1234
-H βX-API-Key: <ApiKey>β
-d {βaddress1":"124 Fairlane Wayβ,"address2":"Suite 127β,βstate":"GA","city":"Atlanta","zip":"30309","country":"USA", βcontactNameβ: βJohn Doeβ, βcontactPhoneNumberβ: β+17708515123β}
The above command returns JSON structured like this:
{
"id": "int",
"organizationId": "int",
"address1": "string",
"address2": "string",
"state": "string",
"city": "string",
"zip": "string",
"country": "string",
"contactName": "string",
"contactPhoneNumber": "string",
"status": "int",
"createdAt": "date",
"updatedAt": "date"
}
PUT /locations/{id}
This endpoint updates a location for the currently requesting organization.
Request Body
Parameters
address1
- tracking identifier provided by the shipperaddress2
- additional address information (ex. Suite, apt)state
- the state of the locationcity
- the tracking url provided by the carrierzip
- the zip/postal code for the locationcountry
- the country for the locationcontactName
- primary contacts namecontactPhoneNumber
- primary contact phone number (format ex. +17708515123)status
- can be 0 (inactive) or 1 (active)
Example Request
curl -X PUT https://apis.getboxlock.com/location/v2/control/locations/1234
-H βX-API-Key: <ApiKey>β
-d {βaddress1":"124 Fairlane Courtβ}
The above command returns JSON structured like this:
{
"id": "int",
"organizationId": "int",
"address1": "string",
"address2": "string",
"state": "string",
"city": "string",
"zip": "string",
"country": "string",
"contactName": "string",
"contactPhoneNumber": "string",
"status": "int",
"createdAt": "date",
"updatedAt": "date"
}
DELETE /locations/{id}
This endpoint deletes a package for the currently authenticated organization.
Request Body
Parameters
id
- unique identifier
Example Request
curl -X DELETE https://apis.getboxlock.com/package/v2/control/locations/1234
-H βX-API-Key: <ApiKey>
The above command returns JSON structured like this:
If successful, this request returns a 204 (No Content)
Barcodes
A barcode represents a code used for access control of a BoxLock userβs lock.
Methods
info
- returns info about a locationlist
- list of locationsinsert
- create a barcode for lock accessupdate
- update a barcodedelete
- delete a barcode
Properties
id
- unique identifieruserID
- identifier for the lock ownerlockID
- the lock to assign the barcode to (can be null)locationID
- the location to assign the barcode to (can be null)barcode
- barcode to be createdaccessType
- set to 1=unlimited use barcode, 2=time-based barcode, 3=use-based barcodeenabled
- the active statusenabledFrom
- applicable only for access_type 2, this is the date the barcode starts to be valid (YYYY-MM-DD)enabledTo
- applicable only for access_type 2, this is the date the barcode is no longer valid (YYYY-MM-DD)useLimit
-uses
- applicable only for access_type 3. This is the number of uses the barcode is valid for.
GET /barcodes/{id}
This endpoint retrieves info about a barcode the currently authenticated organization has attached to their lock.
Request Parameters
id
- unique identifierbarcode
- barcode can be used in place of the {id}
Example Request
curl -X GET https://apis.getboxlock.com/barcode/v2/control/barcodes/4DKDIE8
-H βX-API-Key: <ApiKey>β
The above command returns JSON structured like this:
{
"id": int,
"userId": int,
"lockId": int,
"locationId": int,
"barcode": "string",
"accessType": enum,
"enabled": boolean,
"enabledFrom": date,
"enabledTo": date,
"useLimit": int,
"uses": int,
"createdAt": date,
"updatedAt": date
}
GET /barcodes
This endpoint retrieves a list of barcodes the currently authenticated organization has attached to their lock.
Example Request
curl -X GET https://apis.getboxlock.com/barcode/v2/control/barcodes
-H βX-API-Key: <ApiKey>β
The above command returns JSON structured like this:
{
"data": [{
"id": int,
"userId": int,
"lockId": int,
"locationId": int,
"barcode": "string",
"accessType": enum,
"enabled": boolean,
"enabledFrom": date,
"enabledTo": date,
"useLimit": int,
"uses": int,
"createdAt": date,
"updatedAt": date
}]
}
POST /barcodes
This endpoint creates a barcode for the currently authenticated organization has attached to their lock.
Request Body
Parameters
barcode
- barcode to be createdaccessType
- set to 1=unlimited use barcode, 2=time-based barcode, 3=use-based barcode.lockId
- the lock to assign the barcode to (can be null)locationId
- the location to assign the barcode to (can be null)uses
- applicable only for access_type 3. This is the number of uses the barcode is valid for.enabledFrom
- applicable only for access_type 2, this is the date the barcode starts to be valid (YYYY-MM-DD)enabledTo
- applicable only for access_type 2, this is the date the barcode is no longer valid (YYYY-MM-DD)
Example Request
curl -X POST https://apis.getboxlock.com/barcode/v2/control/barcodes/4DKDIE8
-H βX-API-Key: <ApiKey>β
-d {βbarcodeβ: βDKEIE736β, βaccessTypeβ: 1}
The above command returns JSON structured like this:
{
"id": int,
"userId": int,
"lockId": int,
"locationId": int,
"barcode": "string",
"accessType": enum,
"enabled": boolean,
"enabledFrom": date,
"enabledTo": date,
"useLimit": int,
"uses": int,
"createdAt": date,
"updatedAt": date
}
PUT /barcodes
This endpoint updates a barcode for the currently authenticated organization.
Request Body
Parameters
barcode
- barcode to be UaccessType
- set to 1=unlimited use barcode, 2=time-based barcode, 3=use-based barcode.lockId
- the lock to assigned the barcode to (can be null)locationId
- the location to assigned the barcode to (can be null)uses
- applicable only for access_type 3. This is the number of uses the barcode is valid for.enabledFrom
- applicable only for access_type 2, this is the date the barcode starts to be valid (YYYY-MM-DD)enabledTo
- applicable only for access_type 2, this is the date the barcode is no longer valid (YYYY-MM-DD)
Example Request
curl -X PUT https://apis.getboxlock.com/barcode/v2/control/barcodes/4DKDIE8
-H βX-API-Key: <ApiKey>β
-d {βbarcodeβ: βDKEIE736β, βaccessTypeβ: 1}
The above command returns JSON structured like this:
{
"id": int,
"userId": int,
"lockId": int,
"locationId": int,
"barcode": "string",
"accessType": enum,
"enabled": boolean,
"enabledFrom": date,
"enabledTo": date,
"useLimit": int,
"uses": int,
"createdAt": date,
"updatedAt": date
}
DELETE /barcodes/{id}
This endpoint delete a barcode the currently authenticated organization has attached to their lock.
Request Body
Parameters
id
- unique identifierbarcodes
- barcode can be used in place of the {id}
Example Request
curl -X DELETE https://apis.getboxlock.com/barcode/v2/control/barcodes/4DKDIE8
-H βX-API-Key: <ApiKey>β
The above command returns JSON structured like this:
If successful, this request returns a 204 (No Content)
π Return to Home | BoxLock Control
Β© 2024 BOXLOCK, INC. Privacy Policy | Terms & Conditions | Sign-In With Google Security Policy | Vulnerability Disclosure Program