How to add leads into CRM with API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sokol
    Junior Member
    • Feb 2023
    • 4

    How to add leads into CRM with API

    How to add leads into CRM with API?
  • lazovic
    Super Moderator
    • Jan 2022
    • 810

    #2
    Hi Sokol,

    This article will be useful for you: https://docs.espocrm.com/development/api/.

    Comment

    • Sokol
      Junior Member
      • Feb 2023
      • 4

      #3
      I saw that article. But where I can see some tutorial? How to add lead with API?

      I should manually create record in DB with API?

      Comment


      • rabii
        rabii commented
        Editing a comment
        How : e.g if you have another application which has a form then you can use EspoCRM API to connect to your instance and when someone submit a form then you could send that data to create a Lead via API Request.

        I should manually create record in DB with API? No if you set up an API request then the Lead will be created once the form is submitted.
    • lazovic
      Super Moderator
      • Jan 2022
      • 810

      #4
      Sokol,

      No, you do not need to add anything directly to the database through the API.

      First, you need to create an API User in your instance and assign it a Role with the permission to create Leads.
      Then, you can try to run the request, for example, in the terminal console of the following format, using the POST method:
      Code:
      curl -H "X-Api-Key:9af3edf5bf1f2a99974c827af437ce15" -H "Content-Type: application/json" -X POST -d '{"lastName":"Test Lead","assignedUserId":"1"}' https://ESPOCRM.URL/api/v1/Lead
      ​​
      Don't forget to replace the instance URL with your own URL and X-Api-Key (you can find it on your API User's page).

      And if you use forms on some site in which customers enter data and you want Leads to be created on the basis of this data in EspoCRM, then Web-to-Lead feature will come in handy for you: https://docs.espocrm.com/administration/web-to-lead/.
      Last edited by yuri; 02-28-2023, 03:01 PM.

      Comment

      Working...