ContactsLaw provides a REST API that allows third-party developers to perform a limited subset of operations within the system.
It is a component of the ContactsLaw Daemon.
Configuration
Permission must be granted to the Windows user account under which the daemon runs before the REST API can be accessed:
Stop the ContactsLaw Daemon if it is currently running.
From an elevated command prompt, run the following command:
netsh http add urlacl url=http://*:4446/ user="DOMAIN\User"
(substituting with the correct user account)
Start the ContactsLaw Daemon.
By default, the REST API uses HTTP port 4446. This can be overridden in System Settings.
SSL/HTTPS
If you require the REST API to be remotely accessible over the Internet, you should configure HTTPS. For this, you will require an SSL certificate.
Change the HTTPS port number (under System Settings) from zero to an unused TCP port number, e.g. 8886.
Stop the ContactsLaw Daemon if it is currently running.
From an elevated command prompt, run the following command:
netsh http add urlacl url=https://*:8886/ user="DOMAIN\User"
(substituting with the correct user account)
Install the certificate using the following command:
netsh http add sslcert ipport=0.0.0.0:8886 certhash=XXX appid={82c223b4-97f5-4120-adc6-0c35fe6fd420}
(substituting XXX with the certificate thumbprint)
Start the ContactsLaw Daemon.
OAuth 2.0
The REST API supports OAuth 2.0 for third-party applications that need to perform operations on behalf of members. A client ID and secret need to be allocated to each application that will use OAuth (managed via System Settings). For applications that run as a service account, username/password authentication is generally sufficient.
Logging
To assist with debugging third-party applications, the REST API can be configured to log requests and responses via a system setting. After changing this setting, you may need to restart the ContactsLaw Daemon. The log file is located in %PROGRAMDATA%\ContactsLaw Practice Management Software\ContactsLaw\API.log
API documentation
The documentation for the REST API can be found here: http://download.overtech.com.au/public/contactslaw/rest-api
Best practices
Examples |
- Alternative user interfaces
- Web applications
- Mobile apps
- Integration with 3rd party applications
|
- Public-facing websites (client portals)
- Bulk data entry
- Autonomous processes
|
Authentication |
OAuth 2.0 |
Username and password |
Account type |
Member (pass-through) |
Service account |
See also