Offices API
Refers to stores, branches, restaurants, outlets etc
List Offices - Returns a list of all offices
GEThttps://api.franchisemailer.co.uk/v1/offices
Response Parameters:Parameter | Description |
id | The unique ID of the office |
name | The name of the office |
property | The property name / number |
street | The street name |
area | The area the office is located |
town | The town the office is located in |
county | The county the office is located in |
post_code | The office post code |
telephone | The office telephone number |
fax | The office fax number |
email | The office email address |
website | The office local website address / local landing page |
post_code_allocation | A comma separated list of post code areas/districts allocated to the office |
PHP Example Code:
api_call('GET','/offices');
JSON Example Response:
{
"status": "success",
"data": {
"offices": [
{
"id": "1",
"name": "Worthing",
"property": "118",
"street": "Long Street",
"area": "Tarring",
"town": "Worthing",
"county": "West Sussex",
"post_code": "BN14 8AD",
"telephone": "01903 123 456",
"fax": "01903 123 456",
"email": "worthing@yourfranchise.co.uk",
"website": "http://www.yourfranchise.co.uk/worthing",
"post_code_allocation": "BN1,BN2,BN3"
}
]
}
}
Offices API
Refers to stores, branches, restaurants, outlets etc
Create Office - Creates a new office
POSThttps://api.franchisemailer.co.uk/v1/offices
Accepted Request Parameters:Parameter | Description | Validation | Default Value |
name | The name of the office | required | - |
property | The property name / number | - | - |
street | The street name | - | - |
area | The area the office is located | - | - |
town | The town the office is located in | - | - |
county | The county the office is located in | - | - |
post_code | The office post code | - | - |
telephone | The office telephone number | - | - |
fax | The office fax number | - | - |
email | The office email address | - | - |
website | The office local website address / local landing page | - | - |
post_code_allocation | A comma separated list of post code areas/districts allocated to the office | - | - |
Response Parameters:Parameter | Description |
id | The unique ID of the office |
name | The name of the office |
property | The property name / number |
street | The street name |
area | The area the office is located |
town | The town the office is located in |
county | The county the office is located in |
post_code | The office post code |
telephone | The office telephone number |
fax | The office fax number |
email | The office email address |
website | The office local website address / local landing page |
post_code_allocation | A comma separated list of post code areas/districts allocated to the office |
Offices API
Refers to stores, branches, restaurants, outlets etc
Create Office - Creates a new office
POSThttps://api.franchisemailer.co.uk/v1/offices
PHP Example Code:
$params = array(
"name" => "Worthing",
"property" => "118",
"street" => "Long Street",
"area" => "Tarring",
"town" => "Worthing",
"county" => "West Sussex",
"post_code" => "BN14 8AD",
"telephone" => "01903 123 456",
"fax" => "01903 123 456",
"email" => "worthing@yourfranchise.co.uk",
"website" => "http://www.yourfranchise.co.uk/worthing",
"post_code_allocation" => "BN1,BN2,BN3"
);
api_call('POST','/offices', $params);
JSON Example Response:
{
"status": "success",
"data": {
"office": {
"id": "1",
"name": "Worthing",
"property": "118",
"street": "Long Street",
"area": "Tarring",
"town": "Worthing",
"county": "West Sussex",
"post_code": "BN14 8AD",
"telephone": "01903 123 456",
"fax": "01903 123 456",
"email": "worthing@yourfranchise.co.uk",
"website": "http://www.yourfranchise.co.uk/worthing",
"post_code_allocation": "BN1,BN2,BN3"
}
}
}
Offices API
Refers to stores, branches, restaurants, outlets etc
Get Office - Gets an office specified by the {office_id} parameter
GEThttps://api.franchisemailer.co.uk/v1/offices/{office_id}
Response Parameters:Parameter | Description |
id | The unique ID of the office |
name | The name of the office |
property | The property name / number |
street | The street name |
area | The area the office is located |
town | The town the office is located in |
county | The county the office is located in |
post_code | The office post code |
telephone | The office telephone number |
fax | The office fax number |
email | The office email address |
website | The office local website address / local landing page |
post_code_allocation | A comma separated list of post code areas/districts allocated to the office |
PHP Example Code:
$office_id = '1';
api_call('GET','/offices/'.$office_id);
JSON Example Response:
{
"status": "success",
"data": {
"office": {
"id": "1",
"name": "Worthing",
"property": "118",
"street": "Long Street",
"area": "Tarring",
"town": "Worthing",
"county": "West Sussex",
"post_code": "BN14 8AD",
"telephone": "01903 123 456",
"fax": "01903 123 456",
"email": "worthing@yourfranchise.co.uk",
"website": "http://www.yourfranchise.co.uk/worthing",
"post_code_allocation": "BN1,BN2,BN3"
}
}
}
Offices API
Refers to stores, branches, restaurants, outlets etc
Update Office - Updates an office specified by the {office_id} parameter
PUThttps://api.franchisemailer.co.uk/v1/offices/{office_id}
Accepted Request Parameters:Parameter | Description | Validation | Default Value |
name | The name of the office | - | - |
property | The property name / number | - | - |
street | The street name | - | - |
area | The area the office is located | - | - |
town | The town the office is located in | - | - |
county | The county the office is located in | - | - |
post_code | The office post code | - | - |
telephone | The office telephone number | - | - |
fax | The office fax number | - | - |
email | The office email address | - | - |
website | The office local website address / local landing page | - | - |
post_code_allocation | A comma separated list of post code areas/districts allocated to the office | - | - |
Response Parameters:Parameter | Description |
id | The unique ID of the office |
name | The name of the office |
property | The property name / number |
street | The street name |
area | The area the office is located |
town | The town the office is located in |
county | The county the office is located in |
post_code | The office post code |
telephone | The office telephone number |
fax | The office fax number |
email | The office email address |
website | The office local website address / local landing page |
post_code_allocation | A comma separated list of post code areas/districts allocated to the office |
Offices API
Refers to stores, branches, restaurants, outlets etc
Update Office - Updates an office specified by the {office_id} parameter
PUThttps://api.franchisemailer.co.uk/v1/offices/{office_id}
PHP Example Code:
$office_id = '1';
$params = array(
"name" => "Worthing",
"property" => "118",
"street" => "Long Street",
"area" => "Tarring",
"town" => "Worthing",
"county" => "West Sussex",
"post_code" => "BN14 8AD",
"telephone" => "01903 123 456",
"fax" => "01903 123 456",
"email" => "worthing@yourfranchise.co.uk",
"website" => "http://www.yourfranchise.co.uk/worthing",
"post_code_allocation" => "BN1,BN2,BN3"
);
api_call('PUT','/offices/'.$office_id, $params);
JSON Example Response:
{
"status": "success",
"data": {
"office": {
"id": "1",
"name": "Worthing",
"property": "118",
"street": "Long Street",
"area": "Tarring",
"town": "Worthing",
"county": "West Sussex",
"post_code": "BN14 8AD",
"telephone": "01903 123 456",
"fax": "01903 123 456",
"email": "worthing@yourfranchise.co.uk",
"website": "http://www.yourfranchise.co.uk/worthing",
"post_code_allocation": "BN1,BN2,BN3"
}
}
}
Offices API
Refers to stores, branches, restaurants, outlets etc
Delete Office - Deletes an office specified by the {office_id} parameter
DELETEhttps://api.franchisemailer.co.uk/v1/offices/{office_id}
PHP Example Code:
$office_id = '1';
api_call('DELETE','/offices/'.$office_id);
JSON Example Response:
{
"status": "success",
"data": null
}
Users API
For the management of system users only, for general contacts use the contacts API
List Users - Returns a list of all users
GEThttps://api.franchisemailer.co.uk/v1/users
Response Parameters:Parameter | Description |
id | The unique ID of the user |
username | The users username |
first_name | The users first name |
last_name | The users last name |
email | The users email address |
telephone | The users telephone number |
job_title | The users job title |
active | The users account status |
offices | A comma separated list of office ID's that the user can access and send from |
last_login | The data and time the user last logged in (ISO-8601) |
last_password_change | The date the users password was last changed (ISO-8601) |
PHP Example Code:
api_call('GET','/users');
JSON Example Response:
{
"status": "success",
"data": {
"users": [
{
"id": "1",
"username": "joe.bloggs",
"first_name": "Joe",
"last_name": "Bloggs",
"email": "job.bloggs@yourfranchise.co.uk",
"telephone": "01903 123 456",
"job_title": "Marketing Director",
"active": "true",
"offices": "1,3,4",
"last_login": "2013-01-31T13:52:45+00:00",
"last_password_change": "2013-01-31T13:52:45+00:00"
}
]
}
}
Users API
For the management of system users only, for general contacts use the contacts API
Create User - Creates a new user
POSThttps://api.franchisemailer.co.uk/v1/users
Accepted Request Parameters:Parameter | Description | Validation | Default Value |
username | A unique username | required | - |
password | The users password (plain text) | required | - |
first_name | The users first name | required | - |
last_name | The users last name | required | - |
email | The users email address | required | - |
telephone | The users telephone number | - | - |
job_title | The users job title | - | - |
active | The users account status | required true or false | false |
offices | A comma separated list of office ID's | required Only digits and commas accepted | - |
Response Parameters:Parameter | Description |
id | The unique ID of the user |
username | A unique username |
first_name | The users first name |
last_name | The users last name |
email | The users email address |
telephone | The users telephone number |
job_title | The users job title |
active | The users account status |
offices | A comma separated list of office ID's that the user can access and send from |
last_login | The data and time the user last logged in (ISO-8601) |
last_password_change | The date the users password was last changed (ISO-8601) |
Users API
For the management of system users only, for general contacts use the contacts API
Create User - Creates a new user
POSThttps://api.franchisemailer.co.uk/v1/users
PHP Example Code:
$params = array(
"username" => "joe.bloggs",
"password" => "Qwertyu1",
"first_name" => "Joe",
"last_name" => "Bloggs",
"email" => "job.bloggs@yourfranchise.co.uk",
"telephone" => "01903 123 456",
"job_title" => "Marketing Director",
"active" => "true",
"offices" => "1,3,4"
);
api_call('POST','/users', $params);
JSON Example Response:
{
"status": "success",
"data": {
"user": {
"id": "1",
"username": "joe.bloggs",
"first_name": "Joe",
"last_name": "Bloggs",
"email": "job.bloggs@yourfranchise.co.uk",
"telephone": "01903 123 456",
"job_title": "Marketing Director",
"active": "true",
"offices": "1,3,4",
"last_login": "",
"last_password_change": ""
}
}
}
Users API
For the management of system users only, for general contacts use the contacts API
Get User - Gets a user specified by the {user_id} parameter
GEThttps://api.franchisemailer.co.uk/v1/users/{user_id}
Response Parameters:Parameter | Description |
id | The unique ID of the user |
username | The users username |
first_name | The users first name |
last_name | The users last name |
email | The users email address |
telephone | The users telephone number |
job_title | The users job title |
active | The users account status |
offices | A comma separated list of office ID's that the user can access and send from |
last_login | The data and time the user last logged in (ISO-8601) |
last_password_change | The date the users password was last changed (ISO-8601) |
PHP Example Code:
$user_id = '1';
api_call('GET','/users/'.$user_id);
JSON Example Response:
{
"status": "success",
"data": {
"user": {
"id": "1",
"username": "joe.bloggs",
"first_name": "Joe",
"last_name": "Bloggs",
"email": "job.bloggs@yourfranchise.co.uk",
"telephone": "01903 123 456",
"job_title": "Marketing Director",
"active": "true",
"offices": "1,3,4",
"last_login": "2013-01-31T13:52:45+00:00",
"last_password_change": "2013-01-31T13:52:45+00:00"
}
}
}
Users API
For the management of system users only, for general contacts use the contacts API
Update User - Updates a user specified by the {user_id} parameter
PUThttps://api.franchisemailer.co.uk/v1/users/{user_id}
Accepted Request Parameters:Parameter | Description | Validation | Default Value |
username | A unique username | - | - |
password | The users password (plain text) | - | - |
first_name | The users first name | - | - |
last_name | The users last name | - | - |
email | The users email address | - | - |
telephone | The users telephone number | - | - |
job_title | The users job title | - | - |
active | The users account status | true or false | - |
offices | A comma separated list of office ID's | Only digits and commas accepted | - |
Response Parameters:Parameter | Description |
id | The unique ID of the user |
username | A unique username |
first_name | The users first name |
last_name | The users last name |
email | The users email address |
telephone | The users telephone number |
job_title | The users job title |
active | The users account status |
offices | A comma separated list of office ID's that the user can access and send from |
last_login | The data and time the user last logged in (ISO-8601) |
last_password_change | The date the users password was last changed (ISO-8601) |
Users API
For the management of system users only, for general contacts use the contacts API
Update User - Updates a user specified by the {user_id} parameter
PUThttps://api.franchisemailer.co.uk/v1/users/{user_id}
PHP Example Code:
$user_id = '1';
$params = array(
"username" => "joe.bloggs",
"password" => "Qwertyu1",
"first_name" => "Joe",
"last_name" => "Bloggs",
"email" => "job.bloggs@yourfranchise.co.uk",
"telephone" => "01903 123 456",
"job_title" => "Marketing Director",
"active" => "true",
"offices" => "1,3,4"
);
api_call('PUT','/users/'.$user_id, $params);
JSON Example Response:
{
"status": "success",
"data": {
"user": {
"id": "1",
"username": "joe.bloggs",
"first_name": "Joe",
"last_name": "Bloggs",
"email": "job.bloggs@yourfranchise.co.uk",
"telephone": "01903 123 456",
"job_title": "Marketing Director",
"active": "true",
"offices": "1,3,4",
"last_login": "2013-01-31T13:52:45+00:00",
"last_password_change": "2013-01-31T13:52:45+00:00"
}
}
}
Users API
For the management of system users only, for general contacts use the contacts API
Delete User - Deletes a user specified by the {user_id} parameter
DELETEhttps://api.franchisemailer.co.uk/v1/users/{user_id}
PHP Example Code:
$user_id = '1';
api_call('DELETE','/users/'.$user_id);
JSON Example Response:
{
"status": "success",
"data": null
}
Contacts API
List Contacts - Returns a list of all contacts
GEThttps://api.franchisemailer.co.uk/v1/contacts?office={office_id}&group={group_id}&limit=500&offset=0
Response Parameters:Parameter | Description |
id | The unique ID of the contact |
title | The contacts title |
first_name | The contacts first name |
middle_name | The contacts middle name |
last_name | The contacts last name |
addressee | The preferred way to address the contact |
date_of_birth | The contacts date of birth (ISO-8601) |
gender | The contacts gender |
telephone | The contacts telephone number |
mobile | The contacts mobile number |
fax | The contacts fax number |
email | The contacts email address |
website | The contacts website address |
company | The contacts company name |
job_title | The contacts job title |
property | The contacts property name / number |
street | The contacts street name |
area | The area the contact is located |
town | The town the contact is located in |
county | The county the contact is located in |
post_code | The contacts post code |
country | The contacts country code (ISO-3166-1 alpha-2) |
status | The contacts status |
office | The office ID the contact belongs to |
groups | A comma separated list of contact group ID's that the contact is assigned to |
common_groups | A comma separated list of common contact group ID's that the contact is assigned to |
custom_fields | The contacts custom fields (id, value) |
Contacts API
List Contacts - Returns a list of all contacts
GEThttps://api.franchisemailer.co.uk/v1/contacts?office={office_id}&group={group_id}&limit=500&offset=0
PHP Example Code:
$office_id = '1';
$group_id = '1';
api_call('GET','/contacts?office='.$office_id.'&group='.$group_id.'&limit=500&offset=0');
JSON Example Response:
{
"status": "success",
"meta": {
"limit": 500,
"next": null,
"offset": 0,
"previous": null,
"total_count": 1
},
"data": {
"contacts": [
{
"id": "1",
"title": "Mr",
"first_name": "Joe",
"middle_name": "Michael",
"last_name": "Bloggs",
"addressee": "Mr Joe Bloggs",
"date_of_birth": "31/01/1980",
"gender": "Male",
"telephone": "01903 123 456",
"mobile": "07123456789",
"fax": "01903 123 456",
"email": "job.bloggs@example.com",
"website": "http://www.example.com",
"company": "JB Trading",
"job_title": "Sales Director",
"property": "118",
"street": "Long Street",
"area": "Tarring",
"town": "Worthing",
"county": "West Sussex",
"post_code": "BN14 8AD",
"country": "GB",
"status": "Permitted",
"office": "1",
"groups": "1,3,4",
"common_groups": "1,3,4",
"custom_fields": {
"1": "£30,000"
}
}
]
}
}
Contacts API
Create Contact - Creates a new contact
POSThttps://api.franchisemailer.co.uk/v1/contacts
Accepted Request Parameters:Parameter | Description | Validation | Default Value |
title | The contacts title | - | - |
first_name | The contacts first name | - | - |
middle_name | The contacts middle name | - | - |
last_name | The contacts last name | - | - |
addressee | The preferred way to address the contact | - | - |
date_of_birth | The contacts date of birth | ISO-8601 | - |
gender | The contacts gender | Male or Female | - |
telephone | The contacts telephone number | - | - |
mobile | The contacts mobile number | - | - |
fax | The contacts fax number | - | - |
email | The contacts email address | required | - |
website | The contacts website address | - | - |
company | The contacts company name | - | - |
job_title | The contacts job title | - | - |
property | The contacts property name / number | - | - |
street | The contacts street name | - | - |
area | The area the contact is located | - | - |
town | The town the contact is located in | - | - |
county | The county the contact is located in | - | - |
post_code | The contacts post code | - | - |
country | The contacts country code | ISO-3166-1 alpha-2/3 | - |
status | The contacts status | required Pending, Permitted, Dormant or Excluded | Permitted |
office | The office ID the contact belongs to | required 0 can be used to auto allocate as long as offices have been allocated post code areas/districts | - |
groups | A comma separated list of contact group ID's | required Or use the common group parameter instead | - |
common_groups | A comma separated list of common contact group ID's | Will be ignored if group parameter is set and not empty | - |
custom_fields | The contacts custom fields (id, value) | - | - |
Contacts API
Create Contact - Creates a new contact
POSThttps://api.franchisemailer.co.uk/v1/contacts
Response Parameters:Parameter | Description |
id | The unique ID of the contact |
title | The contacts title |
first_name | The contacts first name |
middle_name | The contacts middle name |
last_name | The contacts last name |
addressee | The preferred way to address the contact |
date_of_birth | The contacts date of birth (ISO-8601) |
gender | The contacts gender |
telephone | The contacts telephone number |
mobile | The contacts mobile number |
fax | The contacts fax number |
email | The contacts email address |
website | The contacts website address |
company | The contacts company name |
job_title | The contacts job title |
property | The contacts property name / number |
street | The contacts street name |
area | The area the contact is located |
town | The town the contact is located in |
county | The county the contact is located in |
post_code | The contacts post code |
country | The contacts country code (ISO-3166-1 alpha-2) |
status | The contacts status |
office | The office ID the contact belongs to |
groups | A comma separated list of contact group ID's that the contact is assigned to |
common_groups | A comma separated list of common contact group ID's that the contact is assigned to |
custom_fields | The contacts custom fields (id, value) |
Contacts API
Create Contact - Creates a new contact
POSThttps://api.franchisemailer.co.uk/v1/contacts
PHP Example Code:
$params = array(
"title" => "Mr",
"first_name" => "Joe",
"middle_name" => "Michael",
"last_name" => "Bloggs",
"addressee" => "Mr Joe Bloggs",
"date_of_birth" => "2013-01-31",
"gender" => "Male",
"telephone" => "01903 123 456",
"mobile" => "07123456789",
"fax" => "01903 123 456",
"email" => "job.bloggs@example.com",
"website" => "http://www.example.com",
"company" => "JB Trading",
"job_title" => "Sales Director",
"property" => "118",
"street" => "Long Street",
"area" => "Tarring",
"town" => "Worthing",
"county" => "West Sussex",
"post_code" => "BN14 8AD",
"country" => "GB",
"status" => "Permitted",
"office" => "1",
"groups" => "1,3,4",
"common_groups" => "1,3,4",
"custom_fields" => array(
1 => "£30,000"
)
);
api_call('POST','/contacts', $params);
JSON Example Response:
{
"status": "success",
"data": {
"contact": {
"id": "1",
"title": "Mr",
"first_name": "Joe",
"middle_name": "Michael",
"last_name": "Bloggs",
"addressee": "Mr Joe Bloggs",
"date_of_birth": "2013-01-31",
"gender": "Male",
"telephone": "01903 123 456",
"mobile": "07123456789",
"fax": "01903 123 456",
"email": "job.bloggs@example.com",
"website": "http://www.example.com",
"company": "JB Trading",
"job_title": "Sales Director",
"property": "118",
"street": "Long Street",
"area": "Tarring",
"town": "Worthing",
"county": "West Sussex",
"post_code": "BN14 8AD",
"country": "GB",
"status": "Permitted",
"office": "1",
"groups": "1,3,4",
"common_groups": "1,3,4",
"custom_fields": {
"1": "£30,000"
}
}
}
}
Contacts API
Get Contact - Gets a contact specified by the {contact_id} parameter
GEThttps://api.franchisemailer.co.uk/v1/contacts/{contact_id}
Response Parameters:Parameter | Description |
id | The unique ID of the contact |
title | The contacts title |
first_name | The contacts first name |
middle_name | The contacts middle name |
last_name | The contacts last name |
addressee | The preferred way to address the contact |
date_of_birth | The contacts date of birth (ISO-8601) |
gender | The contacts gender |
telephone | The contacts telephone number |
mobile | The contacts mobile number |
fax | The contacts fax number |
email | The contacts email address |
website | The contacts website address |
company | The contacts company name |
job_title | The contacts job title |
property | The contacts property name / number |
street | The contacts street name |
area | The area the contact is located |
town | The town the contact is located in |
county | The county the contact is located in |
post_code | The contacts post code |
country | The contacts country code (ISO-3166-1 alpha-2) |
status | The contacts status |
office | The office ID the contact belongs to |
groups | A comma separated list of contact group ID's that the contact is assigned to |
common_groups | A comma separated list of common contact group ID's that the contact is assigned to |
custom_fields | The contacts custom fields (id, value) |
Contacts API
Get Contact - Gets a contact specified by the {contact_id} parameter
GEThttps://api.franchisemailer.co.uk/v1/contacts/{contact_id}
PHP Example Code:
$contact_id = '1';
api_call('GET','/contacts/'.$contact_id);
JSON Example Response:
{
"status": "success",
"data": {
"contact": {
"id": "1",
"title": "Mr",
"first_name": "Joe",
"middle_name": "Michael",
"last_name": "Bloggs",
"addressee": "Mr Joe Bloggs",
"date_of_birth": "2013-01-31",
"gender": "Male",
"telephone": "01903 123 456",
"mobile": "07123456789",
"fax": "01903 123 456",
"email": "job.bloggs@example.com",
"website": "http://www.example.com",
"company": "JB Trading",
"job_title": "Sales Director",
"property": "118",
"street": "Long Street",
"area": "Tarring",
"town": "Worthing",
"county": "West Sussex",
"post_code": "BN14 8AD",
"country": "GB",
"status": "Permitted",
"office": "1",
"groups": "1,3,4",
"common_groups": "1,3,4",
"custom_fields": {
"1": "£30,000"
}
}
}
}
Contacts API
Update Contact - Updates a contact specified by the {contact_id} parameter
PUThttps://api.franchisemailer.co.uk/v1/contacts/{contact_id}
Accepted Request Parameters:Parameter | Description | Validation | Default Value |
title | The contacts title | - | - |
first_name | The contacts first name | - | - |
middle_name | The contacts middle name | - | - |
last_name | The contacts last name | - | - |
addressee | The preferred way to address the contact | - | - |
date_of_birth | The contacts date of birth | ISO-8601 | - |
gender | The contacts gender | - | - |
telephone | The contacts telephone number | - | - |
mobile | The contacts mobile number | - | - |
fax | The contacts fax number | - | - |
email | The contacts email address | - | - |
website | The contacts website address | - | - |
company | The contacts company name | - | - |
job_title | The contacts job title | - | - |
property | The contacts property name / number | - | - |
street | The contacts street name | - | - |
area | The area the contact is located | - | - |
town | The town the contact is located in | - | - |
county | The county the contact is located in | - | - |
post_code | The contacts post code | - | - |
country | The contacts country code | ISO-3166-1 alpha-2/3 | - |
status | The contacts status | Pending, Permitted, Dormant or Excluded | - |
office | The office ID the contact belongs to | - | - |
groups | A comma separated list of contact group ID's | - | - |
common_groups | A comma separated list of common contact group ID's | Will be ignored if group parameter is set and not empty | - |
custom_fields | The contacts custom fields (id, value) | - | - |
Contacts API
Update Contact - Updates a contact specified by the {contact_id} parameter
PUThttps://api.franchisemailer.co.uk/v1/contacts/{contact_id}
Response Parameters:Parameter | Description |
id | The unique ID of the contact |
title | The contacts title |
first_name | The contacts first name |
middle_name | The contacts middle name |
last_name | The contacts last name |
addressee | The preferred way to address the contact |
date_of_birth | The contacts date of birth (ISO-8601) |
gender | The contacts gender |
telephone | The contacts telephone number |
mobile | The contacts mobile number |
fax | The contacts fax number |
email | The contacts email address |
website | The contacts website address |
company | The contacts company name |
job_title | The contacts job title |
property | The contacts property name / number |
street | The contacts street name |
area | The area the contact is located |
town | The town the contact is located in |
county | The county the contact is located in |
post_code | The contacts post code |
country | The contacts country code (ISO-3166-1 alpha-2) |
status | The contacts status |
office | The office ID the contact belongs to |
groups | A comma separated list of contact group ID's that the contact is assigned to |
common_groups | A comma separated list of common contact group ID's that the contact is assigned to |
custom_fields | The contacts custom fields (id, value) |
Contacts API
Update Contact - Updates a contact specified by the {contact_id} parameter
PUThttps://api.franchisemailer.co.uk/v1/contacts/{contact_id}
PHP Example Code:
$contact_id = '1';
$params = array(
"title" => "Mr",
"first_name" => "Joe",
"middle_name" => "Michael",
"last_name" => "Bloggs",
"addressee" => "Mr Joe Bloggs",
"date_of_birth" => "2013-01-31",
"gender" => "Male",
"telephone" => "01903 123 456",
"mobile" => "07123456789",
"fax" => "01903 123 456",
"email" => "job.bloggs@example.com",
"website" => "http://www.example.com",
"company" => "JB Trading",
"job_title" => "Sales Director",
"property" => "118",
"street" => "Long Street",
"area" => "Tarring",
"town" => "Worthing",
"county" => "West Sussex",
"post_code" => "BN14 8AD",
"country" => "GB",
"status" => "Permitted",
"office" => "1",
"groups" => "1,3,4",
"common_groups" => "1,3,4",
"custom_fields" => array(
1 => "£30,000"
)
);
api_call('PUT','/contacts/'.$contact_id, $params);
JSON Example Response:
{
"status": "success",
"data": {
"contact": {
"id": "1",
"title": "Mr",
"first_name": "Joe",
"middle_name": "Michael",
"last_name": "Bloggs",
"addressee": "Mr Joe Bloggs",
"date_of_birth": "2013-01-31",
"gender": "Male",
"telephone": "01903 123 456",
"mobile": "07123456789",
"fax": "01903 123 456",
"email": "job.bloggs@example.com",
"website": "http://www.example.com",
"company": "JB Trading",
"job_title": "Sales Director",
"property": "118",
"street": "Long Street",
"area": "Tarring",
"town": "Worthing",
"county": "West Sussex",
"post_code": "BN14 8AD",
"country": "GB",
"status": "Permitted",
"office": "1",
"groups": "1,3,4",
"common_groups": "1,3,4",
"custom_fields": {
"1": "£30,000"
}
}
}
}
Contacts API
Delete Contact - Deletes a contact specified by the {contact_id} parameter
DELETEhttps://api.franchisemailer.co.uk/v1/contacts/{contact_id}
PHP Example Code:
$contact_id = '1';
api_call('DELETE','/contacts/'.$contact_id);
JSON Example Response:
{
"status": "success",
"data": null
}
Contact Groups API
List Contact Groups - Returns a list of all contact groups
GEThttps://api.franchisemailer.co.uk/v1/contactgroups?office={office_id}
Response Parameters:Parameter | Description |
id | The unique ID of the group |
common_id | The common group ID |
name | The name of the group |
office | The office ID the group belongs to |
total | The total number of contacts contained in the group |
permitted | The total number of permitted contacts contained in the group |
dormant | The total number of dormant contacts contained in the group |
excluded | The total number of excluded contacts contained in the group |
invalid | The total number of invalid contacts contained in the group |
PHP Example Code:
$office_id = '1';
api_call('GET','/contactgroups?office='.$office_id);
JSON Example Response:
{
"status": "success",
"data": {
"contact_groups": [
{
"id": "1",
"common_id": "1",
"name": "Prospects",
"office": "1",
"total": "233",
"permitted": "200",
"dormant": "14",
"excluded": "7",
"invalid": "12"
}
]
}
}
Contact Groups API
Create Contact Group - Creates a new contact group for either a single office, for each specified office or for all offices
POSThttps://api.franchisemailer.co.uk/v1/contactgroups
Accepted Request Parameters:Parameter | Description | Validation | Default Value |
name | The name of the group | required Max length 40 chars | - |
offices | Single office ID or a comma separated list of office ID's that a group will be created for, 0 will create groups for all offices | required | 0 |
Response Parameters:Parameter | Description |
id | The unique ID of the group |
common_id | The common group ID |
name | The name of the group |
office | The office ID the group belongs to |
PHP Example Code:
$params = array(
"name" => "Prospects",
"offices" => "1,3,4"
);
api_call('POST', '/contactgroups', $params);
JSON Example Response:
{
"status": "success",
"data": {
"contact_groups": [
{
"id": "1",
"common_id": "1",
"name": "Prospects",
"office": "1"
},
{
"id": "2",
"common_id": "1",
"name": "Prospects",
"office": "3"
},
{
"id": "3",
"common_id": "1",
"name": "Prospects",
"office": "4"
}
]
}
}
Contact Groups API
Get Contact Group - Gets a contact group specified by the {group_id} parameter
GEThttps://api.franchisemailer.co.uk/v1/contactgroups/{group_id}
Response Parameters:Parameter | Description |
id | The unique ID of the group |
common_id | The common group ID |
name | The name of the group |
office | The office ID the group belongs to |
total | The total number of contacts contained in the group |
permitted | The total number of permitted contacts contained in the group |
dormant | The total number of dormant contacts contained in the group |
excluded | The total number of excluded contacts contained in the group |
invalid | The total number of invalid contacts contained in the group |
PHP Example Code:
$group_id = '1';
api_call('GET','/contactgroups/'.$group_id);
JSON Example Response:
{
"status": "success",
"data": {
"contact_group": {
"id": "1",
"common_id": "1",
"name": "Prospects",
"office": "1",
"total": "233",
"permitted": "200",
"dormant": "14",
"excluded": "7",
"invalid": "12"
}
}
}
Contact Groups API
Update Contact Group - Updates a contact group specified by the {group_id} parameter
PUThttps://api.franchisemailer.co.uk/v1/contactgroups/{group_id}
Accepted Request Parameters:Parameter | Description | Validation | Default Value |
name | The name of the group | Max length 40 chars | - |
Response Parameters:Parameter | Description |
id | The unique ID of the group |
common_id | The common group ID |
name | The name of the group |
office | The office ID the group belongs to |
total | The total number of contacts contained in the group |
permitted | The total number of permitted contacts contained in the group |
dormant | The total number of dormant contacts contained in the group |
excluded | The total number of excluded contacts contained in the group |
invalid | The total number of invalid contacts contained in the group |
PHP Example Code:
$group_id = '1';
$params = array(
"name" => "Prospects"
);
api_call('PUT','/contactgroups/'.$group_id, $params);
JSON Example Response:
{
"status": "success",
"data": {
"contact_group": {
"id": "1",
"common_id": "1",
"name": "Prospects",
"office": "1",
"total": "233",
"permitted": "200",
"dormant": "14",
"excluded": "7",
"invalid": "12"
}
}
}
Contact Groups API
Delete Contact Group - Deletes a contact group specified by the {group_id} parameter
DELETEhttps://api.franchisemailer.co.uk/v1/contactgroups/{group_id}
PHP Example Code:
$group_id = '1';
api_call('DELETE','/contactgroups/'.$group_id);
JSON Example Response:
{
"status": "success",
"data": null
}
Custom Fields API
List Custom Fields - Returns a list of all custom fields
GEThttps://api.franchisemailer.co.uk/v1/customfields
Response Parameters:Parameter | Description |
id | The unique ID of the custom field |
name | The name of the custom field |
description | A short description of the custom field |
PHP Example Code:
api_call('GET','/customfields');
JSON Example Response:
{
"status": "success",
"data": {
"custom_fields": [
{
"id": "1",
"name": "Yearly Spend",
"description": "The amount the contact spends per year"
}
]
}
}
Custom Fields API
Create Custom Field - Creates a new custom field
POSThttps://api.franchisemailer.co.uk/v1/customfields
Accepted Request Parameters:Parameter | Description | Validation | Default Value |
name | The name of the custom field | required Max length 20 chars | - |
description | A short description of the custom field | required | - |
Response Parameters:Parameter | Description |
id | The unique ID of the custom field |
name | The name of the custom field |
description | A short description of the custom field |
PHP Example Code:
$params = array(
"name" => "Yearly Spend",
"description" => "The amount the contact spends per year"
);
api_call('POST','/customfields', $params);
JSON Example Response:
{
"status": "success",
"data": {
"custom_field": {
"id": "1",
"name": "Yearly Spend",
"description": "The amount the contact spends per year"
}
}
}
Custom Fields API
Get Custom Field - Gets a custom field specified by the {field_id} parameter
GEThttps://api.franchisemailer.co.uk/v1/customfields/{field_id}
Response Parameters:Parameter | Description |
id | The unique ID of the custom field |
name | The name of the custom field |
description | A short description of the custom field |
PHP Example Code:
$field_id = '1';
api_call('GET','/customfields/'.$field_id);
JSON Example Response:
{
"status": "success",
"data": {
"custom_field": {
"id": "1",
"name": "Yearly Spend",
"description": "The amount the contact spends per year"
}
}
}
Custom Fields API
Update Custom Field - Updates a custom field specified by the {field_id} parameter
PUThttps://api.franchisemailer.co.uk/v1/customfields/{field_id}
Accepted Request Parameters:Parameter | Description | Validation | Default Value |
name | The name of the custom field | - | - |
description | A short description of the custom field | - | - |
Response Parameters:Parameter | Description |
id | The unique ID of the custom field |
name | The name of the custom field |
description | A short description of the custom field |
PHP Example Code:
$field_id = '1';
$params = array(
"name" => "Yearly Spend",
"description" => "The amount the contact spends per year"
);
api_call('PUT','/customfields/'.$field_id, $params);
JSON Example Response:
{
"status": "success",
"data": {
"custom_field": {
"id": "1",
"name": "Yearly Spend",
"description": "The amount the contact spends per year"
}
}
}
Custom Fields API
Delete Custom Field - Deletes a custom field specified by the {field_id} parameter
DELETEhttps://api.franchisemailer.co.uk/v1/customfields/{field_id}
PHP Example Code:
$field_id = '1';
api_call('DELETE','/customfields/'.$field_id);
JSON Example Response:
{
"status": "success",
"data": null
}
Single Sign-On API
Start Session - Returns a URL that can be used to automatically start a session specified by the {user_id} parameter
GEThttps://api.franchisemailer.co.uk/v1/sso/{user_id}
Response Parameters:Parameter | Description |
session_url | URL to start session with temporary token that expires on 1st use or 20 seconds after token generation |
PHP Example Code:
$user_id = '1';
api_call('GET','/sso/'.$user_id);
JSON Example Response:
{
"status": "success",
"data": {
"sso": {
"session_url": "https://www.franchisemailer.co.uk/?t=0ab34ca97d9946591bf89817789cb5de"
}
}
}
Single Sign-On API
End Session - Ends a users session specified by the {user_id} parameter
DELETEhttps://api.franchisemailer.co.uk/v1/sso/{user_id}
PHP Example Code:
$user_id = '1';
api_call('DELETE','/sso/'.$user_id);
JSON Example Response:
{
"status": "success",
"data": null
}