Add Lead

Use this operation to add new Lead object.

Parameters

Body Params
JSON:json
Lead details needs to be passed as body parameter,it should be in JSON format.
XML:string
Lead 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-31.php/Leads will change to https://xyzcompany.agiliron.net/agiliron/api-31.php/Leads
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.

Sample Code

{
    "Leads": {
        "Lead": {
            "Salutation": "--None--",
            "FirstName": "Test",
            "LastName": "New Lead",
            "Company": "Test Company",
            "Designation": "Test Title",
            "Phone": "56412356",
            "Mobile": "7412536589",
            "Fax": "5689746",
            "Email": "[email protected]",
            "Website": "",
            "Industry": "Recreation",
            "SICCode": "10",
            "AnnualRevenue": "65",
            "NumberOfEmployees": "25",
            "ContactType": "Customer",
            "LeadSource": "Self Generated",
            "LeadStatus": "Contacted",
            "Rating": "Acquired",
            "EmailOptOut": "No",
            "YahooID": "[email protected]",
            "CreatedTime": "01-24-2020 05:01:35",
            "ModifiedTime": "01-24-2020 05:05:56",
            "Street": "1515 Clay Street",
            "City": "Oakland",
            "State": "CA",
            "Zip": "94624",
            "Country": "United States",
            "Description": "The Description Goes here.",
            "AssignedTo": "admin",
            "AssignedGroupName": "",
            "DefaultCurrency": "USD",
            "LeadCustomFields": {
                "CustomField": [{
                        "Name": "CustomFied1",
                        "Value": "Custom info 1"
                    },
                    {
                        "Name": "CustomFied2",
                        "Value": "Custom info 2"
                    }
                ]
            }
        }
    }
}
<Leads>
   <Lead>
      <Salutation>--None--</Salutation>
      <FirstName>Test</FirstName>
      <LastName>New Lead</LastName>
      <Company>Test Company</Company>
      <Designation>Test Title</Designation>
      <Phone>56412356</Phone>
      <Mobile>7412536589</Mobile>
      <Fax>5689746</Fax>
      <Email>[email protected]</Email>
      <Website />
      <Industry>Recreation</Industry>
      <SICCode>10</SICCode>
      <AnnualRevenue>65</AnnualRevenue>
      <NumberOfEmployees>25</NumberOfEmployees>
      <ContactType>Customer</ContactType>
      <LeadSource>Self Generated</LeadSource>
      <LeadStatus>Contacted</LeadStatus>
      <Rating>Acquired</Rating>
      <EmailOptOut>No</EmailOptOut>
      <YahooID>[email protected]</YahooID>
      <CreatedTime>01-24-2020 05:01:35</CreatedTime>
      <ModifiedTime>01-24-2020 05:05:56</ModifiedTime>
      <Street>1515 Clay Street</Street>
      <City>Oakland</City>
      <State>CA</State>
      <Zip>94624</Zip>
      <Country>United States</Country>
      <Description>The Description Goes here.</Description>
      <AssignedTo>admin</AssignedTo>
      <AssignedGroupName></AssignedGroupName>
      <DefaultCurrency>USD</DefaultCurrency>
      <LeadCustomFields>
         <CustomField>
            <Name>CustomFied1</Name>
            <Value>Custom info 1</Value>
         </CustomField>
         <CustomField>
            <Name>CustomFied2</Name>
            <Value>Custom info 2</Value>
         </CustomField>
      </LeadCustomFields>
   </Lead>
</Leads>

Sample Response

{
    "MCM": {
        "response": {
            "objectType": "Lead",
            "syncTime": "2021-06-10 03:23:14"
        },
        "parameters": {
            "results": {
                "message": {
                    "status": "Success",
                    "success_message": {
                        "lead_name": "Test New Lead",
                        "lead_id": "203060"
                    }
                }
            }
        }
    }
}
<MCM>
  <response>
    <objectType>Lead</objectType>
    <syncTime>2021-06-10 03:23:14</syncTime>
  </response>
  <parameters>
    <results>
      <message>
        <status>Success</status>
        <success_message>
          <lead_id>203060</lead_id>
          <lead_name>Test New Lead</lead_name>
        </success_message>
      </message>
    </results>
  </parameters>
</MCM>

WADL

<?xml version="1.0" encoding="utf-8"?>
<application>
   <resources base="https://{yourCompany}.agiliron.net/agiliron/api-31/">
     <resource path="Leads">
       <method name="POST">
         <request>
           <param name="key" type="xsd:string" style="query" 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>