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 Opportunities in Clevertim CRM



Overview

The following operations allow you to work with opportunities. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with opportunities, see Sample configuration.

OperationDescription

createOpportunity

Creates an opportunity.

updateOpportunityUpdates an opportunity.
listOpportunitiesRetrieves all opportunities.

Operation details

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

Creating an opportunity

The createOpportunity operation adds a new opportunity.

createOpportunity
<clevertimcrm.createOpportunity>
    <tags>{$ctx:tags}</tags>
    <status>{$ctx:status}</status>
    <customFields>{$ctx:customFields}</customFields>
    <leadUser>{$ctx:leadUser}</leadUser>
    <customer>{$ctx:customer}</customer>
    <currency>{$ctx:currency}</currency>
    <description>{$ctx:description}</description>
    <name>{$ctx:name}</name>
    <value>{$ctx:value}</value>
</clevertimcrm.createOpportunity> 
Properties
  • tags: Tags for the opportunity.
  • status: The status of the opportunity.
  • customFields: Custom fields for the opportunity.
  • leadUser: The lead user of the opportunity.
  • customer: The customer of the opportunity.
  • currency: The currency of the opportunity.
  • description: The description of the opportunity.
  • name: The name of the opportunity.
  • value: The value of the opportunity.
Sample request

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

Sample Request for createOpportunity
{
	"apiUrl":"https://www.clevertim.com",
	"apiKey":"tPnLGkETTPFbxfu0oIJtchPDxzBWzXaTSOStS4B6aGHIszKFrCZ11557",
	"name":"Sample Opportunity",
	"value":1500,
	"description":"Sample Opportunity",
	"status":"",
	"leadUser":"",
	"currency":"LKR",
	"customer":"114520",
	"tags":["sale","user"],
	"customFields":{"439": "user","438":"LKR"}
} 
Related Clevertim CRM documentation

https://github.com/clevertim/clevertim-crm-api/blob/master/resources/opportunity.md#add-a-new-opportunity

Updating an opportunity

The updateOpportunity operation updates an opportunity.

updateOpportunity
<clevertimcrm.updateOpportunity>
    <tags>{$ctx:tags}</tags>
    <status>{$ctx:status}</status>
    <customFields>{$ctx:customFields}</customFields>
    <leadUser>{$ctx:leadUser}</leadUser>
    <customer>{$ctx:customer}</customer>
    <currency>{$ctx:currency}</currency>
    <id>{$ctx:id}</id>
    <description>{$ctx:description}</description>
    <name>{$ctx:name}</name>
    <value>{$ctx:value}</value>
</clevertimcrm.updateOpportunity>
Properties 
  • tags: Tags for the opportunity.
  • status: The status of the opportunity.
  • customFields: Custom fields for the opportunity.
  • leadUser: The lead user of the opportunity.
  • customer: The customer of the opportunity.
  • currency: The currency of the opportunity.
  • id: The ID of the opportunity.
  • description: The description of the opportunity.
  • name: The name of the opportunity.
  • value: The value of the opportunity.
Sample request

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

updateOpportunity
{
	"apiUrl":"https://www.clevertim.com",
	"apiKey":"tPnLGkETTPFbxfu0oIJtchPDxzBWzXaTSOStS4B6aGHIszKFrCZ11557",
	"name":"Sample",
	"id":"11307",
	"value":3500,
	"description":"Sample Opportunity",
	"status":"Lost",
	"leadUser":"",
	"currency":"LKR",
	"customer":"114600",
	"tags":["sale","facebook"],
	"customFields":{"439": "user","438":"LKR"}
}
Related Clevertim CRM documentation

https://github.com/clevertim/clevertim-crm-api/blob/master/resources/opportunity.md#update-an-existing-opportunity

Listing opportunities

The listOpportunities operation retrieves all opportunities.

listOpportunities
<clevertimcrm.listOpportunities/>
Sample request

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

listOpportunities
{
	"apiUrl":"https://www.clevertim.com",
	"apiKey":"7hRfxQ3mXxLrnAmiIYxSIsFTlGdCYNfnqjY4pXtaAhYEe04HP3Z11751"
}
Related Clevertim CRM documentation

https://github.com/clevertim/clevertim-crm-api/blob/master/resources/opportunity.md#get-all-opportunities

Sample configuration

Following is a sample proxy service that illustrates how to connect to Clevertim CRM with the init operation and use the createOpportunity operation. The sample request for this proxy can be found in createOpportunity 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="ClevertimCRM_createOpportunity"
       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="name" expression="json-eval($.name)"/>
         <property name="description" expression="json-eval($.description)"/>
         <property name="status" expression="json-eval($.status)"/>
         <property name="leadUser" expression="json-eval($.leadUser)"/>
         <property name="value" expression="json-eval($.value)"/>
         <property name="currency" expression="json-eval($.currency)"/>
         <property name="customFields" expression="json-eval($.customFields)"/>
         <property name="customer" expression="json-eval($.customer)"/>
         <property name="tags" expression="json-eval($.tags)"/>
         <clevertimcrm.init>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <apiKey>{$ctx:apiKey}</apiKey>
         </clevertimcrm.init>
         <clevertimcrm.createOpportunity>
            <tags>{$ctx:tags}</tags>
            <status>{$ctx:status}</status>
            <customFields>{$ctx:customFields}</customFields>
            <leadUser>{$ctx:leadUser}</leadUser>
            <customer>{$ctx:customer}</customer>
            <currency>{$ctx:currency}</currency>
            <description>{$ctx:description}</description>
            <name>{$ctx:name}</name>
            <value>{$ctx:value}</value>
         </clevertimcrm.createOpportunity>
         <respond/>
      </inSequence>
      <outSequence>
        <send/>
      </outSequence>
   </target>
   <description/>
</proxy>