Staffmap API
The API response is formatted as JSON (Javascript Object Notation). A JSON object looks like a Javascript object. Each property and value must be wrapped with double quotation marks, like so:
{
"property1": "value1",
"property2": "value2",
"property3": "value3"
}
Interacting with the API
The Staffmap API can be interacted with via URL, command line tools such as cURL, or software such as Postman (https://www.postman.com/ ). GET commands can work directly with a URL, but POST, PUT, and DELETE requests need to be called from code, command line, or a tool like Postman.
An API key must be generated from the project settings to enable the API.
fieldnames and values can be passed in via URL or as query parameters (in Postman). The API key can also be passed in with the URL, or as a query parameter.
Postman
API key as query parameters:
API key through authorization header as query parameters:
Adding a new user via POST:
cURL
curl -X GET http://localhost/staffmap4/MyApiProject/api/Employee?apikey=/w/vq2Xp9KEFXo1sA
curl -X DELETE http://localhost/staffmap4/MyApiProject/api/Employee/201711300130174407?apikey=/w/vq2Xp9KEFXo1sA
curl -X POST http://localhost/staffmap4/MyApiProject/api/Employee/?firstname=George&lastname=Hamilton&username=ghamilton&department=Accounting&apikey=/w/vq2Xp9KEFXo1sA