How to Integrate JSON API from website -


i have been assigned integrate api client website. api provided vision6.com.au. there no information avialble on website. can give me 1 example contact vision6 database , add contact our website developed using jquery , php.

here way trying

 var newval = {     "id": 1,     "method": "adduser",     "params": [         "apikey",         "123456",         {             "username"     : "username_123",             "password"     : "123456abc",             "first_name"   : "first name",             "last_name"    : "last name",             "email"        : "example@example.com",             "mobile"       : "0412312312",             "phone"        : "56565656",             "fax"          : "57575757",             "position"     : "manager",             "is_read_only" : true,             "timezone"     : "australia/brisbane",             "email_user"   : true,             "is_confirmed" : true         }     ] };  $.ajax({     url: 'http://www.vision6.com.au/api/jsonrpcserver.php?version=3.0',       type: 'post',     beforesend: function(){alert('sending');},     data: newval,     //datatype: 'json',     //data: json.stringify(newval),     //contenttype: 'application/json; charset=utf-8',     datatype: 'json',     //async: false,     success: function(msg) { alert(msg);      }  }); 

this have taken documentation developers.vision6.com.au

you need download jsonrpcclient.php , include in php file. dealings vision6 api, not comprehensive , doesn't make sense until start getting more. unfortunately, aren't helpful in getting started.

my code started

include 'includes/jsonrpcclient.php';     $list_id = 1234; $url = "http://www.vision6.com.au/api/jsonrpcserver.php?version=3.0";    $apikey = 'yourapikeyhere' $api = new jsonrpcclient($url);     $contact = array();     $contact[] = array(          'first name' => "john",          'email' => "sample@email.com"           );  $returnid = $api->addcontacts($apikey, $list_id, $contact); 

the important change found

 $api->addcontacts($apikey, $list_id, $contact);  

all methods using api follow structure

 $api ->apimethod($apikey, $otherrequiredfields/arrays);     

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -