API Documentation - sinahub/WebtoolsAPI GitHub Wiki
The format of API's are like the following:
Query all records
GET: api/[entityName]
.Query one record
GET: api/[entityName]/{id}
.Insert record
POST: api/[entityName]
with the parameters shown in the Entity List.Update a record
PUT: api/organisations/{id}
with the parameters shown in the Entity List.Delete a record
DELETE: api/organisations/{id}
.
Entity List
Entity | Inputs | Comments |
---|---|---|
organisations | "name" | |
branches | "name"?, "organisation_id"? | At least one of the parameters are mandatory. |
staff | "name", "branch_id" |
Eamples
GET: api/branches
fetches list of branches.
POST: api/organisations?name=Webtools
Inserts a new record in organisation table.
POST: api/branches?name=Melbourne&organisation_id=1
Inserts a new record in organisation table.
POST: api/staff?name=John Smith&branch_id=1
Inserts a new record in staff table.
PUT: api/staff/1?name=Jane Smith
updates the staff record #1
DELETE api/branches/1
Deletes branch #1 and all of related staff