Best way to log API calls that create records

Many of our records are created via an API call from an external source.  Is there a way I can log those calls so I can see what was sent in via the API versus what is in the record now.  I just want an irrefutable way to see what they are sending into the system.

I need to see all the data included in the POST.

Parents
  • If you have access to core code you can add logging to ~/include/api/RestService.php just below the comment that has "// This looks like the post contents are JSON".

    Something like:

    Add extra code to filter out unwanted requests based on $this->getRequest()->getRequestURI().

    If it is sugarondemand then you may be able to create a ~/custom/include/api/RestService.php, derive from the core code RestService and override getRequestArgs(). I've not tried that though.

  •  ~/custom/include/RestService.php ist an add-on file wich is called before the REST service functions are executed.

    Code of ~/api/rest.php:

    So you can add logging of incoming data to such a custom file without touching the core files.

    Harald Kuske
    Principal Solution Architect – Professional Services, EMEA
    hkuske@sugarcrm.com
    SugarCRM Deutschland GmbH

Reply
  •  ~/custom/include/RestService.php ist an add-on file wich is called before the REST service functions are executed.

    Code of ~/api/rest.php:

    So you can add logging of incoming data to such a custom file without touching the core files.

    Harald Kuske
    Principal Solution Architect – Professional Services, EMEA
    hkuske@sugarcrm.com
    SugarCRM Deutschland GmbH

Children