Importing JSON data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Exsto
    Member
    • Nov 2018
    • 58

    Importing JSON data

    Hi, I'm Giuseppe from Exstored.com. As a newbie php programmer, I'm trying to import a json packet (sent with a POST from our site) to our CRM site. I think I would use API, but I don't know how to do it. Can I have some help please?
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hello,
    you can find documentation here

    Comment

    • Exsto
      Member
      • Nov 2018
      • 58

      #3
      Hello Tanya,
      thanks for your reply. I have a few questions:
      1. The php file describing EspoApiClient class, as in the example you have linked, must be included in our CRM server after being properly adapted to our necessities, mustn't it?
      2. In the link https://www.espocrm.com/documentatio...n/web-to-lead/ it's mentioned the parameter leadCaptureAllowOrigin. Should I modify it even if I work on php or it's needed only if I access "Directly by web browser"?
      3. I think that in the line

      $client = new EspoApiClient('https://your-espocrm-site', 'USERNAME', 'PASSWORD');
      I should insert Username and Password of an account for API calls. Am I wrong?
      Last edited by Exsto; 11-28-2018, 03:16 PM.

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #4
        Hi,
        1. It has to be included in that place, where you want to connect with EspoCRM as in-depended class
        2. If you want to use EspoApiClient only, without entryPoint, you don't need this parameter at all. If you want to use Web-to-Lead form and want to change default value, you can set it in config.php
        3. Username and Password of espocrm user for API calls

        Comment

        • Exsto
          Member
          • Nov 2018
          • 58

          #5
          Hi,
          I tried to do as you suggested, but I've encountered some problems:
          1. Did you refer to the main path? For example, /var/www/html/my_folder?
          2. I want to use Web-to-Lead form, but I can't find any "leadCaptureAllowOrigin" parameter in data/config.php. I came up with nothing even after I looked for 'Access-Control-Allow-Origin'.
          3. So I have to create another php file and save it to my EspoCRM server?

          Thanks again for your time.
          Last edited by Exsto; 11-28-2018, 07:05 PM.

          Comment

          • Exsto
            Member
            • Nov 2018
            • 58

            #6
            Hi,
            I made some improvements. I made a php file with the declaration of EspoApiClient class for lead capture, as in the documentation you provided. What's the correct path in my server in which I must copy this file?

            Comment

            Working...