This is the company management API. It allows resellers to update client company parameters.
To enable the API, please contact omNovia Sales.
Note: You will need to have a skilled web programmer who has a strong knowledge of programming languages such as PHP in order to implement these APIs.
API Methods
Get list of client companies for a Reseller
Get info for a specific client company
Get list of client companies for a Reseller
Using this function, you can retrieve the entire list of companies. Please see the example below in the sample code section.
Required Parameters:
(int) resellerCompanyID //Found in Modify Organization Settings section of the admin page (str) resellerCompanyPass //Found in Modify Organization Settings section of the admin page (str) action //Must be 'getCompanyList'
Sample Code:
<?php function getCompanyList($url) { $params = array( 'action' => 'getCompanyList', 'resellerCompanyID' => 1234, 'resellerCompanyPass' => 'mypass1234' ); $resp = callRemote($url, $params, true); header("Content-type: text/xml"); print_r($resp); }
Sample Output:
<root> <company> <companyID>24521</companyID> <name>Joes Company</name> </company> <company> <companyID>34535</companyID> <name>Mega Corp</name> </company> . . . </root>
Get info for a specific client company
Using this function, you are able company details for a specific client company. Please see the example below in the sample code section.
Required Parameters:
(int) resellerCompanyID //Found in Modify Organization Settings section of the admin page (str) resellerCompanyPass //Found in Modify Organization Settings section of the admin page (str) action //Must be 'getCompanyInfo' (int) companyID //The companyID of the company you want details for.
Sample Code:
<?php function getCompanyInfo($url) { $params = array( 'action' => 'getCompanyInfo', 'resellerCompanyID' => 1234, 'resellerCompanyPass' => 'myresellpass1234', 'companyID' => 9898 ); $resp = callRemote($url, $params, true); header("Content-type: text/xml"); print_r($resp); } ?>
Sample Output
<root> <companyID>12452</companyID> <name>Test Company Name</name> <password>823953companypass</password> <shorturl>testcompany</shorturl> <expireDate>2013-01-31</expireDate> <sso_enabled>1</sso_enabled> </root>
Update properties for a client company
Using this function, you are able to edit some of the company properties. Please see the example below in the sample code section.
Required Parameters:
(int) resellerCompanyID //Found in Modify Organization Settings section of the admin page (str) resellerCompanyPass //Found in Modify Organization Settings section of the admin page (str) action //Must be 'updateCompanyProperties' (int) companyID //companyID of the company you wish to update (str) companyPass //password of the companyID you are updating Optional Parameters: (int) sso_enabled //1=sso enabled, 0=sso not enabled (str) expireDate //Expiration date in YYYY-MM-DD (bin) logo //Binary of logo image - Must be sent via POST (not GET)
Sample Code:
<?php function updateCompany($url) { $params = array( 'action' => 'updateCompanyProperties', 'resellerCompanyID' => 1234, 'resellerCompanyPass' => 'resellcompanypass1234', 'companyID' => 4582, 'companyPass' => 'clcomppass5566', 'sso_enabled' => 1, 'expireDate' => '2013-01-31', 'logo' => "@/path/to/logo" ); $resp = callRemote($url, $params, true); header("Content-type: text/xml"); print_r($resp); } ?>
Sample Output
<root> <status>success</status> <companyID>4582</companyID> <sso_enabled>1</sso_enabled> <expireDate>2013-01-31</expireDate> <logo>updated</logo> </root>
Delete a Company
Using this function, you can delete a client company. Please see the example below in the sample code section.
Required Parameters:
(int) resellerCompanyID //Found in Modify Organization Settings section of the admin page (str) resellerCompanyPass //Found in Modify Organization Settings section of the admin page (str) action //Must be 'deleteCompany' (int) companyID //companyID of the company you wish to delete (str) companyPass //password of the companyID you are deleting
Sample Code:
<?php function updateCompany($url) { $params = array( 'action' => 'deleteCompany', 'resellerCompanyID' => 1234, 'resellerCompanyPass' => 'resellcompanypass1234', 'companyID' => 4582, 'companyPass' => 'clcomppass5566', ); $resp = callRemote($url, $params, true); header("Content-type: text/xml"); print_r($resp); } ?>
Sample Output
<root> <status>success</status> <companyID>4582</companyID> </root>
Function execute
Sample code
<?php $url = 'http://www.omnovia.com/support/apis/company.php'; function callRemote($url, $params, $returnResponse = true) { $c = curl_init($url); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_POSTFIELDS, $params); curl_setopt($c, CURLOPT_HEADER, false); curl_setopt($c, CURLOPT_RETURNTRANSFER, $returnResponse); $response = curl_exec($c); curl_close($c); if ($returnResponse) return $response; } ?>