createContacts

Request Method: POST

Description: Creates a new contact using a sub set of fields, as opposed to V-CARD format

URL: https://api.iovox.com:444/Contacts?v=3&method=createContacts

The following parameters can be sent in the querystring

ParameterDescriptionDefault ValueData TypeMandatory
vAPI version to use
INTEGERYES

Payload

The following XML payload must be sent with a createContacts request:

<?xml version="1.0" encoding="utf-8"?>
<request>
  <contact>
     <contact_id>client123</contact_id>
     <display_name>John Smith</display_name>
     <first_name>John</first_name>
     <last_name>Smith</last_name>
     <email>jsmith@iovox.com</email>
     <email_2>jsmith@iovox.com</email_2>
     <company>IOVOX</company>
     <mobile_phone>449789123123</mobile_phone>
     <home_phone>441223432123</home_phone>
     <business_phone>441223432987</business_phone>
     <business_fax>441223432984</business_fax>
     <work_address_1>155 Abbey Street</work_address_1>
     <work_address_2>Westminister</work_address_2>
     <work_city>London</work_city>
     <work_country>United Kingdom</work_country>
     <work_postcode>W1 5P6</work_postcode>
     <home_address_1>155 Abbey Street</home_address_1>
     <home_address_2>Westminister</home_address_2>
     <home_city>London</home_city>
     <home_country>United Kingdom</home_country>
     <home_postcode>W1 5P6</home_postcode>
     <notes>This is a note.</notes>
   </contact>
   <contact>
   ...
   </contact>
 </request>

Payload Description

Node NameDescriptionDefault ValueData TypeMandatory
contact > contact_idA unique ID to reference the contact by
STRINGYES
contact > display_nameThe full name of the contact. This must be unique when in combination with any of this contact's phone numbers

first_name last_name or company

STRINGNO
contact > first_nameThe first name of the contact
STRINGNO
contact > last_nameThe last name of the contact
STRINGNO
contact > emailThe email address for the contact
STRINGNO
contact > email_2An additional email address for the contact
STRINGNO
contact > companyThe name of the company to which the contact belongs
STRINGNO
contact > mobile_phoneThe internationalised mobile phone number for the contact
STRINGNO
contact > home_phoneThe internationalised home phone number for the contact
STRINGNO
contact > business_phoneThe internationalised business phone number for the contact
STRINGNO
contact > business_faxThe internationalised business fax number for the contact
STRINGNO
contact > home_countryA string representing the country in which the contact resides. While this is not mandatory if it is absent and home_phone is provided in the payload a 'best guess' at the contact's country will be made based on the phone number provided. This will be stored against the contact's details
STRINGNO
contact > business_countryA string representing the country of the contact's business. While this is not mandatory if it is absent and business_phone is provided in the payload a 'best guess' at the contact's business country will be made based on the phone number provided. This will be stored against the contact's details
STRINGNO
contact > notesAny notes associated with the contact
STRINGNO

Result

Error Result

HTTP CodeError StringResolution
400API Version EmptyAdd a value for the v parameter in the query string
400API Version InvalidCorrect v parameter
400Request Method must be POST. x attemptedSwitch request method x to POST
400XML EmptyAdd xml to the request body
400XML parse error. x at line y, column zCorrect XML at point x on line y, column z
400Request EmptyAdd at least one contact to the request
400Contact ID x of y EmptyAdd contact_id to contact x (item) of y (total)
400Contact ID x of y already existsRemoved or change contact_id x (item) of y (total)
400Duplicate Contact ID ReceivedChange contact_id to be unique
400First Name x of y InvalidCorrect first name with only alphabetic characteres
400Last Name x of y InvalidCorrect last name with only alphabetic characteres
400Home Phone x of y is not internationalisedCorrect home_phone x (item) of y (total) so it is in an internationalised format
400Contact x of y must have either First name, Last name or Company nameAdd first and last name and/or Company name in the contact x (item) of y (total)
400Business Phone x of y is not internationalisedCorrect business_phone x (item) of y (total) so it is in an internationalised format
400Mobile Phone x of y is not internationalisedCorrect mobile_phone x (item) of y (total) so it is in an internationalised format
400Business Fax x of y is not internationalisedCorrect business_fax x (item) of y (total) so it is in an internationalised format
400Display Name and Phone Number Combination x of y already existsChange the display_name and one or more phone numbers in Contact x (item) of y (total) to a combination that doesn't already exist, or use the updateContacts function to update the related contact
400Display Name and Phone Number Combination duplicatedRemove any duplicate display_name and phone number combinations from the XML
400Home Country x of y InvalidCorrect home_country x (item) of y (total) so that is matches a country name returned by Countries::getCountries
400Business Country x of y InvalidCorrect business_country x (item) of y (total) so that is matches a country name returned by Countries::getCountries
500Internal Server ErrorRetry later

Success Result

HTTP/1.1 201 Created