Lead V2 is a new version of the Lead object. To instruct the API to use it, the payload needs to include the compatibility section requesting LeadObject version 1.0 or higher, see below
"Compatibility": { "LeadObject": "1.3" }
Most of the properties and operations of Lead V1 are compatible with Lead V2 but there are some key breaking changes.
See below a summary of the breaking changes that Lead V2 includes:
- Removed properties "Process" and "CurrentProcessStage"/"ProcessStage", replaced by new approach to manage processes and stages that uses new properties "ProcessSetup" and "ProcessStageSetup".
MetaData
Read Lead V2 metadata (simple)
// POST https://api.maximizer.com/octopus/Read
// Authorization: Bearer <token>
{
"Schema": {
"Scope": {
"Fields": 1
},
"Criteria": {
"SearchQuery": {
"Key": {
"$TREE": "/Lead"
}
}
}
},
"Compatibility": {
"SchemaObject": "1.0",
"LeadObject": "1.3" // Explicitly ask for Lead V2
}
}
Read Lead V2 metadata (more)
// POST https://api.maximizer.com/octopus/Read
// Authorization: Bearer <token>
{
"Schema": {
"Scope": {
"Fields": {
"Key": 1,
"Alias": 1,
"Type": 1,
"Name": 1,
"AppliesTo": 1,
"Sortable": 1,
"Nullable": 1,
"Assignable": 1,
"Queryable": 1,
"Mandatory": 1,
"Attributes": 1,
"HasOption": 1,
"DisplayValue": 1,
"Inactive": 1
}
},
"Criteria": {
"SearchQuery": {
"Key": {
"$TREE": "/Lead"
}
}
}
},
"Compatibility": {
"SchemaObject": "1.0",
"LeadObject": "1.3" // Explicitly ask for Lead V2
}
}
FieldOptions
Read Lead V2 FieldOptions - ProcessSetup
// POST https://api.maximizer.com/octopus/Read
// Authorization: Bearer <token>
{
// Applicable to all those properties which have "HasOption": true
"Lead": {
"FieldOptions": {
"ProcessSetup": [
{
"Key": 1,
"DisplayValue": 1
}
]
}
},
"Compatibility": {
"SchemaObject": "1.0",
"LeadObject": "1.3" // Explicitly ask for Lead V2
}
}
Read Lead V2 FieldOptions - ProcessStageSetup
// POST https://api.maximizer.com/octopus/Read
// Authorization: Bearer <token>
{
// Applicable to all those properties which have "HasOption": true
"Lead": {
"FieldOptions": {
"ProcessStageSetup": [
{
"Key": 1,
"DisplayValue": 1
}
]
},
"Data": {
"ProcessSetupKey": "UHJvY2Vzc1NldHVwCUAqL0xFQUQJMA==" // Key of the process setup for which you want to get the stages
}
},
"Compatibility": {
"SchemaObject": "1.0",
"LeadObject": "1.3" // Explicitly ask for Lead V2
}
}
Read Lead V2 FieldOptions - Status
// POST https://api.maximizer.com/octopus/Read
// Authorization: Bearer <token>
{
// Applicable to all those properties which have "HasOption": true
"Lead": {
"FieldOptions": {
"Status": [
{
"Key": 1,
"DisplayValue": 1
}
]
}
},
"Compatibility": {
"SchemaObject": "1.0",
"LeadObject": "1.3" // Explicitly ask for Lead V2
}
}
Lead V2 CRUD
Create - Lead V2
// POST https://api.maximizer.com/octopus/Create
// Authorization: Bearer <token>
{
"Lead": {
"Data": {
"Key": null,
"CompanyName": "E. Brown Enterprises",
"MrMs": "Mr", // Check Field Options
"FirstName": "Marty",
"LastName": "McFly",
"Email": {
"Address": "[email protected]",
"Description": "Main",
"Default": true
},
"WebSite": "https://www.example.com/",
"AssignedTo": {
"UID": "Master"
},
"Status": 1, // Check Field Options
"Address": {
"AddressLine1": "1234 Main St.",
"City": "Anytown",
"StateProvince": "BC",
"ZipCode": "12345",
"Country": "CAN"
},
"Phone1": {
"Default": true,
"Number": "1-800-123-1234",
"Description": "Main",
"Extension": "888"
},
"Source": [ // Check Field Options
"2"
],
"NoEmployees": 6,
"Industry": [ // Check Field Options
"8"
],
"SourceUrl": "https://maximizer.visualstudio.com/Yahoo",
"ProcessSetupKey": "UHJvY2Vzc1NldHVwCUAqL0xFQUQJMA==", // Available only in Lead V2
"ProcessStageSetupKey": "UHJvY2Vzc1N0YWdlU2V0dXAJQCovTEVBRAkx" // Available only in Lead V2
}
},
"Compatibility": {
"LeadObject": "1.3" // Explicitly ask for Lead V2
}
}
Read - Lead V2
// POST https://api.maximizer.com/octopus/Read
// Authorization: Bearer <token>
{
"Lead": {
"Scope": {
"Fields": {
"Key": {
"ID": 1,
"Number": 1,
"Value": 1
},
"CompanyName": 1,
"MrMs": 1,
"FirstName": 1,
"MiddleName": 1,
"LastName": 1,
"FullName": 1,
"Salutation": 1,
"Position": 1,
"Email": 1,
"WebSite": 1,
"Status": {
"Value": 1,
"key": {
"Id": 1,
"Number": 1,
"Value": 1
},
"DisplayValue": 1
},
"Age": 1,
"AssignedTo": {
"UID": 1,
"Key": 1
},
"Address": {
"AddressLine1": 1,
"AddressLine2": 1,
"City": 1,
"StateProvince": 1,
"Zipcode": 1,
"Country": 1,
"DisplayValue": 1
},
"Phone1": 1,
"Phone2": 1,
"Creator": {
"UID": 1,
"Key": 1
},
"CreationDate": 1,
"ModifiedBy": 1,
"LastModifyDate": 1,
"AbEntryKey": 1,
"OpportunityKey": 1,
"Source": 1,
"NoEmployees": 1,
"Industry": 1,
"SourceUrl": 1,
"ProcessSetup": 1, // Available only in Lead V2
"ProcessStageSetup": 1 // Available only in Lead V2
}
},
"Criteria": {
"SearchQuery": {},
"Top": 3
}
},
"Compatibility": {
"LeadObject": "1.3" // Explicitly ask for Lead V2
}
}
Update - Lead V2
// POST https://api.maximizer.com/octopus/Update
// Authorization: Bearer <token>
{
"Lead": {
"Data": {
"Key": "TGVhZAkyMzA3MDcwMDAyNDA3NzIyMzgxNjlMRQkw", // Mandatory
"ProcessSetupKey": "UHJvY2Vzc1NldHVwCUAqL0xFQUQJMA==", // Available only in Lead V2
"ProcessStageSetupKey": "UHJvY2Vzc1N0YWdlU2V0dXAJQCovTEVBRAkx" // Available only in Lead V2
}
},
"Compatibility": {
"LeadObject": "1.3" // Explicitly ask for Lead V2
}
}
Delete - Lead V2
// POST https://api.maximizer.com/octopus/Delete
// Authorization: Bearer <token>
// Same as Lead V1, example here just for reference
{
"Lead": {
"Data": {
"Key": "TGVhZAkyNTAzMjUwMDAwMDAxODk3ODQ0NThMRQkw"
}
}
}