All
All command is useful when you want to get all companies, including archived and trashed ones. Here we have three companies:
Response: HTTP 200, application/json (Hide)
GET /companies
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
[
{
"id": 1,
"class": "Company",
"url_path": "\/companies\/1",
"name": "Owner Company",
"members": [
1
],
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"is_archived": false,
"created_on": 1430164537,
"created_by_id": 1,
"updated_on": 1430164537,
"updated_by_id": 1,
"address": null,
"phone": null,
"homepage_url": null,
"tax_id": null,
"currency_id": null,
"is_owner": true,
"has_note": false
},
{
"id": 2,
"class": "Company",
"url_path": "\/companies\/2",
"name": "Company to be Archived",
"members": [],
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"is_archived": false,
"created_on": 1430164539,
"created_by_id": 1,
"updated_on": 1430164539,
"updated_by_id": 1,
"address": null,
"phone": null,
"homepage_url": null,
"tax_id": null,
"currency_id": null,
"is_owner": false,
"has_note": false
},
{
"id": 3,
"class": "Company",
"url_path": "\/companies\/3",
"name": "Company to be Trashed",
"members": [],
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"is_archived": false,
"created_on": 1430164539,
"created_by_id": 1,
"updated_on": 1430164539,
"updated_by_id": 1,
"address": null,
"phone": null,
"homepage_url": null,
"tax_id": null,
"currency_id": null,
"is_owner": false,
"has_note": false
}
]We'll move second to archive and third to Trash:
Response: HTTP 200, application/json (Hide)
PUT /move-to-archive/company/2
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
{
"single": {
"id": 2,
"class": "Company",
"url_path": "\/companies\/2",
"name": "Company to be Archived",
"members": [],
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"is_archived": true,
"created_on": 1430164539,
"created_by_id": 1,
"updated_on": 1430164540,
"updated_by_id": 1,
"address": null,
"phone": null,
"homepage_url": null,
"tax_id": null,
"currency_id": null,
"is_owner": false,
"has_note": false
},
"hourly_rates": {
"1": 100
},
"active_projects_count": 0
}Response: HTTP 200, application/json (Hide)
PUT /move-to-trash/company/3
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
{
"single": {
"id": 3,
"class": "Company",
"url_path": "\/companies\/3",
"name": "Company to be Trashed",
"members": [],
"is_trashed": true,
"trashed_on": 1430164540,
"trashed_by_id": 1,
"is_archived": false,
"created_on": 1430164539,
"created_by_id": 1,
"updated_on": 1430164540,
"updated_by_id": 1,
"address": null,
"phone": null,
"homepage_url": null,
"tax_id": null,
"currency_id": null,
"is_owner": false,
"has_note": false
},
"hourly_rates": {
"1": 100
},
"active_projects_count": 0
}Now when we list companies, we'll get only active company:
Response: HTTP 200, application/json (Hide)
GET /companies
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
[
{
"id": 1,
"class": "Company",
"url_path": "\/companies\/1",
"name": "Owner Company",
"members": [
1
],
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"is_archived": false,
"created_on": 1430164537,
"created_by_id": 1,
"updated_on": 1430164537,
"updated_by_id": 1,
"address": null,
"phone": null,
"homepage_url": null,
"tax_id": null,
"currency_id": null,
"is_owner": true,
"has_note": false
}
]To list all companies, including archived and trashed ones, call /companies/all:
Response: HTTP 200, application/json (Hide)
GET /companies/all
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
[
{
"id": 1,
"class": "Company",
"url_path": "\/companies\/1",
"name": "Owner Company",
"members": [
1
],
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"is_archived": false,
"created_on": 1430164537,
"created_by_id": 1,
"updated_on": 1430164537,
"updated_by_id": 1,
"address": null,
"phone": null,
"homepage_url": null,
"tax_id": null,
"currency_id": null,
"is_owner": true,
"has_note": false
},
{
"id": 2,
"class": "Company",
"url_path": "\/companies\/2",
"name": "Company to be Archived",
"members": [],
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"is_archived": true,
"created_on": 1430164539,
"created_by_id": 1,
"updated_on": 1430164540,
"updated_by_id": 1,
"address": null,
"phone": null,
"homepage_url": null,
"tax_id": null,
"currency_id": null,
"is_owner": false,
"has_note": false
},
{
"id": 3,
"class": "Company",
"url_path": "\/companies\/3",
"name": "Company to be Trashed",
"members": [],
"is_trashed": true,
"trashed_on": 1430164540,
"trashed_by_id": 1,
"is_archived": false,
"created_on": 1430164539,
"created_by_id": 1,
"updated_on": 1430164540,
"updated_by_id": 1,
"address": null,
"phone": null,
"homepage_url": null,
"tax_id": null,
"currency_id": null,
"is_owner": false,
"has_note": false
}
]