Assigns
You can list your available assigns with the following URL:
GET https://api.smallinvoice.com/assign/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 | name | name number | 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/assign/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 Assign Objects |
Example content of data variable:
{ "error":false, "page":1, "pages":1, "count":2, "items":[ { "id":3, "type":4, "type_id":16, "name":"Working for Project X", "employee":"John Doe", "hours":3, "year":2013, "month":2, "day":27, "date":"2013-02-27", "activity":"", "comment":"Repairing car", "billed":0 }, { "id":2, "type":1, "type_id":1, "name":"Working for Project Y", "employee":"Jane Doe", "hours":1.25, "year":2013, "month":2, "day":28, "date":"2013-02-28", "activity":"", "comment":"Cleaning house", "billed":0 } ] }
You can get your assign with the following URL:
GET https://api.smallinvoice.com/assign/get/
URL Parameters
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
id | int | yes | The Id of the assign |
Example: Making a request for assign with id 5
GET https://api.smallinvoice.com/assign/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 Assign |
Example content of data variable:
{ "error":false, "item":{ "id":3, "type":4, "type_id":16, "name":"Working for Project X", "employee":"John Doe", "hours":3, "year":2013, "month":2, "day":27, "date":"2013-02-27", "activity":"", "comment":"Repairing car", "billed":0 } }
You can add a new assign with the following URL:
POST https://api.smallinvoice.com/assign/add
Body parameters
Name | Type | Required | Default | Notes |
---|---|---|---|---|
type | int | yes | See Assign Types | |
type_id | int | yes | Id of assigned type | |
hours | float | yes | Assigned hours | |
date | date | yes | Day of setting the assignment | |
activity | string | no | Activity name | |
comment | string | no | Comment to assignment |
Example: Creating a new assign
POST https://api.smallinvoice.com/assign/add/
Example content of data variable:
{ "type":4, "type_id":16, "hours":3, "date":"2013-02-27", "activity":"", "comment":"Repairing car" }
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 Assign Object that was created |
Example response:
{ "error":false, "id": 43 }
You can edit an assign with the following URL:
POST https://api.smallinvoice.com/assign/edit
URL Parameters
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
id | int | yes | The Id of the assign |
Body parameters
Name | Type | Notes |
---|---|---|
type | int | See Assign Types |
type_id | int | Id of assigned type |
hours | float | Assigned hours |
date | date | Day of setting the assignment |
activity | string | Activity name |
comment | string | Comment to assignment |
Example: Editing an assign with id 5
POST https://api.smallinvoice.com/assign/edit/id/5
Example content of data variable:
{ "type":4, "type_id":16, "name":"Working for Project Y", "employee":"Jane Doe", "hours":3, "year":2013, "month":2, "day":27, "date":"2013-02-27", "activity":"", "comment":"Cleaning house", "billed":0 }
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 assign with the following URL:
POST https://api.smallinvoice.com/assign/delete/
URL Parameters
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
id | int | yes | The Id of the assign |
Example: Making a request for deleting assign with id 5
POST https://api.smallinvoice.com/assign/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 }