Movenium REST API 1.1

Documentation

findAll

Call: GET /<form> (ie. GET /worktimes)


Filter parameters

FindAll can also be called with additional parameters:

GET /<form>?limit=<limit>&offset=<offset>
(ie. GET /worktimes?limit=20&offset=60)

Maximum limits

Maximum amount of rows returned with one request is always 100.


Other bossible parameters are all the fields form contains:

GET /<form>?<field>=<value>
(ie. GET /worktimes?user=123&status=open)

Date field can also be used to filter rows between two dates

GET /<form>?<date>=<from>_<to>
(ie. GET /worktimes?date=2014-01-01_2014-01-31)

Status field can also be used to filter different statuses

GET /<form>?pid=<partnerid>&row_info.status=all
(ie. GET /customers?pid=123123&row_info.status=all)

Forms with high amount of rows

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:

example if rows are found (one row)

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"
    }]
}

Searhing with multiple values

Database- and dropdown-type fields can be queried with multiple values.

Call: GET /<form>?field=value1,value2,...
(ie. GET /worktimes?project=123,124)


Sorting

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)


Grouping

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,...

example when &groupBy=project,task is used.

status: 200

{
    "worktimes": [{
        "id": 229309,
        "project": 229291,
        "task": 0,
        "work_hours": "8:00"
    },{
        "id": 229310,
        "project": 229291,
        "task": 1212,
        "work_hours": "4:00"
    }]
}

Sideloaded relations

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)

example when &sideload is used.

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"
    }]
}