Employees API

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

GET

Get All Employees | Authenticated

Syntax:

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

e.g.

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


Get All Employees | URL

Syntax:

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

e.g.

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


Get One Employee | Authenticated

Syntax:

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

e.g.

GET http://localhost/staffmap4/ProjectName/api/Employee/201504211012066290
GET https://acme.com/staffmap4/MainOffice/api/Employee/201506031134454224


Get One Employee | URL

Syntax:

[Domain]/staffmap4/[ProjectName]/api/Employee/[id]?apikey=[APIKey]

e.g.

http://localhost/staffmap4/ProjectName/api/Employee/[id]?apikey=aP2bjYAeeYrUx0hPYQ 


Result (two records)


[
    {
        "id": "201711300130174407",
        "floor_id": "201804280603417960",
        "top": "186",
        "left": "306",
        "width": "-1",
        "height": "-1",
        "email": "JDelanio@Company.com",
        "lastname": "Delanio",
        "firstname": "James",
        "securitygroup_id": "3",
        "desk_id": "",
        "extension": "229",
        "city": "",
        "state": "",
        "zip": "",
        "country": "",
        "picalign": "top",
        "address": "",
        "latitude": "0",
        "longitude": "0",
        "username": "JDelanio",
        "customclickurl": "",
        "department": "Marketing",
        "employee id": "52675",
        "position": "Content Creator",
        "sys_adimagebytes": "0",
        "enable my ical": "",
        "category": ""
    },
    {
        "id": "201411300130174407",
        "floor_id": "201804280603417960",
        "top": "786",
        "left": "1324",
        "width": "-1",
        "height": "-1",
        "email": "GTraders@Company.com",
        "lastname": "Traders",
        "firstname": "George",
        "securitygroup_id": "3",
        "desk_id": "",
        "extension": "246",
        "city": "",
        "state": "",
        "zip": "",
        "country": "",
        "picalign": "top",
        "address": "",
        "latitude": "0",
        "longitude": "0",
        "username": "GTraders",
        "customclickurl": "",
        "department": "Marketing",
        "employee id": "34238",
        "position": "Social Media Coordinator",
        "sys_adimagebytes": "",
        "enable my ical": "",
        "category": ""
 ]

POST (create)

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

POST | Authenticated

Syntax:

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

e.g.

POST http://localhost/staffmap4/ProjectName/api/Employee/?firstname=George&lastname=Hamilton&username=ghamilton&department=Accounting

POST https://acme.com/staffmap4/ProjectName/api/Employee/?firstname=Marika&lastname=Harris&username=mharris&position=CEO

Result

[
    {
        "id": "202002065333475"
    },
    {
        "status": "Employee record successfully added"
    }
]

PUT (update)

PUT | Authenticated

Syntax:

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

e.g.

PUT http://localhost/staffmap4/ProjectName/api/Employee/2020020679547848?department:Operations
PUT https://acme.com/staffmap4/MainOffice/api/Employee/2020020619325472?lastname=Kovac&position=Mediator

Result

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

DELETE

Delete | Authenticated

Syntax:

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

e.g.

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

Result

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