Customer Contacts API

Customer Contacts API

Contact GET ( List )

Retreive all contacts for a customer

GET json object

URI

/:tokenid/customer/:cid/contacts

:cid variable can be either the customer id, account_id or crm_id

Example

Request

Example Javascript/Jquery
$.ajax({
	url: '/api/892f86d5-da86-4e98-9343-1976a375/customer/1234/contacts',
	type: 'GET',
	contentType: 'application/json',
	success: function( response ) {
		console.log(response);
		}
	});

Response

Success Result
{
    "success":true,
	"contacts":[
		{
			"id":"8776",
			"first_name":"Peter",
			"middle_name":"",
			"gender":null,
			"last_name":"Pumpkineater",
			"dob":"1970-10-31",
			"email":"peter@pumpkineater.com",
			"web_password":"",
			"phone":"1300pumpkin",
			"mobile":"0411222333"
		}
	]
}
Error/Fail
{"success":false,"description":"no customer found"}

Contact POST ( Create )

Retreive all contacts for a customer

POST json object

URI

/:tokenid/customer/:cid/contacts

Example

Request

Example Javascript/Jquery
var myData = {
	first_name: 'Very',
    last_name: 'Important Person',
	email: 'vip@vip.com',
	phone: '1300vipvip',
	mobile: '0422333444',
	}
$.ajax({
	url: '/api/892f86d5-da86-4e98-9343-1976a375/customer/1234/contacts',
	data: JSON.stringify(myData),
	type: 'POST',
	contentType: 'application/json',
	success: function( response ) {
		console.log(response);
		}
	});

Response

Success Result
{
    "success":true,
	"contact":
		{
			
			'first_name': 'Very',
    		'last_name': 'Important Person',
			'email': 'vip@vip.com',
			'phone': '1300vipvip',
			'mobile': '0422333444',
			"id":"8778",
		}
}
Error/Fail
{"success":false,"description":"no customer found"}

Contact Single GET ( List )

Retreive all contacts for a customer

GET json object

URI

/:tokenid/customer/:cid/contact/:contact_id

:cid variable can be either the customer id, account_id or crm_id

Example

Request

Example Javascript/Jquery
$.ajax({
	url: '/api/892f86d5-da86-4e98-9343-1976a375/customer/1234/contact/8778',
	type: 'GET',
	contentType: 'application/json',
	success: function( response ) {
		console.log(response);
		}
	});

Response

Success Result
{
    "success":true,
	"contact":
		{
			"id":"8778",
			"first_name":"Peter",
			"middle_name":"",
			"gender":null,
			"last_name":"Pumpkineater",
			"dob":"1970-10-31",
			"email":"peter@pumpkineater.com",
			"phone":"1300pumpkin",
			"mobile":"0411222333"
		}
}
Error/Fail
{"success":false,"description":"no customer found"}

Contact Single POST ( Update )

Retreive all contacts for a customer

POST json object

URI

/:tokenid/customer/:cid/contact/:contact_id

:cid variable can be either the customer id, account_id or crm_id

Example

Request

Example Javascript/Jquery
var myData = {
	first_name: 'Some',
    last_name: 'Guy',
	email: 'guy@dude.com',
	phone: '1300somegu',
	mobile: '0455666777',
	}
$.ajax({
	url: '/api/892f86d5-da86-4e98-9343-1976a375/customer/1234/contact/8778',
	data: JSON.stringify(myData),
	type: 'POST',
	contentType: 'application/json',
	success: function( response ) {
		console.log(response);
		}
	});

Response

Success Result
{
    "success":true,
	"contact":
		{	
			'first_name': 'Some',
    		'last_name': 'Important Person',
			'email': 'vip@vip.com',
			'phone': '1300vipvip',
			'mobile': '0422333444',
			"id":"8778",
		}
}
Error/Fail
{"success":false,"description":"no customer found"}

Contact Single GET DeleteĀ  ( Delete )

Delete a contact

GET

URI

/:tokenid/customer/:cid/contact/:contact_id/delete

:cid variable can be either the customer id, account_id or crm_id

Example

Request

Example Javascript/Jquery
$.ajax({
	url: '/api/892f86d5-da86-4e98-9343-1976a375/customer/1234/contact/8778/delete',
	type: 'GET',
	contentType: 'application/json',
	success: function( response ) {
		console.log(response);
		}
	});

Response

Success Result
{
    "success":true,
}
Error/Fail
{"success":false,"description":"no customer found"}