Create new record(lead) true api

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ruslan
    Senior Member
    • Aug 2014
    • 102

    Create new record(lead) true api

    Hi,
    i am still testing espocrm and now i want to create simple add-on for creation leads true api. (please provide api example for creating new record to some entity).
    i am using Gravity Forms in wordpress to get the leads from my website. now i want to send lead parameters(name,emil,phone etc...) to espocrm.
    the questions are:
    ​1. how to create secure connection to espocrm api?
    ​2. how to create new record(lead) and store all parameters in the fields i need?
    ​3. in creation process true api, how can we select the team and the user to assign the new record?

    * some good example will and can help to many users

    Thanks
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    REST API
    method: POST
    ESPOCRM_URL/api/v1/Lead
    Specify field values as JSON in the request payload

    Open your espoCRM, press F12, go to network, do some actions and you will see api calls.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • Ruslan
      Senior Member
      • Aug 2014
      • 102

      #3
      Hi,
      please provide some code example.
      i am trying to make this work but seems i miss something

      the error i get when form submitted in my website and trying to send data to ESPOCRM URL/api/v1/Lead

      * i also tried to enter to this url:ESPOCRM_URL/api/v1/Lead and it ask me for user and password. so i assuming this can be also the problem?

      Code:
      [COLOR=#333333][FONT=Helvetica Neue][SIZE=14px]Array[/SIZE][/FONT][/COLOR]
      [COLOR=#333333][FONT=Helvetica Neue][SIZE=14px]([/SIZE][/FONT][/COLOR]
      [COLOR=#333333][FONT=Helvetica Neue][SIZE=14px][safe_message] => error object[/SIZE][/FONT][/COLOR]
      [COLOR=#333333][FONT=Helvetica Neue][SIZE=14px][object] => WP_Error Object[/SIZE][/FONT][/COLOR]
      [COLOR=#333333][FONT=Helvetica Neue][SIZE=14px]([/SIZE][/FONT][/COLOR]
      [COLOR=#333333][FONT=Helvetica Neue][SIZE=14px][errors:WP_Error:private] => Array[/SIZE][/FONT][/COLOR]
      [COLOR=#333333][FONT=Helvetica Neue][SIZE=14px]([/SIZE][/FONT][/COLOR]
      [COLOR=#333333][FONT=Helvetica Neue][SIZE=14px][http_request_failed] => Array[/SIZE][/FONT][/COLOR]
      [COLOR=#333333][FONT=Helvetica Neue][SIZE=14px]([/SIZE][/FONT][/COLOR]
      [COLOR=#333333][FONT=Helvetica Neue][SIZE=14px][0] => Not properly address entered.[/SIZE][/FONT][/COLOR]
      [COLOR=#333333][FONT=Helvetica Neue][SIZE=14px])[/SIZE][/FONT][/COLOR]

      Comment

      • yuri
        Member
        • Mar 2014
        • 8440

        #4
        I don't have any php example.
        You need to use Basic Authorization. See what happening in browser console (Network tab) and replicate the same request in php.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        • Ruslan
          Senior Member
          • Aug 2014
          • 102

          #5
          Hi,
          i tried to see some api calls when i created new lead. but i did not see nothing that can help me to create api connection to create lead from 3rd party.

          Comment

          • tarasm
            Super Moderator
            • Mar 2014
            • 573

            #6
            It's pretty easy to use REST API (details via PM).
            Job Offers and Requests

            Comment


            • ayush
              ayush commented
              Editing a comment
              tarasm, I am also looking for API examples. Can you please share them with me?

              Thanks!!

            • ronea23
              ronea23 commented
              Editing a comment
              Hi Tarasm, could you please send me the examples pls ??

            • blaz
              blaz commented
              Editing a comment
              Hi could I also get examples?
          • davidperez
            Junior Member
            • May 2015
            • 3

            #7
            Hello, would you give some examples in php to login in EspoCRM, get fields and create Lead?

            Thanks!

            Comment

            • twpag
              Junior Member
              • Nov 2017
              • 7

              #8
              Originally posted by davidperez
              Hello, would you give some examples in php to login in EspoCRM, get fields and create Lead?

              Thanks!
              Did you ever get examples? I'm not a ding dong but the instructions are not clear at all lol. Thanks

              Comment

              • twpag
                Junior Member
                • Nov 2017
                • 7

                #9
                Originally posted by tarasm
                It's pretty easy to use REST API (details via PM).
                Can you provide to the community and post here so people like myself can learn? We seek examples... Well at this point I do lol. I need

                Comment

                • tanya
                  Senior Member
                  • Jun 2014
                  • 4308

                  #10
                  Hello

                  one of http://forum.espocrm.com/forum/devel...empty-response

                  Comment

                  Working...