Python script for MoneyWorks

A third-party Python script is available to facilitate development of services that use the MoneyWorks REST APIs to push data to MoneyWorks, or to automate MoneyWorks processes from outside of MoneyWorks. Examples: from moneyworks import Moneyworks mw = Moneyworks() # … Continue reading

Posted in REST | Comments Off on Python script for MoneyWorks

Command line curl REST authentication

Sometimes you want to test out REST calls from the command line. How to handle the dual realm Authorization headers that Datacentre requires? --user will not work because curl will only accept one such parameter, so you need to specify … Continue reading

Posted in CLI, REST | Comments Off on Command line curl REST authentication

MoneyWorks Datacentre REST API

Synopsis The MoneyWorks Datacentre REST API provides a simple, platform-neutral, high performance stateless network interface to MoneyWorks Datacentre. Description The MoneyWorks Datacentre REST server runs, by default, on port 6710. It can be enabled/disabled and the port configured in the … Continue reading

Posted in REST | Comments Off on MoneyWorks Datacentre REST API

XML data exchange

MoneyWorks 6.1 and later supports import and export of xml-formatted data. This removes the need to preconfigure an import map when building automated importing scripts (although you will still need to understand import maps). XML is the only import format … Continue reading

Posted in COM/VBS, Database, Esoterica, MWScript, REST, XML | Comments Off on XML data exchange

Accessing REST from PHP

Example of using curl to issue an authenticated REST request. <?php     // Demonstrates two methods of including authorisation     //      for accessing a resource     // The resource in this case is an xml export of the account     //      table of document Acme.mwd6     if($_GET["auth"] == "headers")  {         $ch = curl_init();         // set URL and other appropriate options         curl_setopt($ch, CURLOPT_URL, "http://127.0.0.1:6700/REST/Acme.mwd6/                                         export/table=account&format=xml-terse");         curl_setopt($ch, CURLOPT_HEADER, 0);         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);         // set Auth headers for Datacentre login, and document login         $headers = array(             "Authorization: Basic " . base64_encode("root:Datacentre:XXXX"),             "Authorization: Basic " . base64_encode("Admin:Document:fred"));         curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);          $result = curl_exec($ch);         curl_close($ch);         }     else if($_GET["auth"] == "inline")  {         $ch = curl_init();         // usernames and passwords are inline in the URL         // ask for verbose output so we can see the difference         curl_setopt($ch, CURLOPT_URL, "http://root:XXXX@127.0.0.1:6700/                                       REST/Admin:fred@Acme.mwd6/export/                                       table=account&format=xml-verbose");         curl_setopt($ch, CURLOPT_HEADER, 0);         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);         $result = curl_exec($ch); … Continue reading

Posted in REST | Comments Off on Accessing REST from PHP