Leads

Last updated 6 days ago

You can use the API to get or set lead information.

get
Get all leads

https://api.tiledesk.com
/v1/:project_id/leads
Allows an account to list all the leads.
Request
Response
Path Parameters
project_id
required
string
the Project Id is a unique code assigned to your project when you create it in Tiledesk.
Headers
Authorization
required
string
authorization token. Basic Auth or JWT
Content-Type
required
string
use "application/json" value
Query Parameters
sortField
optional
string
what field to sort the results by.
direction
optional
string
sort direction: 1 or -1. Return the results in ascending or descending order. defaults to desc
email
optional
string
search a lead by the email address
page
optional
string
what page of results to fetch. defaults to first page.
200: OK
{
"perPage":40,
"count":179,
"leads":[
{
"_id":"5c81593adf767b0017d1aa66",
"updatedAt":"2019-03-07T17:47:38.393Z",
"createdAt":"2019-03-07T17:47:38.393Z",
"lead_id":"SRbb2PfbSFcgICv9VQBcURZeloh1",
"fullname":"Guest",
"attributes":{
...
},
"id_project":"5b55e806c93dde00143163dd",
"createdBy":"system",
"__v":0
},
{
"_id":"5c81565edf767b0017d1aa35",
"updatedAt":"2019-03-07T17:35:26.132Z",
"createdAt":"2019-03-07T17:35:26.132Z",
"lead_id":"WTteQpKpGZN1aElfFYCP9YPaaLN2",
"fullname":"Guest",
"attributes":{
...
},
"id_project":"5b55e806c93dde00143163dd",
"createdBy":"system",
"__v":0
},
...
]
}

Example

curl -v -X GET -H 'Content-Type: application/json' -u andrea.leo@f21.it:123456 https://api.tiledesk.com/v1/5b55e806c93dde00143163dd/leads

get
Get a lead by id

https://api.tiledesk.com
/v1/:project_id/leads/:id
Fetches a lead by his or her Lead ID
Request
Response
Path Parameters
id
required
string
the lead identifier
project_id
required
string
The project_id is a unique code assigned to your project when you create it in Tiledesk
Headers
Authorization
required
string
authorization token. Basic Auth or JWT
Content-Type
required
string
use "application/json" value
200: OK
{
"_id":"5c81593adf767b0017d1aa66",
"updatedAt":"2019-03-07T17:47:38.393Z",
"createdAt":"2019-03-07T17:47:38.393Z",
"lead_id":"SRbb2PfbSFcgICv9VQBcURZeloh1",
"fullname":"Guest",
"attributes":{ ... },
"id_project":"5b55e806c93dde00143163dd",
"createdBy":"system",
"__v":0
}

Example

curl -v -X GET -H 'Content-Type: application/json' -u andrea.leo@f21.it:123456 https://api.tiledesk.com/v1/5b55e806c93dde00143163dd/leads/5c81593adf767b0017d1aa66

post
Create a new lead

https://api.tiledesk.com
/v1/:project_id/leads
Allows to add more leads.
Request
Response
Path Parameters
project_id
required
string
The project_id is a unique code assigned to your project when you create it in Tiledesk
Headers
Authorization
required
string
authorization token. Basic Auth or JWT
Content-Type
required
string
use "application/json" value
Body Parameters
email
optional
string
the lead email address
lead_id
required
string
the external id of the lead
fullname
optional
string
The lead fullname
200: OK
{
"_id":"5c81593adf767b0017d1aa66",
"updatedAt":"2019-03-07T17:47:38.393Z",
"createdAt":"2019-03-07T17:47:38.393Z",
"lead_id":"SRbb2PfbSFcgICv9VQBcURZeloh1",
"fullname":"Guest",
"attributes":{ ... },
"id_project":"5b55e806c93dde00143163dd",
"createdBy":"system",
"__v":0
}

Example:

curl -v -X POST -H 'Content-Type: application/json' -u andrea.leo@f21.it:123456 -d '{"fullanem":"andrea", "lead_id":"123456"}' https://api.tiledesk.com/v1/5b55e806c93dde00143163dd/leads