Using web services, authentication and message representation format
After enabling web services for your company, you'll be given a unique company identification and authentication token. For every API request you send, you'll need to present the following:
- username of the API user account that has access to the company data,
- API secret key of the user account
- web services token which is unique for each organization and identifies the organization that is being accessed
API method request can be sent using HTTP POST request as shown in the following example:
POST /WebServicesHR/API HTTP/1.1
Host: e-racuni.hr
User-Agent: Mozilla/4.0
Content-Length: 410
Content-Type: application/octet-stream
<?xml version="1.0" encoding="utf-8"?>
<request>
<login username="ivan" secretKey="8b29582ce0a1c85dc0c574d218acb900" token="649026C063054A139549200F3C9D01C6" />
<method name="SalesInvoiceGet">
<parameter name="number" value="1/01/161" />
<parameter name="date" type="Date" value="2016-12-15" />
</method>
</request>
 | The API web services have a rate limit of maximum 4 requests in 4s. This means that 4 requests can be sent within 4 seconds, in case 4 were sent in 1 second, it is then necessary to wait 3 seconds, or just send request every second. There is also delay functionality for sending responses, so if you wait for each response before sending another request, there is no need to implement delays on the client side. |