Update Bulk Leads

Use this operation to update any of the writable fields of an existing Leads object. The request body must include all writable fields of the existing object as returned in a read response. Writable fields omitted from the request body are set to NULL.

Parameters

Body Params
JSON:json
Leads details needs to be passed as body parameter,it should be in JSON format.
XML:string
Leads details needs to be passed as body parameter,it should be in XML format.
Path Params
yourCompany:string
The Company name need to passed in the base URL.For eg. if you enter xyzcompany name, the url https://{yourCompany}.agiliron.net/agiliron/api-40.php/Bulk-Leads will change to https://xyzcompany.agiliron.net/agiliron/api-40.php/Bulk-Leads
callback_urlstring
The callback URL need to passed in the base URL , which means after the code execution this file gets called.For eg. https://abc.php, the url https://{yourCompany}.agiliron.net/agiliron/api-40.php/Bulk-Leads?callback_url=https://abc.php&key=xyzkey
In this case after execution of code the curl call will made on https://abc.php.
sendRecordNostring
The value as true or false need to passed for this parameter in the base URL.For eg. if you want record number with response then send value as true ,For eg.
https://xyzcompany.agiliron.net/agiliron/api-40.php/Bulk-Leads&key=xyzkey&sendRecordNo=true.
By default it will be false.
Header Params
Accept:string
Response header need to be passed for eg. application/json or application/xml.
Query Auth
key:string
API key needs to be passed in this variable.The option to enter API key will appear when you click on Try it button.This will be the first option in AUTHENTICATION block.Default is SET to 0.
Header Auth
apiKey:string
Dedicated API key needs to be passed in this variable via header.The option to enter API key will appear when you click on Try it button.This will be the second option in AUTHENTICATION block.Default is SET to 0.

Sample Code

{
    "Leads": {
        "Lead": [
            {
                "LeadId": "123",
                "Salutation": "--None--",
                "FirstName": "John",
                "LastName": "Doe",
                "Company": "Company",
                "Designation": "",
                "Phone": "9867675645",
                "Mobile": "9867675645",
                "Fax": "",
                "Email": "[email protected]",
                "Website": "",
                "Industry": "Biotechnology",
                "SICCode": "8889",
                "AnnualRevenue": "5555",
                "NumberOfEmployees": "3",
                "ContactType": "Analyst",
                "LeadSource": "Existing Customer",
                "LeadStatus": "Contact in Future",
                "Rating": "Acquired",
                "EmailOptOut": "1",
                "YahooID": "",
                "CreatedTime": "07-30-2020 06:12:06",
                "ModifiedTime": "07-01-2021 10:35:52",
                "Street": "Agiliron, 1515 Clay St",
                "City": "St Oakland",
                "State": "California",
                "Zip": "94612",
                "Country": "United States",
                "Description": "",
                "AssignedTo": "admin",
                "AssignedGroupName": "",
                "DefaultCurrency": "US Dollar",
                "LeadCustomFields": {
                    "CustomField": [
                        {
                            "Name": "Text",
                            "Value": "value"
                        },
                        {
                            "Name": "Date",
                            "Value": "00-00-0000"
                        }
                    ]
                }
            },
            {
                "LeadId": "456",
                "Salutation": "Mr.",
                "FirstName": "Test",
                "LastName": "Lead",
                "Company": "Company",
                "Designation": "",
                "Phone": "",
                "Mobile": "9867675645",
                "Fax": "updoer",
                "Email": "[email protected]",
                "Website": "",
                "Industry": "--None--",
                "SICCode": "0",
                "AnnualRevenue": "0",
                "NumberOfEmployees": "",
                "ContactType": "--None--",
                "LeadSource": "--None--",
                "LeadStatus": "--None--",
                "Rating": "--None--",
                "EmailOptOut": "0",
                "YahooID": "[email protected]",
                "CreatedTime": "08-13-2020 00:59:18",
                "ModifiedTime": "08-13-2020 01:00:06",
                "Street": "Agiliron, 1515 Clay St",
                "City": "St Oakland",
                "State": "CA",
                "Zip": "94612",
                "Country": "United States",
                "Description": "description",
                "AssignedTo": "admin",
                "AssignedGroupName": "",
                "DefaultCurrency": "US Dollar",
                "LeadCustomFields": {
                    "CustomField": [
                        {
                            "Name": "Text",
                            "Value": "value"
                        },
                        {
                            "Name": "Date",
                            "Value": "00-00-0000"
                        }
                    ]
                }
            }
        ]
    }
}
<Leads>
   <Lead>
      <LeadId>123</LeadId>
      <Salutation>--None--</Salutation>
      <FirstName>John</FirstName>
      <LastName>Doe</LastName>
      <Company>Company</Company>
      <Designation></Designation>
      <Phone>9867675645</Phone>
      <Mobile>9867675645</Mobile>
      <Fax></Fax>
      <Email>[email protected]</Email>
      <Website></Website>
      <Industry>Biotechnology</Industry>
      <SICCode>8889</SICCode>
      <AnnualRevenue>5555</AnnualRevenue>
      <NumberOfEmployees>3</NumberOfEmployees>
      <ContactType>Analyst</ContactType>
      <LeadSource>Existing Customer</LeadSource>
      <LeadStatus>Contact in Future</LeadStatus>
      <Rating>Acquired</Rating>
      <EmailOptOut>1</EmailOptOut>
      <YahooID></YahooID>
      <CreatedTime>07-30-2020 06:12:06</CreatedTime>
      <ModifiedTime>07-01-2021 10:35:52</ModifiedTime>
      <Street>Agiliron, 1515 Clay St</Street>
      <City>St Oakland</City>
      <State>California</State>
      <Zip>94612</Zip>
      <Country>United States</Country>
      <Description></Description>
      <AssignedTo>admin</AssignedTo>
      <AssignedGroupName></AssignedGroupName>
      <DefaultCurrency>US Dollar</DefaultCurrency>
      <LeadCustomFields>
         <CustomField>
            <Name>Text</Name>
            <Value>value</Value>
         </CustomField>
         <CustomField>
            <Name>Date</Name>
            <Value>00-00-0000</Value>
         </CustomField>
      </LeadCustomFields>
   </Lead>
   <Lead>
      <LeadId>456</LeadId>
      <Salutation>Mr.</Salutation>
      <FirstName>Test</FirstName>
      <LastName>Lead</LastName>
      <Company>Company</Company>
      <Designation></Designation>
      <Phone></Phone>
      <Mobile>9867675645</Mobile>
      <Fax>updoer</Fax>
      <Email>[email protected]</Email>
      <Website></Website>
      <Industry>--None--</Industry>
      <SICCode>0</SICCode>
      <AnnualRevenue>0</AnnualRevenue>
      <NumberOfEmployees></NumberOfEmployees>
      <ContactType>--None--</ContactType>
      <LeadSource>--None--</LeadSource>
      <LeadStatus>--None--</LeadStatus>
      <Rating>--None--</Rating>
      <EmailOptOut>0</EmailOptOut>
      <YahooID>[email protected]</YahooID>
      <CreatedTime>08-13-2020 00:59:18</CreatedTime>
      <ModifiedTime>08-13-2020 01:00:06</ModifiedTime>
      <Street>Agiliron, 1515 Clay St</Street>
      <City>St Oakland</City>
      <State>CA</State>
      <Zip>94612</Zip>
      <Country>United States</Country>
      <Description>description</Description>
      <AssignedTo>admin</AssignedTo>
      <AssignedGroupName></AssignedGroupName>
      <DefaultCurrency>US Dollar</DefaultCurrency>
      <LeadCustomFields>
         <CustomField>
            <Name>Text</Name>
            <Value>value</Value>
         </CustomField>
         <CustomField>
            <Name>Date</Name>
            <Value>00-00-0000</Value>
         </CustomField>
      </LeadCustomFields>
   </Lead>
</Leads>

Sample Response

{
  "MCM": {
    "response": {
      "objectType": "Leads",
      "syncTime": "2021-06-11 04:13:24"
    },
    "parameters": {
      "results": {
        "message": {
          "status": "Success",
          "success_message": "Bulk Leads Update Initiated Successfully.",
          "batch_id": "thggii1212kjkl"
        }
      }
    }
  }
}
<MCM>
    <response>
        <objectType>Leads</objectType>
        <syncTime>2021-06-11 04:13:24</syncTime>
    </response>
    <parameters>
        <results>
            <message>
                <status>Success</status>
                <success_message> Bulk Leads Update Initiated Successfully. </success_message>
              	<batch_id>thggii1212kjkl</batch_id>
            </message>
        </results>
    </parameters>
</MCM>

WADL

<?xml version="1.0" encoding="utf-8"?>
<application>
   <resources base="https://{yourCompany}.agiliron.net/agiliron/api-40/">
     <resource path="Bulk-Leads">
       <method name="PUT">
         <request>
           <param name="key" type="xsd:string" style="query" required="true"/>
           <param name="LeadId" type="xsd:int" style="body" required="true"/>
           <param name="Salutation" type="xsd:string" style="body"/>
           <param name="FirstName" type="xsd:string" style="body"/>
           <param name="LastName" type="xsd:string" style="body" required="true"/>
           <param name="Company" type="xsd:string" style="body" required="true"/>
           <param name="Designation" type="xsd:string" style="body"/>
           <param name="Phone" type="xsd:string" style="body"/>
           <param name="Mobile" type="xsd:string" style="body"/>
           <param name="Fax" type="xsd:string" style="body"/>
           <param name="Email" type="xsd:string" style="body"/>
           <param name="Website" type="xsd:string" style="body"/>
           <param name="Industry" type="xsd:string" style="body"/>
           <param name="SICCode" type="xsd:int" style="body"/>
           <param name="AnnualRevenue" type="xsd:int" style="body"/>
           <param name="NumberOfEmployees" type="xsd:string" style="body"/>
           <param name="ContactType" type="xsd:string" style="body"/>
           <param name="LeadSource" type="xsd:string" style="body"/>
           <param name="LeadStatus" type="xsd:string" style="body"/>
           <param name="Rating" type="xsd:string" style="body"/>
           <param name="EmailOptOut" type="xsd:string" style="body"/>
           <param name="YahooID" type="xsd:string" style="body"/>
           <param name="CreatedTime" type="xsd:dateTime" style="body"/>
           <param name="ModifiedTime" type="xsd:dateTime" style="body"/>
           <param name="Street" type="xsd:decimal" style="body"/>
           <param name="City" type="xsd:decimal" style="body"/>
           <param name="State" type="xsd:decimal" style="body"/>
           <param name="Zip" type="xsd:decimal" style="body"/>
           <param name="Country" type="xsd:decimal" style="body"/>
           <param name="Description" type="xsd:string" style="body"/>
           <param name="AssignedGroupName" type="xsd:string" style="body"/>
         </request> 
         <response status="200"> 
            <representation mediaType="application/xml" element="yn:ResultSet"/> 
         </response> 
         <response status="400"> 
            <representation mediaType="application/xml" element="ya:Error"/> 
         </response> 
       </method> 
     </resource> 
   </resources>
 </application>

Sample Webhook

<?php
	$url = "https://{your_custom_url}"; //this custom url will be called after the code is executed
	$curlConn = curl_init();
	curl_setopt($curlConn, CURLOPT_CUSTOMREQUEST, "PUT");
	curl_setopt($curlConn, CURLOPT_POSTFIELDS,$results); //$results contain the result set
	curl_setopt($curlConn,CURLOPT_URL,$url);
	curl_setopt($curlConn, CURLOPT_SSL_VERIFYHOST, 0);
	curl_setopt($curlConn, CURLOPT_SSL_VERIFYPEER, 0);
	curl_setopt($curlConn, CURLOPT_RETURNTRANSFER, 1);
	$ret = curl_exec($curlConn);
?>
<result>
   <SuccessNumber>1</SuccessNumber>
   <FailureNumber>1</FailureNumber>
   <Success>
      <Leads>
         <LeadId>123</LeadId>
         <LeadName>John Doe</LeadName>
      </Leads>
   </Success>
   <Failure>
      <Leads>
         <LeadId>456</LeadId>
         <Message>Lead Last Name cannot be blank</Message>
      </Leads>
   </Failure>
</result>
{
	"result": {
		"SuccessNumber": "1",
		"FailureNumber": "1",
		"Success": {
			"Leads": {
				"LeadId": "123",
				"LeadName": "John Doe"
			}
		},
		"Failure": {
			"Product": {
				"LeadId": "456",
				"Message": "Lead Last Name cannot be blank"
			}
		}
	}
}
<result>
   <SuccessNumber>1</SuccessNumber>
   <FailureNumber>1</FailureNumber>
   <Success>
      <Leads>
         <LeadId>123</LeadId>
         <LeadName>John Doe</LeadName>
         <Record>1</Record>
      </Leads>
   </Success>
   <Failure>
      <Leads>
         <LeadId>456</LeadId>
         <Message>Lead Last Name cannot be blank</Message>
         <Record>2</Record>
      </Leads>
   </Failure>
</result>
{
	"result": {
		"SuccessNumber": "1",
		"FailureNumber": "1",
		"Success": {
			"Leads": {
				"LeadId": "123",
				"LeadName": "John Doe",
				"Record": "1"
			}
		},
		"Failure": {
			"Product": {
				"LeadId": "456",
				"Message": "Lead Last Name cannot be blank",
				"Record": "2"
			}
		}
	}
}