You can list your available times with the following URL:

                GET https://api.smallinvoice.com/time/list/
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
limitintno0Limit the amount of results
pageintno1When limiting the results, specifies page
sortstringnodatedateSorts the list by the available values
sorttypestringnodescasc
desc
Defines the way of sorting


Example: Making a request with 100 Results, getting second page, and sorting by date ascending

        GET https://api.smallinvoice.com/time/list/limit/100/page/2/sort/date/sorttype/asc/
    

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.
pageintCurrent page that was passed in on the request
pagesintTotal number of pages available
countintTotal number of objects available
itemscollectionCollection of Time Objects

Example content of data variable:

    {
        "error":false,
        "page":1,
        "pages":1,
        "count":2,
        "items":[
            {
                "id":2,
                "employee":"John Doe",
                "start":1200,
                "end":1500,
                "year":2013,
                "month":2,
                "day":27,
                "date":"2013-02-27"
            },
            {
                "id":1,
                "employee":"Jane Doe",
                "start":700,
                "end":815,
                "year":2013,
                "month":2,
                "day":28,
                "date":"2013-02-28"
            }
        ]
    }
    

You can get your time with the following URL:

                GET https://api.smallinvoice.com/time/get/
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the time


Example: Making a request for time with id 5

                GET https://api.smallinvoice.com/time/get/id/5
            

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.
itemobjectObject of Time

Example content of data variable:

    {
        "error":false,
        "item":{
            "id":1,
            "employee":"John Doe",
            "start":700,
            "end":815,
            "year":2013,
            "month":2,
            "day":28,
            "date":"2013-02-28"
        }
    }
    

You can add a new time with the following URL:

                POST https://api.smallinvoice.com/time/add
            

Body parameters

NameTypeRequiredDefaultNotes
startstringyesStart of time tracking
endstringyesEnd of time tracking
datedateyesDate of time creation


Example: Creating a new time

                POST https://api.smallinvoice.com/time/add/
            

Example content of data variable:
{
    "start":700,
    "end":815,
    "date":"2013-02-28"
}

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.
idintThe Id of the Time Object that was created

Example response:

    {
        "error":false,
        "id": 43
    }
    

You can edit an time with the following URL:

                POST https://api.smallinvoice.com/time/edit
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the time

Body parameters

NameTypeNotes
startstringStart of time tracking
endstringEnd of time tracking
datedateDate of time creation


Example: Editing an time with id 5

                POST https://api.smallinvoice.com/time/edit/id/5
            

Example content of data variable:
{
    "start":700,
    "end":815,
    "date":"2013-02-28"
}

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.

Example response:

    {
        "error":false
    }
    

You can delete an time with the following URL:

                POST https://api.smallinvoice.com/time/delete/
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the time


Example: Making a request for deleting time with id 5

                POST https://api.smallinvoice.com/time/delete/id/5
            

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.

Example response:

    {
        "error":false
    }