Desks API

The Staffmap API allows you to do the following with Desk records:

GET

Get All Desks | Authenticated

Syntax:

GET {Domain}/staffmap4/{ProjectName}/api/Desk

e.g.

GET http://localhost/staffmap4/ProjectName/api/Desk

GET https://acme.com/staffmap4/MainOffice/api/Desk


Get All Desks | URL

Syntax:

{Domain}/staffmap4/{ProjectName}/api/Desk?apikey={APIKey}

e.g.

http://localhost/staffmap4/ProjectName/api/Desk?apikey=aP2bjYAeeYrUx0hPYQ

https://acme.com/staffmap4/MainOffice/api/Desk?apikey=l4MZnM2Y58lwVgubQn


Get One Desk | Authenticated

Syntax:

GET {Domain}/staffmap4/{ProjectName}/api/Desk/{id}

e.g.

GET http://localhost/staffmap4/ProjectName/api/Desk/chzoer4gwqvv

GET https://acme.com/staffmap4/MainOffice/api/Desk/6lnnh96x6hj0


Get One Desk | URL

Syntax:

{Domain}/staffmap4/{ProjectName}/api/Desk/{id}?apikey={APIKey}

e.g.

http://localhost/staffmap4/ProjectName/api/Desk/6lnnh96x6hj0?apikey=aP2bjYAeeYrUx0hPYQ


Result (two records)

[

{

"desk_id": "xe1415dvpx6x",

"deskname": "Desk 20",

"top": "1110",

"left": "1578",

"width": "-1",

"height": "-1",

"floor_id": "201804280603417960",

"picalign": "top",

"category": "Desk",

"seats": "1",

"bookable": "True",

"phone": "True",

"window": "True",

"computer": "True",

"monitor": "True",

"printer": "False",

"ethernet jack": "True",

"projector": "False",

"coffee": "False",

"whiteboard": "False",

"customclickurl": "",

"key": "",

"latitude": "",

"longitude": ""

},

{

"desk_id": "201504151233041939",

"deskname": "Office 02",

"top": "295",

"left": "158",

"width": "-1",

"height": "-1",

"floor_id": "4",

"picalign": "left",

"category": "Office",

"seats": "1",

"bookable": "True",

"phone": "True",

"window": "True",

"computer": "True",

"monitor": "True",

"printer": "True",

"ethernet jack": "True",

"projector": "False",

"coffee": "False",

"whiteboard": "True",

"customclickurl": "",

"key": "",

"latitude": "",

"longitude": ""

}

]

POST (create)

When creating a new record, the unique desk ID will be automatically created and does not need to be included as parameter.

POST | Authenticated

Syntax:

POST {Domain}/staffmap4/{ProjectName}/api/Desk/?{parameter1:value1}&{parameter2}:{value2}...

e.g.

POST http://localhost/staffmap4/ProjectName/api/Desk/?deskname=AC-323&phone=True&seats=2

POST https://acme.com/staffmap4/ProjectName/api/Desk/?deskname=Shared Desk 4&bookable=True

Result

[

{

"desk_id": "2020020726122423"

},

{

"status": "Desk record successfully added"

}

]

PUT (update)

PUT | Authenticated

Syntax:

PUT {Domain}/staffmap4/{ProjectName}/api/Desk/{id}?{parameter1=value1}&{parameter2=value2}...

e.g.

PUT http://localhost/staffmap4/ProjectName/api/Desk/2020020679547848?deskname=TB-21

PUT https://acme.com/staffmap4/MainOffice/api/Desk/2020020619325472?bookable=False&Projector=False

Result

[

{

"status": "Desk record successfully updated"

}

]

DELETE

Delete | Authenticated

Syntax:

DELETE {Domain}/staffmap4/{ProjectName}/api/Desk/{id}

e.g.

DELETE http://localhost/staffmap4/ProjectName/api/Desk/201711300130174407

DELETE https://acme.com/staffmap4/MainOffice/api/Desk/2020020630313932

Result

[

{

"status": "Desk record successfully deleted"

}

]