Announcement

Collapse
No announcement yet.

Please cofirm if this requires code?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Please cofirm if this requires code?

    Trying to bring form data into the Leads module. The client is using Form Assembly on their website

    Anything missing in the attachment below that would cause it not to post data into the Lead form?
    I get a good result on the Form Assembly side, no errors but there is no data when it is complete

    the FAssem instructions are
    • Finding the remote script URL ...... visit the destination website ...... click view source........search for "action="......copy the value that is after the equals sign, and use that as your remote script URL.
    Not quite what you find but I am trying with /Lead/create

    Should this work w/o code on the Espo side?
    FYI using official Espo cloud/no coding is allowed.
    Attached Files
    Last edited by crmclients; 09-26-2020, 08:24 PM.

  • #2
    crmclients
    yes, it's working without coding on Espo side.
    You're using in your external application wrong URL. You shouldn't use /Lead/create.
    Go to domain.com/#LeadCapture/create and create your own entryPoint which you should use in external app.

    Comment


    • #3
      thanks emillod, it's not working but it also not giving errors, i need to read about Lead Capture, and play with it a bit....somehow i missed it in all the searching
      it made me create a target list which i haven't been using at all so i need to read about that as well...thanks for the hope!

      Comment


      • #4
        I added the API key from Espo Lead Capture domain.com/#LeadCapture/create/apikey
        It seems like it would need that but nothing is captured

        Comment


        • #5
          found a reference to
          • domain//api/v1/LeadCapture/apikey
          generated from the Lead Capture record
          but this causes a 401 (unauthorized) or 404 error reported by Form Assembly

          I am created an api user key in Espo and substitued, no 401 error but also no data: Data posted to mydomain.espocloud.com/#LeadCapture/60435fapikey....

          odd FA reports received data as "© 2020 EspoCRM"

          domain//api/v1/LeadCapture/apikey - doesn't seem to work on my test instance of Espo either.
          Last edited by crmclients; 09-27-2020, 01:17 AM.

          Comment


          • #6
            crmclients i'm 100% sure that this is working, but i can't test that for you.
            You need to make sure that you're sending all fields which are in payload, also that request is POST and your URL is correct.

            Comment


            • #7
              no you can't test his for me

              I cut it down to only mapping 2 fields first name and last name on both sides - no go - still errors using the - domain//api/v1/LeadCapture/apikey....

              Not sure if I need to use API user for validation (with no password) but I also tried using a regular User login I create with Admin rights - no roles - I see it in the Auth log as having access but no Auth Token for either - no errors in the Auth Log

              I feel like there are more pieces to this I just don't know what they are

              //...espocloud.com/api/v1/LeadCapture/629830.... yields this : SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
              when I paste it in the address bar

              do you know what is should say for a working POST url? some kind of error maybe but a least a clue it is posting correctly?

              @yurikuzn or @telecastg any ideas?

              Comment


              • #8
                Hi crmclients,
                Lead Capture is a good solution when you want to automate the process for catching new leads. If you want to send the API request to EspoCRM in order to create a new Leads you can use your first method. I will try to shed more light on this, so let's start:
                1. If you want to send API request to the system the good way to do that is do it via API user. So let's do it.
                First of all, let's create a Role for it. I allowed him only to create new Leads. Note, if you want to send in the payload the assignment data, you will need to grant this user with the Assignment permission in the role. Otherwise your request will fail.
                After we create a role let's go and create the Api user (see screeenshots 1 and 2);
                2. To be able to send API request to the system you need to specify the next headers:
                - Content-Type: application/json
                - X-Api-Key: API_KEY_COPIED_FROM_THE_USER_DETAIL_VIEW
                More about this you can read here https://docs.espocrm.com/development/api/.
                3. Let's send our request. I will do it with the CURL program (see screenshot);

                As you can notice you tried to acheave it with /Lead/create instead of /api/v1/Lead

                Attached Files
                Last edited by Maximus; 10-02-2020, 01:28 PM.

                Comment


                • #9
                  Also, check the documentation https://docs.espocrm.com/development/api-tutorial/ and this post https://forum.espocrm.com/forum/deve...7554#post57554 to see examples of implementing API calls with minimum programming
                  Last edited by telecastg; 10-05-2020, 02:14 AM.

                  Comment


                  • #10
                    Any screenshot of FA interface?

                    Maybe there is a setting/function in there that might give some hints.

                    Comment


                    • #11
                      hopefully a bigger shot thanks for taking a look!

                      Click image for larger version

Name:	fa2.png
Views:	448
Size:	115.1 KB
ID:	63370

                      Comment


                      • #12
                        Not sure if you need that /create/ there though, by "Post (default)" it should create any entity.

                        Secondly, maybe you can also try this URL method (unsecure but we just want to see if it possible)

                        Code:
                        https://formassembly:password@soardetroit.....etc
                        (this code will add the authentication inside the URL: it basically
                        Code:
                        https://username:password@website
                        )

                        Comment


                        • #13
                          the POST/default is a drop down (POST, GET, PUT)
                          you only get to put in the url in one line so do you mean

                          "https://formassemblyassword@soardetroit.com:https://usernameassword@website"

                          or some way to create a string?

                          off topic but we are down and have a training class in the am-->> struggling to restore the 5.9.3 db to an Espo instance on the same shared server. Import SQL file works,(selected drop tables) but it logs me out and i cannot login with old or new usernames, any thots?

                          tried this but it cannot open the file

                          aristonc@c [~]# php command.php set-password [admin]
                          Could not open input file: command.php

                          Comment


                          • #14
                            No, I mean you don't need this full URL (correct me if I'm wrong)



                            This URL should work since you are "POST"ing

                            EspoCRM – Open Source CRM application.


                            and instead of using HTTP Username and Password under Authentication, you can include that into the URL, so it become like this.

                            Code:
                            https://formassblemy:passwordhere@soardetroit.espocloud.com/#Lead/

                            Comment


                            • #15
                              off topic but we are down and have a training class in the am-->> struggling to restore the 5.9.3 db to an Espo instance on the same shared server. Import SQL file works,(selected drop tables) but it logs me out and i cannot login with old or new usernames, any thots?

                              tried this but it cannot open the file

                              aristonc@c [~]# php command.php set-password [admin]
                              Could not open input file: command.php
                              Not sure if it can help because you are working on a cloud instance, but here is information about restoring an installation. The key part I think is that you need to save the hash key in order to keep the same username passwords. Hope it works for you. https://forum.espocrm.com/forum/inst...1187#post61187
                              Last edited by telecastg; 10-08-2020, 05:15 AM.

                              Comment

                              Working...
                              X