API EN: различия между версиями

Материал из WiKi - UserSide
Нет описания правки
Нет описания правки
 
(не показано 5 промежуточных версий этого же участника)
Строка 18: Строка 18:
   skip_internal_api - flag - do not include internal system triggers ''(reasonable to use when your API method is a reaction to some trigger and it ends up looping itself during normal operation)''
   skip_internal_api - flag - do not include internal system triggers ''(reasonable to use when your API method is a reaction to some trigger and it ends up looping itself during normal operation)''
  Other additional parameters, depending on the category ''(see below in the relevant categories)''.  
  Other additional parameters, depending on the category ''(see below in the relevant categories)''.  
For example:
For example:
   customer_id - user id of the customer
   customer_id - user id of the customer
   is_potential - flag. It can take the value 1 or 0. Most flags have the prefix '''is'''.
   is_potential - flag. It can take the value 1 or 0. Most flags have the prefix '''is'''.
 
  Example request:
  Example request:
  api.php?key=apikey&cat=abon&action=msg&usercode=1
  api.php?key=apikey&cat=abon&action=msg&usercode=1
Строка 36: Строка 36:
== Basic setting ==
== Basic setting ==


Configure the [[UserSide API Key|API Key]].
Configure the [[UserSide_API_Key_EN|API Key]].


== Categories ==
== Categories ==
Строка 48: Строка 48:
* [[API commutation_EN|commutation]] - Commutation of objects
* [[API commutation_EN|commutation]] - Commutation of objects
* [[API cross_EN|cross]] - ODF/Crosses
* [[API cross_EN|cross]] - ODF/Crosses
* [[API customer_EN|customer]] - Users. Most actions are relevant for [[Supported billing|manual billing]]
* [[API customer_EN|customer]] - Users. Most actions are relevant for [[Supported_billings|manual billing]]
* [[API cwdm_EN|cwdm]] - CWDM
* [[API device_EN|device]] - Equipment
* [[API device_EN|device]] - Equipment
* [[API employee_EN|employee]] - Employees ''(since 3.16dev2)'''
* [[API employee_EN|employee]] - Employees ''(since 3.16dev2)'''
* [[API fibre_EN|fiber]] - Cable lines
* [[API_fiber_EN|fiber]] - Cable lines
* [[API gps_EN|gps]] - GPS trackers
* [[API gps_EN|gps]] - GPS trackers
* [[API inventory_EN|inventory]] - Warehouse
* [[API inventory_EN|inventory]] - Warehouse

Текущая версия от 15:34, 1 ноября 2024

en | ru

This section describes the possibilities of using the inbuilt API in ERP "UserSide", which allows you to use the integrated functionality in your own projects.

The API does not cover all functionality at the moment and is gradually being developed, so this page will have frequent changes and additions.

Operating principle

The /api.php file is responsible for interaction.

Both GET and POST requests can be used.

Incoming Parameters:
Mandatory:
 key - API key
 cat - category of the request
Optional:
 skip_internal_api - flag - do not include internal system triggers (reasonable to use when your API method is a reaction to some trigger and it ends up looping itself during normal operation)
Other additional parameters, depending on the category (see below in the relevant categories). 
For example:
 customer_id - user id of the customer
 is_potential - flag. It can take the value 1 or 0. Most flags have the prefix is.

Example request:
api.php?key=apikey&cat=abon&action=msg&usercode=1
Returned data:
 If the query involves some action or information return, information will be returned in JSON format:
  array(
   [Result] => OK / ERROR
   [ErrorText] => In case of an error, the error text
  )
It is also reasonable to check the HTTP code of the response. In case of errors/incorrect requests - HTTP code will be different from 200

Basic setting

Configure the API Key.

Categories