Search code examples
javascriptjqueryasp.net-web-apidynamics-crm-365

How to insert lead data in Dynamics CRM 365?


I am using the Web API of Dynamics CRM. I am able to get the OAuth token but my next step is to insert the lead data in CRM.

/api/data/v8.2

Can any one help me which method I need to call to insert the lead data in CRM?


Solution

  • Have you read documentation on MSDN?: https://msdn.microsoft.com/en-us/library/gg328090.aspx

    Simply post a json to proper url, below you have an example:

    POST [Organization URI]/api/data/v8.2/leads HTTP/1.1
    Content-Type: application/json; charset=utf-8
    OData-MaxVersion: 4.0
    OData-Version: 4.0
    Accept: application/json
    
    {
        "subject": "Test lead",
        "companyname": "Contoso",
        "firstname": "John",
        "lastname": "Smith",
        "emailaddress1": "[email protected]",
        "telephone1": "345345345",
        "mobilephone": "345345345" 
    }