Copy2Contact SOAP API
SOAP is a structured protocol for web services via HTTP requests that must be made a SOAP access layer. While SOAP isn't as simple as REST, it is fully implemented in many development frameworks such as .NET and Java. More info on SOAP can be found in the WikiPedia entry on SOAP.
Testing
Testing of SOAP requests to the Copy2Contact API should be done with your application framework. The Fiddler web debugging tool may prove useful or even the soapUI tool suite.
Example Code
A complete .NET (C# and Visual Basic) example project can be downloaded here: ws_c2c_dot_net.zip
WSDLs
The Copy2Contact SOAP implementation can be found in the following WSDLs:
http://api.copy2contact.com/soap/ws_c2c_rpc.wsdl
http://api.copy2contact.com/soap/ws_c2c_typed.wsdl
Which to use may depend on your development platform. PHP Pear may work best with ws_c2c_typed.wsdl, while most others work best with ws_c2c_rpc.wsdl.
Fault Codes
SOAP methods return standard SOAP faults. The faultcodes are listed here. Some methods may return other faults, which will be noted in that method's description.
Auth failed - AuthID or Password were incorrect. Detail is provided.
Insecure connection - HTTP transfers are not supported for security reasons.
Rate limit exceeded - The rate limit for this account has been exceeded. Detail is provided.
Month limit exceeded - The monthly hit limit for this account has been exceeded. Detail is provided.
Common Parameters
Some of the methods take the following common parameters. Exceptions are noted in each method's description.
authid - Account AuthID [sign up]
pass - Account Password [sign up]
rateLimit - Set to emulate rate limit settings of production account levels (developer accounts). Read more.
rateWindow - Set to emulate rate limit settings of production account levels (developer accounts). Read more.
monthLimit - Set to emulate rate limit settings of production account levels (developer accounts). Read more.
Character Encoding
All input text must be encoded using UTF-8. All output text is encoded in UTF-8.
Supported Methods
GetTypeScores
This method takes a string of text as its argument and returns two "scores" that assert the relative likelihood that the given text represents a contact or event. The scores can be compared to determine how to handle the text or whether it is relevant.
Parameters:
text [required] - The text to process
Returned Elements:
ContactScore - The relative score of the given text as a contact
EventScore - The relative score of the given text as an event
ParseEvent
This method takes a string of text as its argument and parses it into individual event fields.
Parameters:
text [required] - The text to process
localtime [required] - The local time at the user's location. Format "CCYYMMDDThhmmss", e.g. "20091215T122500"
Returned Elements:
EventNoTime - 0 or 1 indicating whether a time of day is associated with this event, e.g. "1"
EventDesc - The description of the event, e.g. "Staff meeting"
EventSubject - The "subject", if one appears in the text
EventLocation - The location of the event, if one appears in the text
EventLocationBare - The location with the preceeding keyword (e.g. "Where:") removed
EventFrom - The start time of the event. Format "CCYYMMDDThhmmss", e.g. "20091216T103000"
EventTo - The end time of the event. Format "CCYYMMDDThhmmss", e.g. "20091216T113000"
ParseEventDev
This method is identical to ParseEvent except that it includes the additional developer parameters listed here, as well as the rate limit parameters listed above.
Parameters:
overrideFrom [optional] - Set this to force the EventFrom element to the given value (developer accounts). Read more.
overrideTo [optional] - Set this to force the EventTo element to the given value (developer accounts). Read more.
ParseContact
This method takes a string of text as its argument and parses it into individual contact fields.
Parameters:
text [required] - The text to process
lowercaseEmails [optional] - Set to 1 to format email addresses as all-lowercase
capitalizeAddresses [optional] - Set to 1 to auto-capitalize street address, city, state, and country
capitalizeStateAbbrevs [optional] - Set to 1 to make 2-letter state abbreviations all capitals
capitalizeNamesTitles [optional] - Set to 1 to auto-capitalize names and titles
capitalizeCos [optional] - Set to 1 to auto-capitalize the company name
allCapsCity [optional] - Set to 1 to make the city name all capitals
allCapsCountry [optional] - Set to 1 to make the country name all capitals
allCapsLastName [optional] - Set to 1 to make the contact's last name all capitals
stripLeadingPhone1s [optional] - Set to 1 to remove leading "1" from phone numbers
phoneNumberFormat [optional] - Set to one of the following to format phone numbers accordingly:
1 - no change
2 - remove all spaces only
3 - (212) 555-1212
4 - 212.555.1212
5 - 212-555-1212
6 - 212 555-1212
Returned Elements:
ContactPreNameTitle - Any title before the contact's name, e.g. "Mr.", "Mrs.", "Dr.", etc.
ContactName - The contact's last name, e.g. "Smith"
ContactFirst - The contact's first name, e.g. "John"
ContactMiddle - The contact's middle name, e.g. "Adam"
ContactPostNameTitles - Any title words after the contact's name, e.g. "Esq.", "M.D.", "Ph. D.", etc.
ContactTitle - The contact's job title, e.g. "Managing Editor"
ContactCompany - The contact's company name, e.g. "Acme Newspapers, Inc."
ContactAddress - The contact's street address, including multiple lines if applicable, e.g. "123 Main St. Suite 321"
ContactCity - The contact's city, e.g. "Boston"
ContactState - The contact's state (if a US address), e.g. "Maine", "ME"
ContactZipCode - The contact's postal code, e.g. "02139", "TW11 8DH"
ContactCountry - The contact's country (if provided), e.g. "Canada"
ContactWork - The contact's complete office phone number, e.g. "617 555 1234 x. 23"
ContactWorkExt - The extension for the above number, e.g. "23"
ContactWorkNoExt - The above number without the extension part, e.g. "617 555 1234"
ContactHome - The contact's complete home phone number
ContactHomeExt - The extension for the above number
ContactHomeNoExt - The above number without the extension part
ContactFax - The contact's complete fax phone number
ContactFaxExt - The extension for the above number
ContactFaxNoExt - The above number without the extension part
ContactPager - The contact's complete pager phone number
ContactPagerExt - The extension for the above number
ContactPagerNoExt - The above number without the extension part
ContactMobile - The contact's complete mobile phone number
ContactMobileExt - The extension for the above number
ContactMobileNoExt - The above number without the extension part
ContactUnIdPhone1 - The first untagged number given for the contact
ContactUnIdPhone1Ext - The extension for the above number
ContactUnIdPhone1NoExt - The above number without the extension part
ContactUnIdPhone2 - The second untagged number given for the contact
ContactUnIdPhone2Ext - The extension for the above number
ContactUnIdPhone2NoExt - The above number without the extension part
ContactUnIdPhone3 - The third untagged number given for the contact
ContactUnIdPhone3Ext - The extension for the above number
ContactUnIdPhone3NoExt - The above number without the extension part
ContactEmail - The contact's email address, e.g. "email@company.com"
ContactEmail2 - Additional email address (if provided)
ContactEmail3 - Additional email address (if provided)
ContactEmail4 - Additional email address (if provided)
ContactURL1 - The contact's web URL, e.g. "www.company.com"
ContactURL2 - Additional web URL (if provided)
ContactURL3 - Additional web URL (if provided)
ContactURL4 - Additional web URL (if provided)
ContactIMName1 - The contact's instant messenger name, e.g. "funnyguy68"
ContactIMName2 - Additional instant messenger name (if provided)
ContactIMName3 - Additional instant messenger name (if provided)
ContactIMName4 - Additional instant messenger name (if provided)
ContactIMType1 - The instant messenger type for IMName1 (AIM,
MSN,
Yahoo,
ICQ,
IRC,
Skype,
GoogleTalk,
Jabber,
IM)
ContactIMType2 - The instant messenger type for IMName2 (AIM,
MSN,
Yahoo,
ICQ,
IRC,
Skype,
GoogleTalk,
Jabber,
IM)
ContactIMType3 - The instant messenger type for IMName3 (AIM,
MSN,
Yahoo,
ICQ,
IRC,
Skype,
GoogleTalk,
Jabber,
IM)
ContactIMType4 - The instant messenger type for IMName4 (AIM,
MSN,
Yahoo,
ICQ,
IRC,
Skype,
GoogleTalk,
Jabber,
IM)
ContactLinkedIn - The contact's LinkedIn URL, e.g. "http://www.linkedin.com/in/myprofile"
ContactBlog - The contact's Blog URL, e.g. "http://www.company.com/blog/"
ContactTwitter - The contact's Twitter URL, e.g. "http://twitter.com/mytwittername"
ContactFacebook - The contact's Facebook URL, e.g. "http://www.facebook.com/myfacebookname"
ContactMySpace - The contact's MySpace URL, e.g. "http://www.myspace.com/myspacename"
ContactRemainingText - Any remaining text left over after parsing
ParseContactDev
This method is identical to ParseContact except that it includes the additional developer parameters listed here, as well as the rate limit parameters listed above.
Parameters:
overrideEmail [optional] - Set this to force the ContactEmail element to the given value (developer accounts). Read more.
overrideName [optional] - Set this to force the ContactName element to the given value (developer accounts). Read more.
overrideFirst [optional] - Set this to force the ContactFirst element to the given value (developer accounts). Read more.
|