POST | https://[domain].omnidesk.ru/api/companies.json
{
"company" : {
"company_name" : "New Company",
"company_domains" : "company.ru",
"company_default_group" : 492,
"company_address" : "Some address",
"company_note" : "Some note",
"company_users" : "1351,1348,1347"
}
}
{
"company" : {
"company_id" : 200,
"company_name" : "New Company",
"company_domains" : "company.ru",
"company_default_group" : 492,
"company_address" : "Some address",
"company_note" : "Some note",
"active" : true,
"deleted" : false,
"created_at" : "Mon, 05 May 2014 00:15:17 +0300",
"updated_at" : "Tue, 23 Dec 2014 10:55:23 +0200"
}
}
curl -u [staff_email]:[api_key] -H "Content-Type: application/json" -X POST -d '{ "company": {"company_name":"New Company","company_domains":"company.ru","company_default_group":492,"company_address":"Some address","company_note":"Some note","сompany_users":"1351,1348,1347"}}' https://[domain].omnidesk.ru/api/companies.json
GET | https://[domain].omnidesk.ru/api/companies.json
{
"0": {
"company" : {
"company_id" : 200,
"company_name" : "New Company",
"company_domains" : "company.ru",
"company_default_group" : 492,
"company_address" : "Some address",
"company_note" : "Some note",
"active" : true,
"deleted" : false,
"created_at" : "Mon, 05 May 2014 00:15:17 +0300",
"updated_at" : "Tue, 23 Dec 2014 10:55:23 +0200",
"amount_of_users" : 125
},
"1": {
"company" : {
"company_id" : 300,
"company_name" : "New Company 2",
"company_domains" : "company.ru",
"company_default_group" : 492,
"company_address" : "Some address",
"company_note" : "Some note",
"active" : true,
"deleted" : false,
"created_at" : "Mon, 05 May 2014 00:15:17 +0300",
"updated_at" : "Tue, 23 Dec 2014 10:55:23 +0200",
"amount_of_users" : 125
},
"total_count":20
}
curl -u [staff_email]:[api_key] -H "Content-Type: application/json" -X GET https://[domain].omnidesk.ru/api/companies.json?limit=50&page=2&amount_of_users=true
GET | https://[domain].omnidesk.ru/api/companies/[id].json
{
"company" : {
"company_id" : 200,
"company_name" : "New Company",
"company_domains" : "company.ru",
"company_default_group" : 492,
"company_address" : "Some address",
"company_note" : "Some note",
"active" : true,
"deleted" : false,
"created_at" : "Mon, 05 May 2014 00:15:17 +0300",
"updated_at" : "Tue, 23 Dec 2014 10:55:23 +0200"
}
}
curl -u [staff_email]:[api_key] -H "Content-Type: application/json" -X GET https://[domain].omnidesk.ru/api/companies/200.json
PUT | https://[domain].omnidesk.ru/api/companies/[id].json
{
"company" : {
"company_name" : "Company's full name changed",
"company_note" : "New note",
"add_company_domains" : "newcompany.ru",
"remove_company_domains" : "company.ru"
}
}
{
"company" : {
"company_id" : 200,
"company_name" : "Company's full name changed",
"company_domains" : "newcompany.ru",
"company_default_group" : 492,
"company_address" : "Some address",
"company_note" : "New note",
"active" : true,
"deleted" : false,
"created_at" : "Mon, 05 May 2014 00:15:17 +0300",
"updated_at" : "Tue, 23 Dec 2014 10:55:23 +0200"
}
}
curl -u [staff_email]:[api_key] -H "Content-Type: application/json" -X PUT -d '{ "company": {"company_name":"Company's full name changed","company_note":"New note","add_company_domains":"newcompany.ru","remove_company_domains":"company.ru"}}' https://[domain].omnidesk.ru/api/companies/200.json
PUT | https://[domain].omnidesk.ru/api/companies/[id]/disable.json
{
"company" : {
"company_id" : 200,
"company_name" : "Company's full name changed",
"company_domains" : "newcompany.ru",
"company_default_group" : 492,
"company_address" : "Some address",
"company_note" : "New note",
"active" : true,
"deleted" : true,
"created_at" : "Mon, 05 May 2014 00:15:17 +0300",
"updated_at" : "Tue, 23 Dec 2014 10:55:23 +0200"
}
}
curl -u [staff_email]:[api_key] -H "Content-Type: application/json" -X PUT -d '' https://[domain].omnidesk.ru/api/companies/200/disable.json
PUT | https://[domain].omnidesk.ru/api/companies/[id]/block.json
{
"company" : {
"company_id" : 200,
"company_name" : "Company's full name changed",
"company_domains" : "newcompany.ru",
"company_default_group" : 492,
"company_address" : "Some address",
"company_note" : "New note",
"active" : false,
"deleted" : false,
"created_at" : "Mon, 05 May 2014 00:15:17 +0300",
"updated_at" : "Tue, 23 Dec 2014 10:55:23 +0200"
}
}
curl -u [staff_email]:[api_key] -H "Content-Type: application/json" -X PUT -d '' https://[domain].omnidesk.ru/api/companies/200/block.json
PUT | https://[domain].omnidesk.ru/api/companies/[id]/restore.json
{
"company" : {
"company_id" : 200,
"company_name" : "Company's full name changed",
"company_domains" : "newcompany.ru",
"company_default_group" : 492,
"company_address" : "Some address",
"company_note" : "New note",
"active" : true,
"deleted" : false,
"created_at" : "Mon, 05 May 2014 00:15:17 +0300",
"updated_at" : "Tue, 23 Dec 2014 10:55:23 +0200"
}
}
curl -u [staff_email]:[api_key] -H "Content-Type: application/json" -X PUT -d '' https://[domain].omnidesk.ru/api/companies/200/restore.json
DELETE | https://[domain].omnidesk.ru/api/companies/[id].json
HTTP Status: 200 OK
curl -u [staff_email]:[api_key] -H "Content-Type: application/json" -X DELETE https://[domain].omnidesk.ru/api/companies/200.json