Projects
You can list your available projects with the following URL:
GET https://api.smallinvoice.com/project/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 | 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/project/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 Project Objects |
Example content of data variable:
{ "error":false, "page":1, "pages":1, "count":1, "items":[ { "id":1, "name":"Project X", "client_id":16, "description":"Repairing car", "estimate":0, "status":1, "start":"2013-02-25" } ] }
You can get your project with the following URL:
GET https://api.smallinvoice.com/project/get/
URL Parameters
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
id | int | yes | The Id of the project |
Example: Making a request for project with id 5
GET https://api.smallinvoice.com/project/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 Project |
Example content of data variable:
{ "error":false, "item":{ "id":1, "name":"Project X", "client_id":16, "description":"Repairing car", "estimate":0, "costperhour":0, "status":1, "start":"2013-02-25", "assigns":[ { "id":2, "employee":"John Doe", "comment":"My husband", "hours":1.25, "year":2013, "month":2, "day":28, "billed":0 } ] } }
You can add a new project with the following URL:
POST https://api.smallinvoice.com/project/add
Body parameters
Name | Type | Required | Default | Notes |
---|---|---|---|---|
name | string | yes | Name of the project | |
client_id | int | yes | Client id | |
description | string | no | Description of project | |
estimate | float | no | Estimated hours in decimal format | |
costperhour | float | no | Cost per hour in decimal format | |
start | date | no | Date of project start |
Example: Creating a new project
POST https://api.smallinvoice.com/project/add/
Example content of data variable:
{ "name":"Project X", "client_id":16, "description":"Repairing car", "estimate":0, "costperhour":0, "start":"2013-02-25" }
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 Project Object that was created |
Example response:
{ "error":false, "id": 43 }
You can edit an project with the following URL:
POST https://api.smallinvoice.com/project/edit
URL Parameters
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
id | int | yes | The Id of the project |
Body parameters
Name | Type | Notes |
---|---|---|
name | string | Name of the project |
client_id | int | Client id |
description | string | Description of project |
estimate | float | Estimated hours in decimal format |
costperhour | float | Cost per hour in decimal format |
status | int | See Project Statuses |
start | date | Date of project start |
Example: Editing an project with id 5
POST https://api.smallinvoice.com/project/edit/id/5
Example content of data variable:
{ "name":"Project X", "client_id":16, "description":"Repairing car", "estimate":0, "costperhour":0, "status":1, "start":"2013-02-25" }
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 project with the following URL:
POST https://api.smallinvoice.com/project/delete/
URL Parameters
Name | Type | Required | Default | Options | Notes |
---|---|---|---|---|---|
id | int | yes | The Id of the project |
Example: Making a request for deleting project with id 5
POST https://api.smallinvoice.com/project/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 }