Calven
  1. Occupancy
Calven
  • Overview
  • Key Access Levels
  • Basic Authentication Overview
  • HMAC Authentication Overview
  • SDKs
  • Calven Data Models
  • HMAC Authentication
    • Generate a token with an API key and HMAC
      POST
    • Generate a token with an API key and client secret
      POST
  • Presence
    • Presence Overview
    • Submit presence events with BASIC auth
      POST
    • Submit presence events
      POST
  • Occupancy
    • Occupancy Overview
    • Submit occupancy events
      POST
  • Time off
    • Submit time off updates
      POST
  • Access Credentials
    • Submit access credentials
      POST
  • Warehouse - Basic Auth
    • Warehouse Overview
    • Users
      GET
    • Locations
      GET
    • Desks
      GET
    • Bookings & Attendance
      GET
    • Presence Details
      GET
    • User Actions Log
      GET
  • Warehouse - HMAC Auth
    • Warehouse Overview
    • Users
      GET
    • Locations
      GET
    • Desks
      GET
    • Bookings & Attendance
      GET
    • Presence
      GET
    • User Actions Log
      GET
  1. Occupancy

Submit occupancy events

POST
/v1/occupancy
EventsOccupancy
Submit occupancy events to Calven.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json
sourceId
string 
required
The unique identifier for the presence source - available from the source system configuration screen in back office.
occupancyEvents
array[object (OccupancyEventDto) {6}] 
required
The set of occupancy events to be processed.
timestamp
string 
required
Timestamp of the event.
Example:
2021-09-01T12:00:00.000Z
locationId
string 
required
Calven identifier for the target item where the event occurred.
locationType
enum<string> 
required
Type of target item specified by targetId.
Allowed values:
levellocationplacespacezone
eventId
string 
required
An identifier for this event
occupied
boolean 
required
True/false - is the specified location occupied
occupancy
number 
optional
The occupancy count of the location. If specified, it must be 0 if occupied is false. It may be 0 if occupied is true
Example
{
    "sourceId": "string",
    "occupancyEvents": [
        {
            "timestamp": "2021-09-01T12:00:00.000Z",
            "locationId": "string",
            "locationType": "level",
            "eventId": "string",
            "occupied": true,
            "occupancy": 0
        }
    ]
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.calven.com/v1/occupancy' \
--header 'Content-Type: application/json' \
--data-raw '{
    "sourceId": "string",
    "occupancyEvents": [
        {
            "timestamp": "2021-09-01T12:00:00.000Z",
            "locationId": "string",
            "locationType": "level",
            "eventId": "string",
            "occupied": true,
            "occupancy": 0
        }
    ]
}'

Responses

🟢200Success
application/json
Body
sourceId
string 
required
The unique identifier for the presence source - available from the source system configuration screen in back office.
timestamp
string 
required
Timestamp that the response was generated.
Example:
2021-09-01T12:00:00.000Z
results
array[object (EventResultDto) {3}] 
required
The results for the occupancy events that were submitted
eventId
string 
required
An identifier for this presence event
resultCode
enum<number> 
required
Result code for the event
Allowed values:
01234
message
string 
required
Explanation message associated with the resultCode
Example
{
    "sourceId": "string",
    "timestamp": "2021-09-01T12:00:00.000Z",
    "results": [
        {
            "eventId": "string",
            "resultCode": 0,
            "message": "string"
        }
    ]
}
🟠401Payload when auth header is missing or invalid
Previous
Occupancy Overview
Next
Submit time off updates
Built with