POST Create New Lead

Create a new lead

Endpoint /api/v1.0/Leads
Method POST
Request Headers Content-Type : application/json

Request Body Sample

{  
   "FirstName":"Tarun",
   "LastName":"Chawla",
   "Company":"Aprimo",
   "Title":"Director",
   "Address1":"123 Main St",
   "Address2":"Suite 489",
   "City":"Chicago",
   "State":"IL",
   "PostalCode":"60601",
   "Country":"United States",
   "Email":"tchawla@Aprimo.com",
   "Phone":"555-555-5555",
   "Description":"",
   "Source":"Website",
   "ExternalId":"textcharid",
   "Segment":"SMB", <- Will associated segment if it exists as a configured segment in the platform
   "AssignedTo":"", <- Must contain a valid Brand username or and empty string to avoid 400 Bad Request Error
   "Score":"48",
   "LeadAttributes": [  <- Lead Attributes section is optional. 'AttributeName' must be replaced by a configured lead attributes API name from the Platform
       {
            "AttributeName": "MyLeadAttribute1",
            "AttributeValue": "Attribute1Value",
       },
       {
            "AttributeName": "MyLeadAttribute2",
            "AttributeValue": "Attribute2Value"
       }
    ]
}

Response Body Sample

{  
   "LeadId":1021,
   "FirstName":"Tarun",
   "LastName":"Chawla",
   "Company":"Aprimo",
   "Title":"Director",
   "Address 1":"123 Main St",
   "Address 2":"Suite 489",
   "City":"Chicago",
   "State":"IL",
   "PostalCode":"60601",
   "Country":"United States",
   "Email":"tchawla@Aprimo.com",
   "Phone":"555-555-5555",
   "Description":"",
   "Source":"Website",
   "ExternalId":"textcharid66",
   "LeadSegment":"SMB",
   "AssignedTo":"",
   "LeadCreationDate":"2013-02-26T00:00:00Z",
   "Score":"48",
   "LeadAttributes": [
       {
            "AttributeName": "MyLeadAttribute1",
            "AttributeValue": "Attribute1Value",
       },
       {
            "AttributeName": "MyLeadAttribute2",
            "AttributeValue": "Attribute2Value"
       }
    ]
}

GET a Single Lead

Gets a Single Lead by Id

Endpoint /api/v1.0/Leads/{id}
Method GET
Request Headers Content-Type : application/json
Request Body Sample N/A

Response Body Sample

{  
   "LeadId":"1910",
   "FirstName":"Tarun",
   "LastName":"Chawla",
   "Company":"Aprimo DM",
   "ExternalId":"textcharid",
   "Title":"Director",
   "LeadSegment":"SMB",
   "AssignedTo":"Justin Sullivan",
   "Email":"tchawla@revenew.com",
   "Phone":"555-555-5555",
   "Country":"USA",
   "Address 1":"123 Main St",
   "Address 2":"Suite 489",
   "City":"Chicago",
   "State":"IL",
   "PostalCode":"60601",
   "Source":"Website",
   "Score":"48",
   "Description":"",
   "Brand":"NewCo It",
   "DistributionStatus":"Routed",
   "DistributionPartner":"Distribution Partner Inc.",
   "AcceptanceStatus":"Accepted",
   "AcceptanceModified":"2013-02-26T00:00:00Z",
   "LastModifiedDate":"2013-02-26T00:00:00Z",
   "CurrentLeadStatus":"Working",
   "CurrentLeadStatusDate":"2013-02-26T00:00:00Z",
   "AdditionalContacts":[  
      {  
         "FirstName":"FName",
         "LastName":"LName",
         "Title":"Title",
         "Email":"Email",
         "Phone":"Phone"
      },
      {  
         "FirstName":"Tarun",
         "LastName":"Chawla",
         "Title":"Director",
         "Email":"tchawla@revenew.com",
         "Phone":"555-555-5555"
      }
   ],
   "Comments":[  
      {  
         "Comment":"This is the comment.",
         "AddedBy":"Tarun Chawla",
         "Date":"2013-02-26T00:00:00Z"
      },
      {  
         "Comment":"This is another comment.",
         "AddedBy":"Tarun Chawla",
         "Date":"2013-02-27T00:00:00Z "
      }
   ],
   "Opportunities":[  
      {  
         "Name":"OppName",
         "Value":"4000",
         "Status":"Qualification",
         "TargetClose":"2013-02-26",
         "Description":"This is a hot opportunity."
      }
   ],
   "Tasks":[  
      {  
         "Title":"Call Lead",
         "AssignTo":"Tarun Chawla",
         "TaskDate":"2015-04-12",
         "TaskType":"Appointment Set",
         "TaskDetails":"Call this lead and see if they are interested in ACME Proset."
      }
   ],
   "BrandLeadAttributes": [
    {
         "AttributeDisplayName": "Attribute TextBox",
         "APIFieldName": "AttributeTextBox",
         "AnswerTypeName": "TextBox",
         "AttributeValue": "txt updated again"
     },
     {
         "AttributeDisplayName": "Attribute Dropdown",
         "APIFieldName": "AttributeDropdown",
         "AnswerTypeName": "DropDown",
         "AttributeValue": "ddl-1"
     },
     {
         "AttributeDisplayName": "Attribute Checkbox",
         "APIFieldName": "AttributeCheckboxd",
         "AnswerTypeName": "CheckBox",
         "AttributeValue": "chk1,chk3"
     }
  ]
}

 

GET All Leads

Gets all Leads

Endpoint /api/v1.0/Leads
Method GET
Query String Parameters &lastmodified={date}: Optional. If this is supplied, only return leads that have a last modified date greater than or equal to the passed in date.
&includeclosed={true/false}: Optional. If this is supplied, return leads in any status.
Request Headers Content-Type : application/json
Request Body Sample N/A

Response Body Sample

[  
   {  
      "LeadId":"1910",
      "FirstName":"Tarun",
      "LastName":"Chawla",
      "Company":"Aprimo DM",
      "ExternalId":"textcharid",
      "Title":"Director",
      "LeadSegment":"SMB",
      "AssignedTo":"Justin Sullivan",
      "Email":"tchawla@revenew.com",
      "Phone":"555-555-5555",
      "Country":"United States",
      "Address 1":"123 Main St",
      "Address 2":"Suite 489",
      "City":"Chicago",
      "State":"IL",
      "PostalCode":"60601",
      "Source":"Website",
      "Score":"48",
      "CustomField1":"Product 1",
      "CustomField2":"Yes",
      "CustomField3":"Category",
      "Description":"",
      "DistributionStatus":"Routed",
      "DistributionPartner":"Distribution Partner Inc.",
      "AcceptanceStatus":"Accepted",
      "AcceptanceModified":"2013-02-26T00:00:00Z",
      "Description":"",
      "LastModifiedDate":"2013-02-26T00:00:00Z",
     "CurrentLeadStatus":"Working",
     "CurrentLeadStatusDate":"2013-02-26T00:00:00Z
   },
   {  
      "LeadId":"1911",
      "FirstName":"Kevin",
      "LastName":"Souers",
      "Company":"Aprimo DM",
      "ExternalId":"textcharid",
      "Title":"CTO",
      "LeadSegment":"SMB",
      "AssignedTo":"Justin Sullivan",
      "Email":"ksouers@revenew.com",
      "Phone":"555-555-5555",
      "Country":"United States",
      "Address 1":"123 Main St",
      "Address 2":"Suite 489",
      "City":"Chicago",
      "State":"IL",
      "PostalCode":"60601",
      "Source":"Website",
      "Score":"48",
      "CustomField1":"Product 1",
      "CustomField2":"Yes",
      "CustomField3":"Category",
      "Description":"",
      "DistributionStatus":"Routed",
      "DistributionPartner":"Distribution Partner Inc.",
      "AcceptanceStatus":"Accepted",
      "AcceptanceModified":"2013-02-26T00:00:00Z",
      "LastModifiedDate":"2013-02-26T00:00:00Z",
     "CurrentLeadStatus":"Working",
     "CurrentLeadStatusDate":"2013-02-26T00:00:00Z

   }
]

PUT Update Lead

Updates an existing lead

Endpoint /api/v1.0/Leads/{id}
Method PUT
Request Headers Content-Type : application/json

Request Body Sample

{
    "FirstName" : "Band2",
    "LastName" : "sa1511",
    "Company" : "Omnie",
    "Title" : "Director",
    "Address1" : "123 Main St",
    "Address2" : "Suite 489",
    "City" : "Chicago",
    "State" : "IL",
    "PostalCode" : "60601",
    "Country" : "United States",
    "Email" : "tchawla@test.com",
    "Phone" : "555-555-5556",
    "Description" : "Lead api test",
    "Source" : "Website",
    "ExternalId"  : "textcharid05",
    "LeadSegment"   : "03 Segment",
    "AssignedTo"  : "Joe",<- Must contain a valid Brand username or and empty string to avoid 400 Bad Request Error
    "LeadCreationDate" :"2013-02-26T00:00:00Z",
    "Score" : "48",
    "LeadAttributes": [
        {
            "AttributeName": "Attribute TextBox",
            "AttributeValue": "txt updated again"
        },
        {
            "AttributeName": "Attribute Dropdown",
            "AttributeValue": "ddl-1"
        },
        {
            "AttributeName": "Attribute Checkbox",
            "AttributeValue": "chk1,chk3"
        }
    ]
}

Response Body Sample

{
    "LeadId": 3105,
    "FirstName": "Band2",
    "LastName": "sa1511",
    "Company": "Omnie",
    "Title": "Director",
    "Address1": "123 Main St",
    "Address2": "Suite 489",
    "City": "Chicago",
    "State": "Illinois",
    "PostalCode": "60601",
    "Country": "United States",
    "Email": "tchawla@test.com",
    "Phone": "555-555-5556",
    "Description": "Lead api test",
    "Source": "Website",
    "ExternalId": "textcharid05",
    "LeadSegment": "03 Segment",
    "Owner": "Joe",
    "LeadCreationDate": "2019-11-28T10:01:00Z",
    "Score": "48",
    "LeadAttributes": [
        {
            "AttributeName": "Attribute TextBox",
            "AttributeValue": "txt updated again"
        },
        {
            "AttributeName": "Attribute Dropdown",
            "AttributeValue": "ddl-1"
        },
        {
            "AttributeName": "Attribute Checkbox",
            "AttributeValue": "chk1,chk3"
        }
    ]
}

POST Add Lead Status

Adds a lead status for an existing lead

Endpoint /api/v1.0/Leads/{id}/leadstatuses
Method POST
Request Headers Content-Type : application/json

Request Body Sample

{  
   "Status":"Working – Contacted"
}

DELETE Lead

Deletes a single lead and all associated child data (additional contacts, comments, tasks, distribution history, and opportunities).

Endpoint /api/v1.0/Leads/{id}
Method DELETE
Request Headers Content-Type : application/json
Request Body Sample N/A
Response Body Sample Empty