Times
You can list your available times with the following URL:
GET https://api.smallinvoice.com/time/list/
URL Parameters
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
limit | int | no | 0 | Limit the amount of results | |
page | int | no | 1 | When limiting the results, specifies page | |
sort | string | no | date | date | Sorts the list by the available values |
sorttype | string | no | desc | asc 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
Name | Type | Notes |
---|---|---|
error | boolean | Is true if an error occured |
errorcode | int | Code of the error. Only returned if error is true. |
errormessage | string | Informational message about the error. Only returned if error is true. |
page | int | Current page that was passed in on the request |
pages | int | Total number of pages available |
count | int | Total number of objects available |
items | collection | Collection 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
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
id | int | yes | The Id of the time |
Example: Making a request for time with id 5
GET https://api.smallinvoice.com/time/get/id/5
Response
Name | Type | Notes |
---|---|---|
error | boolean | Is true if an error occured |
errorcode | int | Code of the error. Only returned if error is true. |
errormessage | string | Informational message about the error. Only returned if error is true. |
item | object | Object 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
Name | Type | Required | Default | Notes |
---|---|---|---|---|
start | string | yes | Start of time tracking | |
end | string | yes | End of time tracking | |
date | date | yes | Date 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
Name | Type | Notes |
---|---|---|
error | boolean | Is true if an error occured |
errorcode | int | Code of the error. Only returned if error is true. |
errormessage | string | Informational message about the error. Only returned if error is true. |
id | int | The 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
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
id | int | yes | The Id of the time |
Body parameters
Name | Type | Notes |
---|---|---|
start | string | Start of time tracking |
end | string | End of time tracking |
date | date | Date 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
Name | Type | Notes |
---|---|---|
error | boolean | Is true if an error occured |
errorcode | int | Code of the error. Only returned if error is true. |
errormessage | string | Informational 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
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
id | int | yes | The Id of the time |
Example: Making a request for deleting time with id 5
POST https://api.smallinvoice.com/time/delete/id/5
Response
Name | Type | Notes |
---|---|---|
error | boolean | Is true if an error occured |
errorcode | int | Code of the error. Only returned if error is true. |
errormessage | string | Informational message about the error. Only returned if error is true. |
Example response:
{ "error":false }