Prva stran 
Nazaj 
Naprej 
Novosti 
 Kopiraj povezavo na to stran 
 
Natisni stranNatisni stran  
e-računi navodila za up...  >  Spletne storitve in int...  >  Introduction to web ser...

Introduction to web services API

The e-racuni.com Web Services API is a programmer's interface for accessing user's account data (the data of the organization) using secure HTTPS connection. The API makes it very easy to integrate 3rd party web and desktop applications with e-racuni.com ERP system. To use the API you do not need any special programming skills, some API functions can even be used by simple command line tools without any programming knowledge.

API can be used in the following use cases:

Web services API supports XML and JSON encoded HTTPS requests and API functions can also be called using simple command line tools (e.g. wget https://en.wikipedia.org/wiki/Wget or curl https://en.wikipedia.org/wiki/CURL).

The full API reference for the API is available here https://e-racuni.com/obracuni/ApiDocumentation https://e-racuni.com/obracuni/ApiDocumentation.

For developers we recommend using the API Developer Panel tool which provides easy to use GUI interface for testing the API and generating of source code template for making API method calls.

Use your existing e-racuni.com account to login into the API developer panel at: https://e-racuni.com/obracuni/developer https://e-racuni.com/obracuni/developer.

How to activate Web services API for your organization

Ensure that your user account owns privileges for Web Services API management and activation. Then follow the steps below to access API Web Services settings:

  1. Select Settings from the main menu.
  2. Select Company settings in the pull-down menu
  3. Select API Web services in the left panel tree view menu

When you arrive to the API Settings for the first time you should see the following screen:

  
Enable web services by generating web services token
  
  Slika 1: Enable web services by generating web services token

To enable Web Services API for your organization click on the button Enable web services.

If you later decide that you do not want to use the API anymore you can disable API at anytime just by clicking on the Disable web services.

Web services API cannot be used when no API token is available and web services are disabled.

Adding API user accounts

Once you have enabled the API you need to create API user account. To do this click the button Add API User Account.

  
Adding API user account
  
  Slika 2: Adding API user account

API user account can be entered like any other user account. Instead of specifying user privileges you can specify API methods that you want to access with the API user account. If API will be accessed from a 3rd party server with a fixed IP address then you can type in the IP address from which the API calls will be made. All API functions will be executed in the context of the API user account. This means that the API methods will be executed with the user privileges, confidentiality clearance, cost center, email and language settings of the API user account (among others).

In order to use the API you need to provide the following data to the developer who will be programming the code using the API:

To generate the API password click on the button Get API Password

  
Generate API Password
  
  Slika 3: Generate API Password

Once you have generated the API Password you can provide your API developer with the data needed to access the API:

  
Get API Password and organization token
  
  Slika 4: Get API Password and organization token

Using the API

To use the e-racuni.com API (i.e. the API for Slovene localization) you need to use following service URL for communication over HTTP:

https://e-racuni.com/WebServicesSI/API


Please note the use of https:// in the URL above. All e-racuni.com API communication is encrypted over HTTPS.

Use the API developer panel to test and discover the API methods. The sandbox environment for Slovenia is available at https://e-racuni.com/obracuni/index.html?St=APIDeveloper&action=reLogin&username=micka&hash=ddb43e9f119c6805f4770ecc4f6466ba https://e-racuni.com/obracuni/index.html?St=APIDeveloper&action=reLogin&username=micka&hash=ddb43e9f119c6805f4770ecc4f6466ba.

Once you are logged in the API developer tool you can browse documentation for all API methods and data types that are available by the API.

To test any of the API methods, all you need to do is to enter API method parameters as shown below:

  
API Developer method parameter value entry
  
  Slika 5: API Developer method parameter value entry

Once you have entered the API method parameter values (if required) you can click on the next tab depending on the development language/tool that you will use for communicating with the API.

If you will be using JSON for communicating with the API, then click on Tab JSON  and you will be able to execute API request in the context of the user account and organization that you are currently logged in.

  
Testing API method call in the API developer panel tool
  
  Slika 6: Testing API method call in the API developer panel tool

As you can see in the screenshot above the API developer tool will generate JSON source code for making API call based on API user account data and API method parameters that you have entered before. The API method will be executed and the resulting JSON response will be shown.

Now all you need to do is to copy JSON request source code into your application and start using the API.

If you want to use the API from the command line then see the command generated in tab CURL .

If you want to use the API with XML source code then see the XML source generated in tab XML .

If you want to use the API from PHP then you can start with the code generated in tab PHP .


Reference na stran

---
Zadnja sprememba 09.10.2023 13:29:08
© E-RAČUNI d.o.o. 2003-2024