Lead Class Reference

Description

Renders a lead.

Statuses which may be returned in the "status" parameter:

0 = open
1 = pending
10 = won
11 = lost
12 = cancelled

Protected Member Functions

 _render ($lead)
 Renders a lead. More...
 
 _renderStub ($lead)
 Renders a lead stub. More...
 

Member Function Documentation

_render (   $lead)
protected

Renders a lead.

{
"id": 42,
"entityType": "Leads",
"rev": "7",
"name": "Lead–32",
"htmlUrl": "https://app01.nutshell.com/lead/1234", // a url to open with a web browser for this entity
"avatarUrl": "/avatar/accounts/6/1/13cd44673d30fbd542a374d3beeabd6dc270302b8dd1d983e9a3a15bcdc1afe4/1596036505", // This URL has authentication built in
"tags": ["Some tag", "Some other tag"],
"description": "Very Important",
"createdTime": "2010-01-13T23:08:06+0000",
"creator": User, // or Origin
"primaryAccount": Account,
"milestone": Milestone,
"stageset": Stageset,
"activitiesCount": {
"0": 0,
"1": 0,
"2": 0,
"-1": 1
},
"status": 0,
"confidence": 31,
"completion": 77,
"urgency": "10",
"isOverdue": false,
"market": Market,
"assignee": User, // or Team
"processes": [ Process, ... ], // only includes process stubs
"sources": [ Lead_SourceMap, ... ],
"channels" [ "paid-search", "email" ]
"competitors": [ Lead_CompetitorMap, ... ],
"products": [ Lead_ProductMap, ... ],
"contacts": [ Lead_ContactMap, ... ],
"accounts": [ Lead_AccountMap, ... ],
"dueTime": "2010-01-03T15:00:00+0000",
"nextStepDueTime": "2010-07-15T12:00:00+0000",
"value": {
"currency": "USD",
"amount": 26365
},
"normalizedValue": {
"currency": "USD",
"amount": 26365
},
"notes": [ Note, ... ],
"lastContactedDate": null, // ATOM/rfc3339 format. Returns null if the value is empty.
"deletedTime": "2010-09-28T13:30:00+0000", // ATOM/rfc3339 format. Only present when deleted.
"priority": 1 // possible values: 1 (`hot`), or 0 (not `hot`)
}

The activitiesCount field represents the number of activities associated with the lead. It is indexed by activity statuses.

0 = STATUS_SCHEDULED
1 = STATUS_LOGGED
2 = STATUS_CANCELLED
-1 = STATUS_OVERDUE (note: STATUS_OVERDUE implies STATUS_SCHEDULED)

So, for example, activitiesCount["-1"] is the number of overdue activities associated with the lead.

The nextStepDueTime field is used by Nutshell to determine whether the lead is overdue (and therefore what color the lead's pie chart should be).

The name field is a unique string identifying the lead to users on the Nutshell website. The number contained in this string is not necessarily the same as the lead ID, which is invisible to users. Use the Core::findLeads() method with the "number" query parameter to retrieve the lead corresponding to a name.

See also
Process::_renderStub for output for process stubs
Returns
array
_renderStub (   $lead)
protected

Renders a lead stub.

{
"stub": true,
"id": 145,
"entityType": "Leads",
"rev": "5",
"name": "Lead–12",
"status": 10,
"completion": 100,
"value": {
"currency": "USD",
"amount": 1780
},
"primaryAccountName": "Auto-Owners Insurance",
"primaryContactName": "Joe Smith",
"dueTime": "2010-07-18T12:00:00+0000",
"isOverdue": true,
"nextStepDueTime": "2010-07-15T12:00:00+0000",
"closedTime": "2010-07-18T12:00:00+0000"
}
Returns
array