Bookings API

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

GET

Get All Bookings | Authenticated

Syntax:

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

e.g.

GET http://localhost/staffmap4/ProjectName/api/Booking
GET https://acme.com/staffmap4/MainOffice/api/Booking


Get All Bookings | URL

Syntax:

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

e.g.

http://localhost/staffmap4/ProjectName/api/Booking?apikey=aP2bjYAeeYrUx0hPYQ 
https://acme.com/staffmap4/MainOffice/api/Booking?apikey=l4MZnM2Y58lwVgubQn


Get One Booking | Authenticated

Syntax:

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

e.g.

GET http://localhost/staffmap4/ProjectName/api/Booking/20191104110235817
GET https://acme.com/staffmap4/MainOffice/api/Booking/20180921194845701


Get One Booking | URL

Syntax:

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

e.g.

http://localhost/staffmap4/ProjectName/api/Booking/20180921194845701?apikey=aP2bjYAeeYrUx0hPYQ 


Result (two records)

[
    {
        "starttime": "2020-03-11",
        "endtime": "2020-03-11 11:59:00 PM",
        "description": "",
        "desk_id": "20180924101123994",
        "createdby": "",
        "employee_id": "201503050132020222",
        "booking_id": "20200207093434164",
        "category": "",
        "title": "",
        "bookingtype": "",
        "recurrence": ""
    },
    {
        "starttime": "2020-03-11",
        "endtime": "2020-03-11 11:59:00 PM",
        "description": "",
        "desk_id": "20180918160644525",
        "createdby": "",
        "employee_id": "201504221052302424",
        "booking_id": "20200207093457905",
        "category": "",
        "title": "",
        "bookingtype": "recurrence",
        "recurrence": "Tu,We"
    }
]

POST (create)

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

POST | Authenticated

Syntax:

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

e.g.

POST http://localhost/staffmap4/ProjectName/api/Booking/?name=Printer17&Manufacturer=Canon
POST https://acme.com/staffmap4/ProjectName/api/Booking/?name=Microwave&category=Kitchen&size=medium

Result

[
    {
        "id": "2020020726122423"
    },
    {
        "status": "Booking record successfully added"
    }
]

PUT (update)

PUT | Authenticated

Syntax:

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

e.g.

PUT http://localhost/staffmap4/ProjectName/api/Booking/2020020679547848?status=broken&dateupdated=2020-02-07
PUT https://acme.com/staffmap4/MainOffice/api/Booking/2020020619325472?employee_id=2018928791&name=Personal Printer

Result

[
    {
        "status": "Booking record successfully updated"
    }
]

DELETE

Delete | Authenticated

Syntax:

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

e.g.

DELETE http://localhost/staffmap4/ProjectName/api/Booking/201711300130174407
DELETE https://acme.com/staffmap4/MainOffice/api/Booking/2020020630313932

Result

[
    {
        "status": "Booking record successfully deleted"
    }
]