Submit a Ticket My Tickets
Welcome
Login  Sign up

ADDEDIT Contact API Version 3

ADDEDIT Contact API Version 3

Updated on 2014-06-17
Current Version: Version 3
Deprecated Version: V1, V2
Requests Allowed: GET&SOAP


Summary:

Allows user to create or update an existing contact details in CAKE 


Resource/WSDL Page:

http://<your_domain_here>/api/3/addedit.asmx?op=Contact 


Parameters

api_key
Required
Type: STRING
Length (Max/Min): 50

Must be a valid API key (existing and not expired)
Example Values: Fo35NRAqvFLXoZxqB4aViaiYM7iVMhh
entity_type
Required
Type: ENUMERATION
Length (Max/Min): NA

 

Required affiliate, advertiser, buyer, list_manager.  On ADD this is required.  EDIT is not required.

Example Values: affiliate

entity_id
Required
Type: INT
Length (Max/Min): NA

On ADD this is required.  EDIT is not required. Entities ID [affiliate ID / advertiser ID / buyer ID / list_manager ID] Requires 0 on edit
Example Values: 12345
contact_id
Required
Type: INT
Length (Max/Min): NA

'0' to create new | 'ID' to update existing
Example Values: 0
role_id
Required
Type: BYTE
Length (Max/Min): NA

On ADD this is required.  EDIT is not required.  Requires 0 on edit
Example Values: 0
include_in_mass_emails
Required
Type: BOOL TYPE
Length (Max/Min): NA

On ADD "no_change" should error.  :Missing Required Fields"  Allow contact to receive system emails? ["on", "off"]
Example Values: on, off or no_change
contact_first_name
Required
Type: STRING
Length (Max/Min): 25

Pass 'NULL' to remove the first name that already exists.  Passing nothing will not change the first name.
Example Values: John
contact_middle_name
Required
Type: STRING
Length (Max/Min): 25

Pass 'NULL' to remove the middle name that already exists.  Passing nothing will not change the middle name.
Example Values: Tom
contact_last_name
Required
Type: STRING
Length (Max/Min): 60

Pass 'NULL' to remove the last name that already exists.  Passing nothing will not change the last name.
Example Values: Doe
contact_email_address
Required
Type: STRING
Length (Max/Min): 60

Only required on ADD. When contact_id=0
Example Values: [email protected]
contact_password
Required
Type: STRING
Length (Max/Min): 25

Only required on ADD. When contact_id=0.  NULL or empty sets it to NULL.
Example Values: password
contact_title
Required
Type: STRING
Length (Max/Min): 30

Pass 'NULL' to remove the title that already exists.  Passing nothing will not change the title.
Example Values: Director
contact_department_id
Required
Type: BYTE
Length (Max/Min): NA


Use '-1' to ignore this field.

Example Values: 1
contact_phone_work
Required
Type: STRING
Length (Max/Min): 30

Pass 'NULL' to remove the work number that already exists.  Passing nothing will not change the work number.
Example Values: 555-867-5309
contact_phone_cell
Required
Type: STRING
Length (Max/Min): 30

Pass 'NULL' to remove the cell number that already exists.  passing nothing will not change the cell number.
Example Values: 555-343-1121
contact_phone_fax
Required
Type: String
Length (Max/Min): 30

Pass 'NULL' to remove the fax number that already exists.  Passing nothing will not change the fax number.
Example Values: 555-555-5555
contact_im_service
Required
Type: STRING
Length (Max/Min): 30

Pass 'NULL' to remove the im service that already exists.  Passing nothing will not change the im name.  Contact IM Service ["0" = AIM, "1" = Google, "2" = MSN, "3" = Skype, "4" = Yahoo, "-1" = Ignore Contact Service]
Example Values: 1
contact_im_name
Required
Type: STRING
Length (Max/Min): 50

Pass 'NULL' to remove the IM name that already exists.  Passing nothing will not change the IM name.  Contact's IM name.
Example Values: IMContact
contact_timezone
Required
Type: STRING
Length (Max/Min): NA

Pass 'NULL' to remove any timezone that already exists.  Passing nothing will not change the timezone.  Contact's timezone.
Example Values: PST
contact_language_id
Required
Type: BYTE
Length (Max/Min): NA

Use '-1' to ignore this field.
Example Values: 1

 **Note all optional parameters still need to be passed through in the actual call. These parameters do not need a value (therefore you can use a null value). 

 

Example Request

GET
https://demo-new.cakemarketing.com/api/3/addedit.asmx/Contact?api_key=3YmDJeT3VHTFhDqAjr2OlQ&entity_type=affiliate&entity_id=1&role_id=1&contact_id=0&include_in_mass_emails=1&contact_first_name=First&contact_middle_name=Middle%20Name&contact_last_name=Last&[email protected]&contact_password=h@ck3r&contact_title=QA%20Engineer&contact_department_id=0&contact_phone_work=9495482253&contact_phone_cell=9492761052&contact_phone_fax=&contact_im_service=0&contact_im_name=myAIMaccount&contact_timezone=null&contact_language_id=1

 

Sample XML Response:

<success>true</success>
<message>Contact First Last Created</message>
<contact_id>3871</contact_id>
</contact_addedit_response>

Example Error Messages:  

Error Message
Likely Cause
Invalid API Key
API key does not exist or is expired
Invalid Entity Type
entity_type does not equal a valid entity type 
Invalid Entity ID
entity_id does not match a valid entity for the specified entity type 
Invalid Role ID
role_id does not match a role in the system 
Invalid Role/Entity Pair
role_id does not match a valid role for the entity_type/entity_id passed in 
Invalid Contact First Name
contact_first_name is NULL or empty or exceeds 25 characters 
Invalid Contact Middle Name
contact_middle_name exceeds 25 characters 
Invalid Contact Last Name
contact_last_name is NULL or empty or exceeds 60 characters 
Invalid Contact Email Address
contact_email_address is NULL or empty or exceeds 60 characters
Invalid Contact Password
contact_password exceeds 25 characters 
Invalid Contact Title
contact_title exceeds 30 characters 
Invalid Contact Phone Work
contact_phone_work exceeds 30 characters 
Invalid Contact Phone Cell
contact_phone_cell exceeds 30 characters
Invalid Contact Fax
contact_phone_fax exceeds 30 characters 
Invalid Contact IM Service
contact_im_service exceeds 30 characters 
Invalid Contact IM Name
contact_im_name exceeds 50 characters 
Invalid Contact Time Zone
time_zone does not match a valid timezone in the system 
Invalid Contact Language
contact_language_id does not correspond to a supported language
Invalid Contact Department
contact_department_id does not correspond to a department 
Invalid Email Address
contact_email_address is invalid 
Invalid Contact ID
contact_id does not correspond to a contact in the system

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.