API : Leads

Leads Management API


Get Pending Leads

POST /api/lead/list

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
ispid N ISP ID
resellerid N Reseller ID
id N Pending Lead ID
name N Customer Name. Wildcard search is available. You can use % in search query.
mobile N Mobile Number
email N Customer Email
location_code N Location code
status N Lead Status. Allowed values are: Welcome-Call, Installation, Field-Verification, Not-Feasible, Customer-Refused
source N Lead Source. Allowed values are: Web, Sms, Phone, WalkIn, Agent, Others
created_by N Created user
welcomecall_by N Welcomecall done user
fieldverification_by N Field verification done user
installed_by N Installated user
created_on N Lead Creation date in yyyy-mm-dd format
created_from N Created from date in yyyy-mm-dd format
created_upto N Created upto date in yyyy-mm-dd format
welcomecall_on N Welcome call done date in yyyy-mm-dd format
welcomecall_from N Welcome call from date in yyyy-mm-dd format
welcomecall_upto N Welcome call upto date in yyyy-mm-dd format
fieldverification_on N Field verification date in yyyy-mm-dd format
fieldverification_from N Field verification from date in yyyy-mm-dd format
fieldverification_upto N Field verification upto date in yyyy-mm-dd format
installed_on N Installated date in yyyy-mm-dd format
installed_from N Installated from date in yyyy-mm-dd format
installed_upto N Installated upto date in yyyy-mm-dd format
remind_on N Reminder date in yyyy-mm-dd format
remind_from N Reminder from date in yyyy-mm-dd format
remind_upto N Reminder upto date in yyyy-mm-dd format
rows_limit N Limit the number of records in result set. Default: 10. Max value: 100
rows_offset N Fetch records from this offset position. Default: 0
sort_field N Sorts the result. Allowed values are: id, name, mobile, email, status, source, created_at, remind_at, installed_at
sort_order N Sort order. Allowed values are: asc, desc. Default: asc
show_count N Shows Records Count only, instead of detailed results. This will ignore rows_limit, rows_offset. Allowed values are: 0, 1. Default: 0

Typical API Call

curl -X POST $BASE_URL/api/lead/list -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4"


Leads Status Count

POST /api/lead/status_count

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
ispid N ISP ID
resellerid N Reseller ID
location_code N Location code
sub_location_code N Location code
source N Lead Source. Allowed values are: Web, Sms, Phone, WalkIn, Agent

Typical API Call

curl -X POST $BASE_URL/api/lead/status_count -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4"


Create Lead

POST /api/lead/create

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
ispid N ISP ID
resellerid N Reseller ID
name Y Customer name
mobile Y Mobile number
email Y Email
address Y Address
source Y Lead Source. Allowed values are: Web, Sms, Phone, WalkIn, Agent
location_code N Location Code
sub_location_code N Sub Location Code

Typical API Call

curl -X POST $BASE_URL/api/lead/create -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d resellerid=1 -d name="Some Name" -d mobile="12344444" -d email="abc@email.com" -d address="1st st, 12345" -d source="Web"

The expected API Response will be

{
    "result": 353,
    "error": null
}

Returns newly created Lead id value, upon success. Upon failure result contains null value, and error contains error description.


Update Lead

This updat UPI is useful to complete the Welcome call completetion update, Installation status update and Final test updation.

POST /api/lead/update

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
id Y Lead ID of the Pending Leads
ispid N ISP ID. To change ISP ID
resellerid N Reseller ID. To change Reseller ID
status Y Current Status of the Lead. Allowed values are: Welcome-Call, Field-Verification, Installation, Customer-Refused, Not-Feasible, Final-Test
report Y Action Report. This field takes different values based on current status.
If lead status is Welcome-Call then report can be any one of values: Customer-Accepted, Customer-Refused
If lead status is Field-Verification then report can be any one of values: Feasible, Not-Feasible, Customer-Refused
If lead status is Installation then report can be any one of values: Installation-Completed, Not-Feasible, Customer-Refused
If lead status is Final-Test then report can be any one of values: Completed, Cancel
If lead status is Customer-Refused then report can be any one of values: Customer-Accepted, Cancel
If lead status is Not-Feasible then report can be any one of values: Feasible, Cancel
reason N Reason for the above report, reason is required ony if report is given as: Customer-Refused, Not-Feasible, Cancel. Otherwise not required
location_code N Location Code. Optionally you can change lead's location_code. This filed is considered only upto 'Installation' completetion stage
sub_location_code N Sub Location Code. Optionally you can change lead's sub_location_code. This filed is considered only upto 'Installation' completetion stage

Typical API Call

To update the street field of the lead record having id=13 and status in 'Welcome-Call'

curl -X POST $BASE_URL/api/lead/update -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d id=13 -d status="Welcome-Call" -d report="Customer-Accepted"

The expected API Response will be

{
    "result": "done",
    "error": null
}

Set or Unset Reminder on Lead

Reminder option in lead is useful, if you want to postpone the action on lead for some reasons.

POST /api/lead/reminder

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
id Y Pending Lead ID
action Y Reminder set/unset action. Allowed values are: set, unset
timestamp N Timestamp to set reminder. Timestamp in yyyy-mm-dd hh:mm:ss format. This field is only required, if action=set

Typical API Call

curl -X POST $BASE_URL/api/lead/reminder -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d id=14 -d action="set" -d timestamp="2023-03-04 00:00:00"

The expected API Response will be

{
    "result": "done",
    "error": null
}

Return back the lead to Previous status

This option is useful, if you want to move the lead status to backward state.

POST /api/lead/return

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
id Y Pending Lead ID
status Y New status of lead. Allowed values are: Allowed values are: Welcome-Call, Field-Verification, Installation.
Lead status can be set towards backward direction only. Welcome-Call ← Field-Verification ← Installation ← Final-Test
If the lead status is 'Welcome-Call', it can not return back to any state.
If the lead status is 'Field-Verification', it can be return back to 'Welcome-Call' state.
If the lead status is 'Customer-Refused', it can be return back to 'Welcome-Call' state.
If the lead status is 'Installation', it can be return back to 'Welcome-Call' or 'Field-Verification' state.
If the lead status is 'Not-Feasible', it can be return back to 'Welcome-Call' or 'Field-Verification' state.
If the lead status is 'Final-Test', it can be return back to 'Welcome-Call' or 'Field-Verification' or 'Installation' state.

Typical API Call

curl -X POST $BASE_URL/api/lead/return -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d id=12 -d status="Welcome-Call"

The expected API Response will be

{
    "result": "done",
    "error": null
}

Get Closed Leads list

POST /api/lead/closed

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
ispid N ISP ID
resellerid N Reseller ID
id N Closed Lead ID
name N Customer Name. Wildcard search is available. You can use % in search query.
mobile N Mobile Number
email N Customer Email
location_code N Location code
status N Lead Status. Allowed values are: Completed, Cancelled
source N Lead Source. Allowed values are: Web, Sms, Phone, WalkIn, Agent, Others
serviceid N Service ID of the Completed Lead
created_by N Created user
welcomecall_by N Welcomecall done user
fieldverification_by N Field verification done user
installed_by N Installated user
created_on N Lead Creation date in yyyy-mm-dd format
created_from N Created from date in yyyy-mm-dd format
created_upto N Created upto date in yyyy-mm-dd format
welcomecall_on N Welcome call done date in yyyy-mm-dd format
welcomecall_from N Welcome call from date in yyyy-mm-dd format
welcomecall_upto N Welcome call upto date in yyyy-mm-dd format
fieldverification_on N Field verification date in yyyy-mm-dd format
fieldverification_from N Field verification from date in yyyy-mm-dd format
fieldverification_upto N Field verification upto date in yyyy-mm-dd format
installed_on N Installated date in yyyy-mm-dd format
installed_from N Installated from date in yyyy-mm-dd format
installed_upto N Installated upto date in yyyy-mm-dd format
closed_on N Closed date in yyyy-mm-dd format
closed_from N Closed from date in yyyy-mm-dd format
closed_upto N Closed upto date in yyyy-mm-dd format
rows_limit N Limit the number of records in result set. Default: 10. Max value: 100
rows_offset N Fetch records from this offset position. Default: 0
sort_field N Sorts the result. Allowed values are: id, name, mobile, email, status, source, created_at, closed_at, installed_at
sort_order N Sort order. Allowed values are: asc, desc. Default: asc
show_count N Shows Records Count only, instead of detailed results. This will ignore rows_limit, rows_offset. Allowed values are: 0, 1. Default: 0

Typical API Call

curl -X POST $BASE_URL/api/lead/closed -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4"