This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Contacts in Clevertim CRM
Overview
The following operations allow you to work with contacts. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with contacts, see Sample configuration.
Operation | Description |
---|---|
Creates a contact. | |
listContacts | Retrieves all contacts. |
Operation details
This section provides further details on the operations related to contacts.
Creating a contact
The createContact
operation adds a new contact.
<clevertimcrm.createContact> <firstName>{$ctx:firstName}</firstName> <lastName>{$ctx:lastName}</lastName> <title>{$ctx:title}</title> <description>{$ctx:description}</description> <isCompany>{$ctx:isCompany}</isCompany> <companyId>{$ctx:companyId}</companyId> <email>{$ctx:email}</email> <phones>{$ctx:phones}</phones> <website>{$ctx:website}</website> <address>{$ctx:address}</address> <city>{$ctx:city}</city> <postCode>{$ctx:postCode}</postCode> <country>{$ctx:country}</country> <socialMediaIds>{$ctx:socialMediaIds}</socialMediaIds> <customerType>{$ctx:customerType}</customerType> <customFields>{$ctx:customFields}</customFields> <tags>{$ctx:tags}</tags> </clevertimcrm.createContact>
Properties
firstName:
The first name of the contact.lastName:
The last name of the contact..title:
The title of the contact.description:
The preferred description of the contact.isCompany:
Whether the contact is a company.companyId:
The ID of the company.email:
The e-mail address of the contact.phones:
The phone numbers of the contact.website:
A valid website of the contact.address:
The address of the contact.city:
The name of the city.postCode:
The postal code.country:
The name of the country.socialMediaIds:
Social media identifiers for the contact.customerType:
The type of the customer.customFields:
Custom fields provided as name/value pairs.tags:
One or more tags for the contact.
Sample request
Following is a sample REST/JSON request that can be handled by the createContact
operation.
{ "apiUrl":"https://www.clevertim.com", "apiKey":"7hRfxQ3mXxLrnAmiIYxSIsFTlGdCYNfnqjY4pXtaAhYEe04HP3Z11751", "firstName":"Amanda1", "lastName":"Feron", "title":"Ms.", "description":"Sample Description", "isCompany":false, "companyId":"117015", "email":["amanda.bellur@gmail.com", "feron@yahoo.com"], "phones":[{"type": "Work", "no": "008745849854"}, {"type": "Home", "no": "87450-94545"}], "website":["http://www.amanda.com", "http://www.feron.com"], "address":"200 Marbello Road", "city":"London", "postCode":"SW9 2BR", "country":"United Kingdom", "socialMediaIds":[{"type": "Twitter", "smid": "clevertim"}, {"type": "Facebook", "smid": "mikesperanza"}], "customerType":"C", "customFields":{"464": "China","463":"USD"}, "tags":["Europe", "twitter", "important"] }
Related Clevertim CRM documentation
https://github.com/clevertim/clevertim-crm-api/blob/master/resources/contact.md#add-a-new-contact
Listing contacts
The listContacts operation retrieves all contacts.
<clevertimcrm.listContacts/>
Sample request
Following is a sample REST/JSON request that can be handled by the listContacts operation.
{ "apiUrl":"https://www.clevertim.com", "apiKey":"tPnLGkETTPFbxfu0oIJtchPDxzBWzXaTSOStS4B6aGHIszKFrCZ11557" }
Related Clevertim CRM documentation
https://github.com/clevertim/clevertim-crm-api/blob/master/resources/contact.md#get-all-contacts
Sample configuration
Following is a sample proxy service that illustrates how to connect to Clevertim CRM with the init
operation and use the createContact
operation. The sample request for this proxy can be found in createContact sample request. You can use this sample as a template for using other operations in this category.
<?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="ClevertimCRM_createContact" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence onError="faultHandlerSeq"> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="apiKey" expression="json-eval($.apiKey)"/> <property name="firstName" expression="json-eval($.firstName)"/> <property name="lastName" expression="json-eval($.lastName)"/> <property name="title" expression="json-eval($.title)"/> <property name="description" expression="json-eval($.description)"/> <property name="isCompany" expression="json-eval($.isCompany)"/> <property name="companyId" expression="json-eval($.companyId)"/> <property name="email" expression="json-eval($.email)"/> <property name="phones" expression="json-eval($.phones)"/> <property name="website" expression="json-eval($.website)"/> <property name="address" expression="json-eval($.address)"/> <property name="city" expression="json-eval($.city)"/> <property name="postCode" expression="json-eval($.postCode)"/> <property name="country" expression="json-eval($.country)"/> <property name="socialMediaIds" expression="json-eval($.socialMediaIds)"/> <property name="customerType" expression="json-eval($.customerType)"/> <property name="customFields" expression="json-eval($.customFields)"/> <property name="tags" expression="json-eval($.tags)"/> <clevertimcrm.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiKey>{$ctx:apiKey}</apiKey> </clevertimcrm.init> <clevertimcrm.createContact> <firstName>{$ctx:firstName}</firstName> <lastName>{$ctx:lastName}</lastName> <title>{$ctx:title}</title> <description>{$ctx:description}</description> <isCompany>{$ctx:isCompany}</isCompany> <companyId>{$ctx:companyId}</companyId> <email>{$ctx:email}</email> <phones>{$ctx:phones}</phones> <website>{$ctx:website}</website> <address>{$ctx:address}</address> <city>{$ctx:city}</city> <postCode>{$ctx:postCode}</postCode> <country>{$ctx:country}</country> <socialMediaIds>{$ctx:socialMediaIds}</socialMediaIds> <customerType>{$ctx:customerType}</customerType> <customFields>{$ctx:customFields}</customFields> <tags>{$ctx:tags}</tags> </clevertimcrm.createContact> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>