REST api

Basics

Schema

API access is over HTTP and is using URL in format:

https://crm.innovatrics.com/api/:model/:action.xml
https://crm.innovatrics.com/api/:model/:action/:id.xml

Authentification

You must be authenticated for every API call using HTTP Basic Authentication with user:password where user and password is the login to the CRM system or you can use generated API token in form user/token:login_token where user is login and login_token is generated token from CRM/Change My Details dialog.

fe.

curl -u "user:pass" https://crm.innovatrics.com/api/generated_license/show/7.xml
curl -u "user/token:286aa24c865f7e007d0772f51ea8c7c88d352d6b4" https://crm.innovatrics.com/api/generated_license/show/7.xml

API

You can find API documentation on the following page: RestAPI.

Most of API calls returns XML result, also in case of an error, except for generated_license/download which answers license file in binary format.

Errors

Errors are returned as XML in form:

<?xml version="1.0" encoding="UTF-8"?>
<errors>
   <error code="404">404: Not found </error></errors>
   ...
   <error code="404">404: Not found </error></errors>

Example

Lets assume we have 2 plans and want to generate a license from one of them. To achieve this we have to acquire the id of a plan. This id is unique for our plan and will not be changed in future so this step is necessary only once. We can then generate license keys using this id and hardware id of our PCs/devices. The remaining step is download of the license file.

We use curl command in this example for simplicity but any other HTTP client that supports HTTP Basic Auth (for example HttpWebRequest class in C#, HTTPClient or URLConnection in Java) could be used.

After we generated our token on https://crm.innovatrics.com/client/user/edit_me, we can do the following steps

Step 1 - List available licenses

$ curl -u "user/token:286aa24c865f7e007d0772f51ea8c7c88d352d6b4" https://crm.innovatrics.com/api/license/list.xml
<?xml version="1.0" encoding="UTF-8"?>
<license-rights type="array">
  <license-right>
    <id type="integer">1</id>
    <used-license-count>12</used-license-count>
    <total-license-count type="integer" nil="true">32</total-license-count>
    <user-records type="integer">50000</user-records>
    <name>IDKit PC</name>
    <note>Test License</note>
  </license-right>
  <license-right>
    <id type="integer">2</id>
    <used-license-count>3</used-license-count>
    <total-license-count type="integer">10</total-license-count>
    <user-records type="integer">1</user-records>
    <name>ANSI &amp; ISO Mobile Package 10</name>
    <note>Test License2</note>
  </license-right>
</license-rights>

This call gave us list of our plans and we can now choose one we want to generate key for, fe. "IDKit PC" with id 2

Step 2 - Generate a license

Assume we have a PC with hardware ID: HWID123457 and we want a license from our plan with id 2. We can add a note to this license by passing parameter note - "Test License" string. If your connector does not encode parameters automatically, you will have to encode it in URL encoding ("Test%20License" in this case).

$ curl -u "user/token:286aa24c865f7e007d0772f51ea8c7c88d352d6b4" "https://crm.innovatrics.com/api/license/generate/22.xml?hwid=HWID123457&note=Test%20License" 

<?xml version="1.0" encoding="UTF-8"?>
<generated-license>
  <hwid>HWID123456</hwid>
  <id type="integer">101</id>
  <valid-until type="date" nil="true"></valid-until>
  <license-key>SUNfTAMARAAAAAAAAABIV0lEMTIzNDU2AAAAAAAAAAAAAGNsaWVudAAAAAAA...5gsjc7A==</license-key>
  <note>Test License</note>
</generated-license>

In this step new license with id 101 and a note was generated from this plan. License key is encoded in Base64 encoding

Step 3 - Download the license

$ curl -u "user/token:286aa24c865f7e007d0772f51ea8c7c88d352d6b4" https://crm.innovatrics.com/api/generated_license/download/101.xml -o iengine.lic