Documentation API - CvIT.ca

An application programming interface (API) is a protocol intended to be used as an interface by software components to communicate with each other.
An API may include specifications for routines, data structures, object classes, and variables.

When used in the context of web development, an API is typically defined as a set of Hypertext Transfer Protocol (HTTP) request messages, along with a definition of the structure of response messages, which is usually in an Extensible Markup Language (XML) or JavaScript Object Notation (JSON) format.

While "Web API" is virtually a synonym for web service, the recent trend (so-called Web 2.0) has been moving away from Simple Object Access Protocol (SOAP) based services towards more direct Representational State Transfer (REST) style communications.
 
Note : API accepts HTML POST data only
 
All data should be POSTed to [ https://api.cvit.ca ]. A single job array contains the following elements:
title job title, string
short_descriptionjob description summary, string [optional]
long_descriptionjob description long, string
keywordskeywords, string [optional but strongly recommended]
id job id, integer - required only for update, deactivate, activate, delete tasks.
apikeyapi key, string - Provided by CvIT.ca - contact us [ support@cvit.ca ]
taskapi task, string [insert, update, deactivate, activate, delete]
INSERT method example

//php example of making an 'insert' api call

$post_string = 'jobs[0][title]='.urlencode('Technological Architect').'&'.
'jobs[0][short_description]='.urlencode('A short description').'&'.
'jobs[0][long_description]='.urlencode('A long description').'&'.
'jobs[0][keywords]='.urlencode('network, Montreal, architecture').'&'.
'apikey=AbCdEfGhIjKlMnOpQrStUvXz01234567&'. // api key here
'task=insert';

$url = 'https://api.cvit.ca';

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

print($response);

?>
UPDATE method example

//php example of making an 'update' api call

$post_string = 'jobs[0][title]='.urlencode('PHP Programmer').'&'.
'jobs[0][short_description]='.urlencode('A short description about the job').'&'.
'jobs[0][long_description]='.urlencode('A long description about the job').'&'.
'jobs[0][keywords]='.urlencode('php, New York, api, architecture').'&'.
'jobs[0][id]='.urlencode('10442').'&'.
'apikey=AbCdEfGhIjKlMnOpQrStUvXz01234567&'. // api key here
'task=update';

$url = 'https://api.cvit.ca';

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

print($response);

?>
DEACTIVATE method example

//php example of making a 'deactivate' api call

$post_string = 'jobs[0][id]='.urlencode('10442').'&'.
'apikey=AbCdEfGhIjKlMnOpQrStUvXz01234567&'. // api key here
'task=deactivate';

$url = 'https://api.cvit.ca';

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

print($response);

?>
ACTIVATE method example

//php example of making an 'activate' api call

$post_string = 'jobs[0][id]='.urlencode('10442').'&'.
'apikey=AbCdEfGhIjKlMnOpQrStUvXz01234567&'. // api key here
'task=activate';

$url = 'https://api.cvit.ca';

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

print($response);

?>
DELETE method - IS NOT YET IMPLEMENTED