Documentation
Call: GET /<form>
(ie. GET /worktimes)
FindAll can also be called with additional parameters:
GET /<form>?limit=<limit>&offset=<offset>
Maximum amount of rows returned with one request is always 100.
Other bossible parameters are all the fields form contains:
GET /<form>?<field>=<value>
Date field can also be used to filter rows between two dates
GET /<form>?<date>=<from>_<to>
Status field can also be used to filter different statuses
GET /<form>?pid=<partnerid>&row_info.status=all
Forms that contains lot's of rows (ie. worktimes) are indexed by date field. This kind of forms are automatically filtered
with date=CURRENT
when parameter date
is not provided.
Call returns:
status: 200
{ "worktimes": [{ "row_info": { "created": "2014-01-16 15:26:17", "modified": null, "partnerid": "30848", "creatorid": "229215", "status": "normal", "privilege_remove": false, "privilege_edit": false }, "id": 229309, "date": "2014-01-15", "status": "open", "user": 229215, "project": 229291, "task": null, "starttime": "08:00", "endtime": "16:00", "work_hours": "8:00", "description": "unittest insert row comment" }] }
Database- and dropdown-type fields can be queried with multiple values.
Call: GET /<form>?field=value1,value2,...
(ie. GET /worktimes?project=123,124)
API supports sorting of results. It's possible to sort result by any field of form. Also sort by multiple fields is supported. Descending sort is used when minus sign is added after field name (ie. &order=date-,project).
Call: GET /<form>?order=field1,field2,...
(ie. GET /worktimes?order=date)
API supports grouping of results. It's possible to group result by any field of form. Also grouping by multiple fields is supported. All the numeric fields are summed together in result.
Call: GET /<form>?groupBy=field1,field2,...
status: 200
{ "worktimes": [{ "id": 229309, "project": 229291, "task": 0, "work_hours": "8:00" },{ "id": 229310, "project": 229291, "task": 1212, "work_hours": "4:00" }] }
API can send results also with sideloaded relations. This way then number of api calls can be reduces. All related rows in other forms will be added to the response in separate objects.
Call: GET /<form>?sideload
(ie. GET /worktimes?sideload)
status: 200
{ "worktimes": [{ "row_info": { "created": "2014-01-16 15:26:17", "modified": null, "partnerid": "30848", "creatorid": "229215", "status": "normal", "privilege_remove": false, "privilege_edit": false }, "id": 229309, "date": "2014-01-15", "status": "open", "user": 229215, "project": 229291, "task": null, "starttime": "08:00", "endtime": "16:00", "work_hours": "8:00", "description": "unittest insert row comment" }], "projects": [{ "id": 229291, "name": "project name" }], "users": [{ "id": 229215, "firstname": "john", "lastname": "worker" }] }