API Authentication

The API Authentication is implemented as HTTP Basic Authentication over SSL (HTTPS). Your API login credentials are not the same as the credentials that you use to login to the web interface. You must obtain your API credentials separately.

Obtaining your API credentials

Each of your Sites has his own API Credentials. If haven't created any Sites yet, login to your client account and navigate to Site Configuration \ Create Site.

To get the API credentials for an existing Site, login to your client account, click on Site Configuration, select one of your Sites and click on API Access. The Public Key is the username and the Private Key the password in the HTTP Basic Authentication Request.

Authenticating with your API Credentials

You have to use HTTP Basic Authentication to confirm your identity via the API. All requests must come over SSL/HTTPS, and have to be sent to the Site Domain. The Site Domain is displayed in the API Access panel in the Site settings (code example).

API Access

Code Example

HTTP Basic Authentication with PHP/CURL

	<?php
	
		//Your Site Settings
		$site_subdomain = 'REPLACE WITH YOUR SITE SUBDMOAIN';
		$site_public_key = 'REPLACE WITH YOUR SITE PUBLIC KEY';
		$site_private_key = 'REPLACE WITH YOUR SITE PRIVATE KEY';
	
		//API Access Domain
		$site_domain = $site_subdomain.'.api.oneall.com';
	
		//Connection Resource
		$resource_uri = 'https://'.$site_domain.'/connections/'.$token .'.json';
	
		//Setup connection
		$curl = curl_init();
		curl_setopt($curl, CURLOPT_URL, $resource_uri);
		curl_setopt($curl, CURLOPT_HEADER, 0);
		curl_setopt($curl, CURLOPT_USERPWD, $site_public_key . ":" . $site_private_key);
		curl_setopt($curl, CURLOPT_TIMEOUT, 15);
		curl_setopt($curl, CURLOPT_VERBOSE, 0);
		curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 1);
		curl_setopt($curl, CURLOPT_FAILONERROR, 0);
	
		//Send request
		$result_json = curl_exec($curl);
		curl_close($curl);
		
		//Done
		print_r($result_json);
		
	?>