Contacts API EN
Adding a potential client from an external source
First refer to the following address in POSTmethod:
https://[account name].senzey.com/extapi/pclient/add.php?username=[username]&password=[password]
Please pay attention!
-Data should be sent using UTF8 encoding
-Data should be sent using POST method
-Content type should be: application/x-www-form-urlencoded
Mandatory | Default | Possible values | Description | Type | Field name | |
YES | Client name | varchar | x_name | |||
NO | Client ID | varchar | x_identify_number | |||
NO | Client email | varchar | x_email1 | |||
NO | dd/mm/yyyy | Client Birthday | Date | x_birthday | ||
NO | Client phone | varchar | x_phone | |||
NO | Client cellphone | varchar | x_mobile | |||
NO | Client address | varchar | x_address | |||
NO | Client city | varchar | x_city | |||
NO |
Possible values according to values in software settings
|
Referer source | integer | x_referrer | ||
NO | Referer notes | varchar | x_referrer_notes | |||
NO | Comments/Description | varchar | x_comments | |||
NO | null | ID of project to connect to | number | project_id | connect_to_project | |
NO | text | description | connect_to_project | |||
NO | billing amount incl vat | float | amount | connect_to_project | ||
NO | join date | date | start_date | connect_to_project | ||
NO | finish date | date | finish_date | connect_to+project | ||
NO | NO | "NO", "MONTH" | deal's recurrence | text | recurrence | connect_to_project |
NO | null | Num of service monthes | number | num_of_payment | connect_to_project | |
NO | test | TEST - print values to screen and exit | varchar | test |
Received format would be in JSON.
In case of success:
HTTP Code: 200
For example:
{success: 1, data: {id: 2335}}
id - client created identifier
In case of failure:
HTTP Code: 400-599
Error message - error
For example:
{success: 0, 'message': 'Incorrect business number'}
View code example
Pulling out contacts data from SENZEY using API in order to integrate them in another software or application
First refer to the following address in GET method:
For potential clients:
https://[account name].senzey.com/extapi/pclient/list.php?username=[username]&password=[password]
For clients:
https://[account name].senzey.com/extapi/client/list.php?username=[username]&password=[password]
Possible parameters:
pageno - Page number. Usage example: &pageno=[1]
recperpage - Records per Page. Usage example: &recperpage=[50]
Other filters & type of filters:
Equals - If we want to find a specific value like we should use "&x_" + parameter name + "=[search string]".
For example: "&x_email1=moti@outlook.com"
LIKE - In case we want to find records that contain a certain strings in them, we should use &"z_" + parameter name + "=LIKE" + "&x_" + parameter name + "=[string]" (the string we are looking for).
For example: "&z_name=LIKE&x_name=moti"
BETWEEN - In case we want to find records that are between 2 values, we should use "&z_" + parameter name + "=BETWEEN" + "&x_" + parameter name + "=[from value]" + "&y_" parameter name + "=[until value]".
For example: "&z_registration_date=BETWEEN&x_registration_date=01%2F04%2F2017&y_registration_date=01%2F01%2F2018"
IN - In case we want to find records that are connected to an external values [an array of values], we should use "&z_" + parameter name + "=IN" + "&x_" + parameter name + "=[value]".
For example: "&z_client_type=IN&x_client_type=134"
Possible parameters for searching:
id
name
client_type
contact_person
role
identify_number
business_num
email1
phone
mobile
address
city
area
country_id
registration_date
last_activity_date
newsletter_group
subscribed
birthday
age
client_agent_id
referrer
referrer_notes
comments
keywords
For example: A search for all potential clients that contain the name "moti"
https://[account name].senzey.com/extapi/pclient/list.php?username=[username]&password=[password]&z_name=LIKE&x_name=moti
Return structure:
On Success, the the reply will have the following structure
{"success":1,"message":null,"data":[{"id":"1895","name":"Dani Gal","contact_person":null,"role":null,"identify_number":null,"business_num":null,"email1":null,"email2":null,"phone":null,"phone2":null,"mobile":null,"mobile2":null,"ext":null,"ext2":null,"fax":null,...},{"id":"1894","name":"Moti Almo",...},{"id":"1893","name":"Mike",...}]}
Notice:
1. latest contact will be the first in the list.
2. Maximum value for the parameter recperpage (records per page) is 100. Anything over 100 will result in an error: {"success":0,"message":"Max value of perpage is 100","data":null}