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 SalesBinder



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

OperationDescription

createContact

Creates a new contact.

getContactByIdRetrieves contact details.
listContactsRetrieves all contacts.

Operation details

This section provides further details on the operations related to contacts.

Creating a new contact

The createContact operation creates a new contact.

createContact
<salesbinder.createContact>
    <lastName>{$ctx:lastName}</lastName>
    <phone>{$ctx:phone}</phone>
    <fax>{$ctx:fax}</fax>
    <cell>{$ctx:cell}</cell>
    <firstName>{$ctx:firstName}</firstName>
    <email1>{$ctx:email1}</email1>
    <email2>{$ctx:email2}</email2>
	<jobTitle>{$ctx:jobTitle}</jobTitle>
</salesbinder.createContact>
Properties
  • lastName: Last name of the contact.
  • phone: Phone number of the contact.
  • fax: Fax number of the contact.
  • cell: Cell number of the contact.
  • firstName: First name of the contact.
  • email1: E-mail of the contact.
  • email2: Secondary e-mail of the contact.
  • jobTitle: Job title of the contact.
Sample request

Following is a sample REST/JSON request that can be handled by the createContact operation.

Sample Request for createContact
{
	"apiUrl":"https://sblsoft.salesbinder.com",
	"apiKey":"cb2192d4832db952ac5d0ec9f41770e88c733c0f",
	"firstName":"Sam",
	"lastName":"Liyanage",
	"phone":"094716903644",
	"fax":"094715485655",
	"cell":"094875263566",
	"email1":"sam@one.com",
	"email2":"sam@two.com",
	"jobTitle":"Java Developer"
}
Related SalesBinder documentation

http://www.salesbinder.com/kb/api-functions/create-new-contact/

Retrieving contact details by ID

The getContactById operation retrieves contact details by ID.

getContactById
<salesbinder.getContactById>
	<id>{$ctx:id}</id>
</salesbinder.getContactById>
Properties
  • id: Required - The ID of the contact.
Sample request

Following is a sample REST/JSON request that can be handled by the getContactById operation.

Sample Request for getContactById
{
	"apiUrl":"https://sblsoft.salesbinder.com",
	"apiKey":"cb2192d4832db952ac5d0ec9f41770e88c733c0f",
	"id":"54d35b8c-9138-4353-9888-1c660ad26590"
}
Related SalesBinder documentation

http://www.salesbinder.com/kb/api-functions/view-contact-details/

Retrieving all contacts

The listContacts operation retrieves all contacts.

listContacts
<salesbinder.listContacts>
	<page>{$ctx:page}</page>
</salesbinder.listContacts>
Properties
  • page: The page number of which the contact needs to be retrieved.
Sample request

Following is a sample REST/JSON request that can be handled by the listContacts operation.

Sample Request for listContacts
{
	"apiUrl":"https://sblsoft.salesbinder.com",
	"apiKey":"cb2192d4832db952ac5d0ec9f41770e88c733c0f",
	"page":"4"
}
Related SalesBinder documentation

http://www.salesbinder.com/kb/api-functions/list-contacts/

Sample configuration

Following is a sample proxy service that illustrates how to connect to SalesBinder with the init operation and use the createContact operation. The sample request for this proxy can be found in the createContact sample request. You can use this sample as a template for using other operations in this category.

Sample Proxy
<?xml version="1.0" encoding="UTF-8"?>
	<proxy xmlns="http://ws.apache.org/ns/synapse" name="salesbinder_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="lastName" expression="json-eval($.lastName)"/>
      <property name="phone" expression="json-eval($.phone)"/>
      <property name="fax" expression="json-eval($.fax)"/>
      <property name="cell" expression="json-eval($.cell)"/>
      <property name="firstName" expression="json-eval($.firstName)"/>
      <property name="email1" expression="json-eval($.email1)"/>
      <property name="email2" expression="json-eval($.email2)"/>
      <property name="jobTitle" expression="json-eval($.jobTitle)"/>
      <salesbinder.init>
         <apiUrl>{$ctx:apiUrl}</apiUrl>
         <apiKey>{$ctx:apiKey}</apiKey>
      </salesbinder.init>
      <salesbinder.createContact>
         <lastName>{$ctx:lastName}</lastName>
         <phone>{$ctx:phone}</phone>
         <fax>{$ctx:fax}</fax>
         <cell>{$ctx:cell}</cell>
         <firstName>{$ctx:firstName}</firstName>
         <email1>{$ctx:email1}</email1>
         <email2>{$ctx:email2}</email2>
         <jobTitle>{$ctx:jobTitle}</jobTitle>
      </salesbinder.createContact>
	   <respond/>
	 </inSequence>
	  <outSequence>
	   <send/>
	  </outSequence>
	 </target>
   <description/>
  </proxy>