Team Member Distribution Options

Rules for distributing lead offers to members of a team.

The following fields relate to the Team Member Distribution Options endpoint.

FieldLimitsRequired?Writeable?
team_id
YesYes

The team that the team member distribution options apply to

user_id
YesYes

The team member that the distribution option applies to

rank
NoYes

Only applicable if order_by is set to 'Rank'. The lowest rank will receive the offer first.

mins_until_lead_offer
NoYes

Only applicable if order_by is set to 'Time'. Latency (in minutes) until the team member will receive a lead offer.

assign_automatically
YesYes

Whether or not a team member will be automatically assigned a lead or if it has to be manually claimed

has_call_alert
NoYes

Whether or not the user will be notified of a lead alert by phone call

has_text_alert
NoYes

Whether or not the user will be notified of a lead alert by SMS

has_email_alert
NoYes

Whether or not the user will be notified of a lead alert by email

Permissions.

The user can only submit, update, and remove a team member distribution option for teams they have created

Submit one Team Member Distribution Option

To submit one team member distribution option:

POST https://api-v2.liondesk.com//team-member-distribution-options headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

The request object should have this form:{ "team_id": 8, "user_id": 2, "rank": 1, "mins_until_lead_offer": 0, "assign_automatically": true, "has_call_alert": false, "has_text_alert": true, "has_email_alert": false }

Update one Team Member Distribution Option

To update some attributes on one team member distribution option:

PATCH https://api-v2.liondesk.com//team-member-distribution-options/10 headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

data: {
rank: "1",
mins_until_lead_offer: "0"
}

Get One Team Member Distribution Option

To get one team member distribution option:

GET https://api-v2.liondesk.com//team-member-distribution-options/1 headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

The response object will have this form:{ "team": { "id": 8, "name": "Microsoft" }, "user": { "id": 2, "first_name": "Bill", "last_name": "Gates", "email": "bill@microsoft.com" }, "rank": 1, "mins_until_lead_offer": 0, "assign_automatically": true, "has_call_alert": false, "has_text_alert": true, "has_email_alert": false }

Find All Team Member Distribution Options

You find/search team member distribution options by issuing a GET request to the base endpoint:

GET https://api-v2.liondesk.com//team-member-distribution-options headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

The response will contain an array of team member distribution option objects, like so:

{ "total": 2, "limit": 10, "skip": 0, "data": [ { "team": { "id": 8, "name": "Microsoft" }, "user": { "id": 2, "first_name": "Bill", "last_name": "Gates", "email": "bill@microsoft.com" }, "rank": 1, "mins_until_lead_offer": 0, "assign_automatically": true, "has_call_alert": false, "has_text_alert": true, "has_email_alert": false }, { "team": { "id": 10, "name": "Apple" }, "user": { "id": 3, "first_name": "Steve", "last_name": "Jobs", "email": "steve@apple.com" }, "rank": 2, "mins_until_lead_offer": 6, "assign_automatically": false, "has_call_alert": true, "has_text_alert": false, "has_email_alert": true } ] }

Filtering Team Member Distribution Options

The following filtering operators may be mixed and matched as desired.

Equality

You may query team member distribution option fields directly by specifying equality parameters in the request URI:GET /team-member-distribution-options?rank=1&assign_automatically=false

You may wish to exclude results having some value with $ne:GET /team-member-distribution-options?has_email_alert[$ne]=true

Dates & Times

Unless otherwise stated all dates and times should be in ISO8601 format. Examples: 2012-09-27, 2012-09-27T09:15:00Z (UTC), 2012-09-27T09:15:00-07:00 (PDT)

Limiting and Pagination

$limit will return only the number of results you specify: GET /team-member-distribution-options?$limit=2

$skip will skip the specified number of results, useful for paginating:GET /team-member-distribution-options?has_email_alert=true&$limit=2&$skip=2

Sorting

$sort will order results based on the field given.

Use 1 for ascending order, and -1 for descending order:GET /team-member-distribution-options?$limit=10&$sort[mins_until_lead_offer]=-1

Inclusion / Exclusion

Find all records where the property values are ($in) some set:GET /team-member-distribution-options?mins_until_lead_offer[$in]=3If the column matches any of the given values, the resource shall be returned.

Similarly, you may exclude certain values with ($nin):GET /team-member-distribution-options?mins_until_lead_offer[$nin]=3

Comparisons

You may use the less-than $lt and less-than-or-equal $lte operators to filter your queries: GET /team-member-distribution-options?mins_until_lead_offer[$lt]=10

Similarly, you may use greater-than $gt and greater-than-or-equal $gte operators to filter your queries: GET /team-member-distribution-options?mins_until_lead_offer[$gte]=3

You may also combine these operators to query for a range of values: GET /team-member-distribution-options?mins_until_lead_offer[$gte]=2&mins_until_lead_offer[$lte]=20

Remove

Team Member Distribution Options can be removed with a delete request.

DELETE https://api-v2.liondesk.com//team-member-distribution-options/163 headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }