Getting Started
Using the Fieldmotion API
PHP Example
<?php
$FMAPI=array(
'api_id'=>123,
'api_key'=>'dd7f49d3c1ad065f7b8b9ccd1fd767ac',
'base_url'=>'https://cp123.fieldmotion.com/a/',
);
function FM_api($fn, $post=array()) {
global $FMAPI;
$post['_api_now']=''.time(); // this must be a string
$post['_api_md5']=md5( json_encode($post).'|'.$FMAPI['api_key'] );
$post['_api_id']=$FMAPI['api_id'];
$ch=curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL=>$FMAPI['base_url'].$fn,
CURLOPT_RETURNTRANSFER=>true,
CURLOPT_POST=>true,
CURLOPT_POSTFIELDS=>http_build_query($post)
));
$result=curl_exec($ch);
curl_close($ch);
return $result;
}
var_dump(FM_api('Users_list'));Last updated