API & Custom App Integration </>

api-1.png

CoWorkr provides a simple API for custom integration with your software. This allows users to integrate real-time and historical sensor data with any custom application. Interact with the CoWorkr cloud from anything using a http request.

• REQUEST LIVE AND HISTORICAL SENSOR DATA PER SEAT, FLOOR PLAN INFORMATION, WORKPLACE INFORMATION

• USE WITH ROOM BOOKING, FACILITIES MANAGEMENT, CHAT, AND OTHER INDUSTRY SOFTWARE

• SLACK, SPARK, AND FACEBOOK BOTS COMING 2017

SPARK INTEGRATION EXAMPLE

SPARK INTEGRATION EXAMPLE

 
FM INTEGRATION EXAMPLE

FM INTEGRATION EXAMPLE

 
 
 

CoWorkr API Documentation

The CoWorkr API allows users to integrate real-time and historical sensor data with any custom application. Interact with the CoWorkr Cloud from anything using a HTTP request. 


 

Basics

 
You will need an authorized and enabled CoWorkr account and project to access the API endpoints. All calls are over HTTPS and the returns are all in JSON.
 

EndPoint Servers

  • internal-us.coworkr.co - US Production server for API use. Available fall of 2016
  • internal-asia.coworkr.co - Asia Production server for API use. Available fall of 2016
 
*For calls to asia servers, please replace "us.coworkr.co" with "asia.coworkr.co"

Authentication

A login call with curl:
  curl https://internal-us.coworkr.co/api/login/ -d "username=XXXXX&password=XXXXXX"
Response
{ status: "success", data: {authToken: "xxxxxxxxxxxxxxxxxx", userId: xxxxxxxxxxxx} }

You'll need to save the userId and token on the client for subsequent authenticated requests

 

Authenticated Calls:

 
For any endpoints that require the default authentication, you must include the userId and authToken with each request under the following headers: - X-User-Id - X-Auth-Token
  • example:curl -H "X-Auth-Token: XXXXXXXXX" -H "X-User-Id: XXXXXXXXXXXXXX" https://internal-us.coworkr.co/api/workPlaces

WORKPLACES

You can query the system for the workPlaces and contents to which you have access

Example using curl:

curl -H "X-Auth-Token: XXXXXXXX" -H "X-User-Id: XXXXXXXXX" https://internal-us.coworkr.co/api/workPlaces

Response

{
"_id": "XXXXXXXXXXXXXX",
"name": "XX XXXXX",
"address": "1180 N Lemon Ave, Menlo Park, CA 94025, USA",
"group": {
"name": "XXXX' Group",
"id": "XXXXXXXXXX"
},
"owner": "Company A",
"formattedAddress": "1180 N Lemon Ave, Menlo Park, CA 94025, USA",
"location": {
"type": "Point",
"coordinates": [
-XXX.197805,
XX.437403
]
},
"timezone": "America/Adak",
"sleep": true,
"start": "2015-01-01T10:00:00.000Z",
"end": "",
"activeStartHour": "8",
"activeEndHour": "18"
}

FloorPlans of Workplace

You can query the system for the floorPlans of a workPlace.

Example using curl

curl -H "X-Auth-Token: XXXXXXXXX" -H "X-User-Id: XXXXXXX" https://internal-us.coworkr.co/api/workPlace/[workPlaceId]/floorPlans

Response

[
 {
"_id": "XXXXXXXXX",
"name": "Test Floor",
"photo": {
"width": 842,
"height": 569
},
"workPlaceId": "XXXXXXX",
"owner": "Jane",
"workPlaceName": "Office 2a",
"activeHours": {
"start": "8",
"end": "18"
},
"timezone": "America/Adak"
}
]

Workplace Sensor Status

You can query for the status of workPoints for a workPlace

Example using curl

curl -H "X-Auth-Token: XXXXXXXXX" -H "X-User-Id: XXXXXX" https://internal-us.coworkr.co/api/workPlace/[workPlaceId]/workPoints

Response

[
 {
"_id": "XXXXXX",
"uuid": "XXX-Xxx-Xxxx",
"name": "Desk123",
"firmwareVersion": "2:73",
"workPlaceId": "XXXXXXXXXX",
"workPlaceName": "Office1b",
"lastConnect": "2016-08-22T01:14:32.820Z",
"connected": true,
"recentlyConnected": true,
"occupied": true,
"occupiedBy": "decay",
"occupyReason": "VIBRATION ACTIVE BY DECAY 79 (25:0 var=11.6)",
"rssi": -91,
"battery": 37,
"optical": 8.77,
"floorPlanId": "XXXXXXX",
"floorPlanX": 679,
"floorPlanY": 306,
"floorPlanName": "Floorplan1A",
"tags": {
"type": "XXXX",
"room": "open"
},
"notes": "Battery"
}
]

FLOORPLAN workpoint Status

You can query for the status of workPoints for a floorPlan

Example using curl

curl -H "X-Auth-Token: XXXXXXX" -H "X-User-Id: XXXXX" https://internal-us.coworkr.co/api/workPlace/[workPlaceId]/floorPlan/[floorPlanId]/workPoints

return

[
 {
"_id": "XXXXX",
"uuid": "XXXXXXXXXXXXXXXX",
"name": "Table Vibration",
"firmwareVersion": "2:73",
"workPlaceId": "XXXXXXXXXXXX",
"workPlaceName": "XXXXXXXX",
"lastConnect": "2016-08-22T01:14:32.820Z",
"connected": true,
"recentlyConnected": true,
"occupied": true,
"occupiedBy": "decay",
"occupyReason": "VIBRATION ACTIVE BY DECAY 79 (25:0 var=11.6)",
"rssi": -91,
"battery": 37,
"optical": 8.77,
"floorPlanId": "XXXXXXXX",
"floorPlanX": 679,
"floorPlanY": 306,
"floorPlanName": "Greatroom",
"tags": {
"type": "XXXX",
"room": "conference"
},
"notes": "Battery"
}
]