Insert or update espocrm account from external application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • enricorossa
    Senior Member
    • Jul 2018
    • 125

    Insert or update espocrm account from external application

    Good morning,
    I have my own application that allows me to recognize, divide and extract the content from the pdf by setting the coordinates inside it.
    ES. if in the X, Y, W, H coordinates I find the word "test" then move the pdf to a specific folder renaming it.
    ES. if in the coordinates X, Y, W, H I find the word "test" then it divides the pdf as many times as it finds the word "test" in those coordinates.
    ES. I set N coordinates and extract the value from them.

    Having set up this process
    1) Save the pdf in the folder
    2) The pdf is recognized
    3) The pdf is split
    4) The text is extracted into a JSON { "name": "PINCO PALLINO", "emailAddress": "pinco@pallino.it", "phoneNumber": '123456789, "sicCode": "0001"}


    Now I would like to implement my application by entering or updating the data on display and if you can also attach the file in the documents relating it to the account


    My application is local, what can I do? do you have any suggestions?

  • esforim
    Active Community Member
    • Jan 2020
    • 2204

    #2
    Hi enrico, can't help you very much here.

    If it a JSON you can easily (if you have the skill level) convert JSON file into field & data by using Rest API, I certainly don't so only know about it but can't really implement anything with it.

    I'm more interested in the application that can do this PDF splitting process if you are able to share it.

    Comment

    • enricorossa
      Senior Member
      • Jul 2018
      • 125

      #3
      Hi, yes I know the rest api but what I was wondering and if someone has a simple example to use as a base, my app is local and I can't figure out how to connect to the espo api with a lot of authentication, the script must work in the background, I just need a link to the manual if someone can tell me, I have not found anything.

      As for my pdf management app at the moment it is in the Major zero version, it was written to use it only within our business but I rewrote it to eliminate the criticalities and defects, I am testing it to make it public, the base of this app is poppler-util using pdftotext




      Comment

      • enricorossa
        Senior Member
        • Jul 2018
        • 125

        #4

        this is a correct way to proceed?

        PHP Code:
        $curl = curl_init();
        
        $api_url = 'https://www.test.it/crm/api/v1/Account/615f02181bsdsds630fc';
        $api_key = 'd95cb26f749c85e8f6390e12343ff87a';
        
        $data = array("description" => "TEST PUT");
        
        $postdata = json_encode($data);
        curl_setopt_array(
        $curl,
        array(
        CURLOPT_URL => $api_url,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => "",
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 30,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => "PUT",
        CURLOPT_POSTFIELDS => $postdata,
        CURLOPT_HTTPHEADER => array(
        'Content-Type: application/json',
        "x-api-key: $api_key"
        )
        )
        );
        
        
        $response = curl_exec($curl);
        $err = curl_error($curl);
        curl_close($curl);
        
        if ($err) {
        echo "cURL Error #:" . $err;
        } else {
        echo $response;
        } 
        

        Comment

        • enricorossa
          Senior Member
          • Jul 2018
          • 125

          #5


          sorry i found everything you need in the manual.


          Comment

          Working...