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 Leads in Base CRM
Overview
The following operations allow you to work with leads. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with leads, see Sample configuration.
Operation | Description |
---|---|
Creates a new lead. | |
deleteLead | Deletes a lead. |
listLeads | Lists leads. |
setLead | Updates a lead. |
Operation details
This section provides details on the operations.
Creating leads
The createLead
operation creates a new lead.
<basecrm.createLead> <leadLastName>{$ctx:leadLastName}</leadLastName> <leadCompanyName>{$ctx:leadCompanyName}</leadCompanyName> <leadServiceUrl>{$ctx:leadServiceUrl}</leadServiceUrl> <leadFirstName>{$ctx:leadFirstName}</leadFirstName> <leadEmail>{$ctx:leadEmail}</leadEmail> <leadPhone>{$ctx:leadPhone}</leadPhone> <leadMobile>{$ctx:leadMobile}</leadMobile> <leadTwitter>{$ctx:leadTwitter}</leadTwitter> <leadSkype>{$ctx:leadSkype}</leadSkype> <leadFacebook>{$ctx:leadFacebook}</leadFacebook> <leadLinkedin>{$ctx:leadLinkedin}</leadLinkedin> <leadStreet>{$ctx:leadStreet}</leadStreet> <leadZip>{$ctx:leadZip}</leadZip> <leadRegion>{$ctx:leadRegion}</leadRegion> <leadCity>{$ctx:leadCity}</leadCity> <leadCountry>{$ctx:leadCountry}</leadCountry> <leadTitle>{$ctx:leadTitle}</leadTitle> <leadDescription>{$ctx:leadDescription}</leadDescription> </basecrm.createLead>
Properties
leadLastName:
The last name of the lead. It is required if the first name is provided and not required if the company name is provided.leadCompanyName:
The company name of the lead. It is required unless the last name is provided.leadServiceUrl:
The service URL for the lead's category.leadFirstName:
The first name of the lead.leadEmail:
The email address of the lead.leadPhone:
The phone number of the lead.leadMobile:
The mobile phone number of the lead.leadTwitter:
The Twitter nickname of the lead.leadSkype:
The Skype nickname of the lead.leadFacebook:
The Facebook nickname of the lead.leadLinkedin:
The LinkedIn nickname of the lead.leadStreet:
The street address of the lead.leadZip:
The ZIP code of the lead.leadRegion:
The region of the lead.leadCity:
The city of the lead.leadCountry:
The country of the lead.leadTitle:
The job title of the lead.leadDescription:
The description of the lead.
Sample request
Following is a sample REST/JSON request that can be handled by the createLead operation.
{ "apiUrl":"https://sales.futuresimple.com", "leadServiceUrl":"https://leads.futuresimple.com", "email":"wso2connector.abdera@gmail.com", "password":"1qaz2wsx@", "leadLastName":"Johnson5", "leadCompanyName":"Base5", "leadFirstName":"Mark5", "leadEmail":"mark@email.com", "leadPhone":"+15552221111", "leadMobile":"+15552221111", "leadTwitter":"mytwitternickname", "leadSkype":"myskypenickname", "leadFacebook":"myfacebooknickname", "leadLinkedin":"mylinkedinnickname", "leadStreet":"15 Madison Ave", "leadZip":"02134", "leadRegion":"MA", "leadCity":"Boston", "leadCountry":"USA", "leadTitle":"CEO", "leadDescription":"Description" }
Related Base documentation
http://dev.futuresimple.com/api/methods/leads-create
Deleting a lead
The deleteLead
operation removes a specific lead.
<basecrm.deleteLead> <leadServiceUrl>{$ctx:leadServiceUrl}</leadServiceUrl> <leadId>{$ctx:leadId}</leadId> </basecrm.deleteLead>
Properties
leadServiceUrl:
The service URL for the lead's category.leadId:
Required - The unique ID of the lead to be deleted.
Sample request
Following is a sample REST/JSON request that can be handled by the deleteLead operation.
{ "apiUrl":"https://sales.futuresimple.com", "leadServiceUrl":"https://leads.futuresimple.com", "email":"wso2connector.abdera@gmail.com", "password":"1qaz2wsx@", "leadId":"13513554" }
Related Base documentation
http://dev.futuresimple.com/api/methods/leads-delete
Listing leads
The listLeads
operation retrieves a list of leads.
<basecrm.listLeads> <leadServiceUrl>{$ctx:leadServiceUrl}</leadServiceUrl> <page>{$ctx:page}</page> <sortBy>{$ctx:sortBy}</sortBy> </basecrm.listLeads>
Properties
leadServiceUrl:
Defines the number of records to be returned (default is 25).page:
The page of the list of leads. A collection has 20 leads. If it is not provided, it is assumed that the page is 1.sortBy:
Sorting criteria for the list of leads. Possible values:id_desc
,first_name
,last_name
,added_on
Sample request
Following is a sample REST/JSON request that can be handled by the listLeads operation.
{ "apiUrl":"https://sales.futuresimple.com", "leadServiceUrl":"https://leads.futuresimple.com", "email":"wso2connector.abdera@gmail.com", "password":"1qaz2wsx@", "page":"1", "sortBy":"first_name" }
Related Base documentation
http://dev.futuresimple.com/api/methods/leads-index
Updating a lead
The setLead
operation updates information related to the lead.
<basecrm.setLead> <leadId>{$ctx:leadId}</leadId> <leadFirstName>{$ctx:leadFirstName}</leadFirstName> <leadLastName>{$ctx:leadLastName}</leadLastName> <leadCompanyName>{$ctx:leadCompanyName}</leadCompanyName> <leadServiceUrl>{$ctx:leadServiceUrl}</leadServiceUrl> <leadEmail>{$ctx:leadEmail}</leadEmail> <leadPhone>{$ctx:leadPhone}</leadPhone> <leadMobile>{$ctx:leadMobile}</leadMobile> <leadTwitter>{$ctx:leadTwitter}</leadTwitter> <leadSkype>{$ctx:leadSkype}</leadSkype> <leadFacebook>{$ctx:leadFacebook}</leadFacebook> <leadLinkedin>{$ctx:leadLinkedin}</leadLinkedin> <leadStreet>{$ctx:leadStreet}</leadStreet> <leadZip>{$ctx:leadZip}</leadZip> <leadRegion>{$ctx:leadRegion}</leadRegion> <leadCity>{$ctx:leadCity}</leadCity> <leadCountry>{$ctx:leadCountry}</leadCountry> <leadTitle>{$ctx:leadTitle}</leadTitle> <leadDescription>{$ctx:leadDescription}</leadDescription> </basecrm.setLead>
Properties
leadId:
Required - The ID of the lead.leadFirstName:
The first name of the lead.leadLastName:
The last name of the lead. It is required if the first name is provided and not required if the company name is provided.leadCompanyName:
The company name of the lead. It is required unless the last name is provided.leadServiceUrl:
The service URL for the lead's category.leadEmail:
The email address of the lead.leadPhone:
The phone number of the lead.leadMobile:
The mobile phone number of the lead.leadTwitter:
The Twitter nickname of the lead.leadSkype:
The Skype nickname of the lead.leadFacebook:
The Facebook nickname of the lead.leadLinkedin:
The LinkedIn nickname of the lead.leadStreet:
The street address of the lead.leadZip:
The ZIP code of the lead.leadRegion:
The region of the lead.leadCity:
The city of the lead.leadCountry:
The address of the lead.leadTitle:
The job title of the lead.leadDescription:
The description of the lead.
Sample request
Following is a sample REST/JSON request that can be handled by the setLead operation.
{ "apiUrl":"https://sales.futuresimple.com", "leadServiceUrl":"https://leads.futuresimple.com", "email":"wso2connector.abdera@gmail.com", "password":"1qaz2wsx@", "leadId":"13513653", "leadFirstName":"Ramindu", "leadLastName":":Deshapriya", "leadCompanyName":"Virtusa", "leadEmail":"test@gmail.com", "leadPhone":"011-2588999", "leadMobile":"078-7537796", "leadTwitter":"mytwitternickname", "leadSkype":"myskypenickname", "leadFacebook":"myfacebooknickname", "leadLinkedin":"mylinkedinnickname", "leadStreet":"25 Madison Ave", "leadZip":"02134", "leadRegion":"MA", "leadCity":"Boston", "leadCountry":"USA", "leadTitle":"CEO", "leadDescription":"Description" }
Related Base documentation
http://dev.futuresimple.com/api/methods/leads-update
Sample configuration
Following is a sample proxy service that illustrates how to connect to Base CRM with the init
operation and use the createLead operation. The sample request for this proxy can be found in createLead 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="basecrm_createLead" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence onError="faultHandlerSeq"> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="leadServiceUrl" expression="json-eval($.leadServiceUrl)"/> <property name="email" expression="json-eval($.email)"/> <property name="password" expression="json-eval($.password)"/> <property name="leadLastName" expression="json-eval($.leadLastName)"/> <property name="leadCompanyName" expression="json-eval($.leadCompanyName)"/> <property name="leadFirstName" expression="json-eval($.leadFirstName)"/> <property name="leadEmail" expression="json-eval($.leadEmail)"/> <property name="leadPhone" expression="json-eval($.leadPhone)"/> <property name="leadMobile" expression="json-eval($.leadMobile)"/> <property name="leadTwitter" expression="json-eval($.leadTwitter)"/> <property name="leadSkype" expression="json-eval($.leadSkype)"/> <property name="leadFacebook" expression="json-eval($.leadFacebook)"/> <property name="leadLinkedin" expression="json-eval($.leadLinkedin)"/> <property name="leadStreet" expression="json-eval($.leadStreet)"/> <property name="leadZip" expression="json-eval($.leadZip)"/> <property name="leadRegion" expression="json-eval($.leadRegion)"/> <property name="leadCity" expression="json-eval($.leadCity)"/> <property name="leadCountry" expression="json-eval($.leadCountry)"/> <property name="leadTitle" expression="json-eval($.leadTitle)"/> <property name="leadDescription" expression="json-eval($.leadDescription)"/> <basecrm.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <email>{$ctx:email}</email> <password>{$ctx:password}</password> </basecrm.init> <basecrm.createLead> <leadServiceUrl>{$ctx:leadServiceUrl}</leadServiceUrl> <leadLastName>{$ctx:leadLastName}</leadLastName> <leadCompanyName>{$ctx:leadCompanyName}</leadCompanyName> <leadFirstName>{$ctx:leadFirstName}</leadFirstName> <leadEmail>{$ctx:leadEmail}</leadEmail> <leadPhone>{$ctx:leadPhone}</leadPhone> <leadMobile>{$ctx:leadMobile}</leadMobile> <leadTwitter>{$ctx:leadTwitter}</leadTwitter> <leadSkype>{$ctx:leadSkype}</leadSkype> <leadFacebook>{$ctx:leadFacebook}</leadFacebook> <leadLinkedin>{$ctx:leadLinkedin}</leadLinkedin> <leadStreet>{$ctx:leadStreet}</leadStreet> <leadZip>{$ctx:leadZip}</leadZip> <leadRegion>{$ctx:leadRegion}</leadRegion> <leadCity>{$ctx:leadCity}</leadCity> <leadCountry>{$ctx:leadCountry}</leadCountry> <leadTitle>{$ctx:leadTitle}</leadTitle> <leadDescription>{$ctx:leadDescription}</leadDescription> </basecrm.createLead> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>