<?php
require_once("ZenCurl.php");

class CloudageApi {

	private $_api_action;

	public $domainUrl = 'http://tryretain.com/index.php/api';

	public function getContactInfo($id) {

		$this->_api_action = 'EmailContact/'.$id;

		$res = $this->execute();

		return $res;

	}

	public function getDownloadLinks($id) {

		$this->_api_action = 'DownloadLinks/'.$id;

		$res = $this->execute();

		return $res;

	}

	public function getApiRequestUrl() {

		return $this->domainUrl.'/'.$this->_api_action;

	}

	public function execute() {

		$url = $this->getApiRequestUrl();

		$instance = new ZenCurl($url);

		$instance->execute();

		return $instance->getJsonData();

	} 

}