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

Материал из WiKi - UserSide
(Normalize API language switcher)
(Update localized API documentation)
 
(не показано 8 промежуточных версий этого же участника)
Строка 1: Строка 1:
[[API|ru]] | '''en'''
'''en''' | [[API_UK|uk]] | [[API|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.  
This section describes how to use the built-in ERP "UserSide" API 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.
The API does not currently cover all functionality and is being expanded gradually, so this page may change frequently.


== Operating principle ==
== Operating principle ==
Строка 11: Строка 11:
Both GET and POST requests can be used.
Both GET and POST requests can be used.


  Incoming Parameters:
  Input parameters:
  Mandatory:
  Required:
   key - API key
   key - API key
   cat - category of the request
   cat - request category
  Optional:
  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)''
   skip_internal_api - flag - do not run internal system triggers ''(useful when an API method is called from a trigger and would otherwise trigger 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 - customer id
   is_potential - flag. It can take the value 1 or 0. Most flags have the prefix '''is'''.
   is_potential - flag. It can be 1 or 0. Most flags use the '''is''' prefix.
   
   
  Example request:
  Example request:
Строка 26: Строка 26:


  Returned data:
  Returned data:
   If the query involves some action or information return, information will be returned in JSON format:
   If the request performs an action or returns data, the response is returned in JSON format:
   array(
   array(
     [Result] => OK / ERROR
     [Result] => OK / ERROR
     [ErrorText] => In case of an error, the error text
     [ErrorText] => Error text, if an error occurred
   )
   )


  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
  Also check the HTTP response code. For errors or invalid requests, the HTTP code will differ from 200.


== Basic setting ==
== Basic setup ==


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


== Categories ==
== Categories ==
Строка 48: Строка 48:
* [[API_chapter_EN|chapter]] - Custom sections/pages/links
* [[API_chapter_EN|chapter]] - Custom sections/pages/links
* [[API_commutation_EN|commutation]] - Commutation of objects
* [[API_commutation_EN|commutation]] - Commutation of objects
* [[API_cross_EN|cross]] - ODF/Crosses
* [[API_cross_EN|cross]] - Distribution frames
* [[API_customer_EN|customer]] - Users. Most actions are relevant for [[Supported_billings|manual billing]]
* [[API_customer_EN|customer]] - Customers. Most actions are relevant for [[Supported_billings|manual billing]]
* [[API_cwdm_EN|cwdm]] - CWDM
* [[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_fiber_EN|fiber]] - Cable lines
* [[API_fiber_EN|fiber]] - Cable lines
* [[API_gps_EN|gps]] - GPS trackers
* [[API_gps_EN|gps]] - GPS trackers
Строка 59: Строка 59:
* [[API_map_EN|map]] - Coverage maps
* [[API_map_EN|map]] - Coverage maps
* [[API_module_EN|module]] - External requests from modules
* [[API_module_EN|module]] - External requests from modules
* [[API_newin_EN|newin]] - Connection request ''( before 3.18)'''  
* [[API_newin_EN|newin]] - Connection request ''(before 3.18)''
* [[API_node_EN|node]] - Communication facilities ''(communication nodes, fiber optical junction boxes, poles, manholes)'''
* [[API_node_EN|node]] - Infrastructure facilities ''(communication nodes, splice closures, poles, manholes)''
* [[API_notepad_EN|notepad]] - Notepad
* [[API_notepad_EN|notepad]] - Notepad
* [[API_operator_EN|operator]] - system operators ''( before 3.16dev2)'''  
* [[API_operator_EN|operator]] - System operators ''(before 3.16dev2)''
* [[API_owner_EN|owner]] - Object Owners
* [[API_owner_EN|owner]] - Owners
* [[API_redirect_EN|redirect]] - Redirects to an object card based on some attribute
* [[API_redirect_EN|redirect]] - Redirects to an object card by attribute
* [[API_service_EN|service]] - Additional services
* [[API_service_EN|service]] - Additional services
* [[API_setting_EN|setting]] - Setting
* [[API_setting_EN|setting]] - Settings
* [[API_sms_EN|sms]] - SMS messages
* [[API_sms_EN|sms]] - SMS messages
* [[API_splitter_EN|splitter]] - dividers/splitters
* [[API_splitter_EN|splitter]] - Splitters
* [[API_staff_EN|staff]] - Staff ''(up to 3.16dev2)'''
* [[API_staff_EN|staff]] - Staff ''(up to 3.16dev2)''
* [[API_system_EN|system]] - System information and operations
* [[API_system_EN|system]] - System information and operations
* [[API_tariff_EN|tariff]] - Tariffs
* [[API_tariff_EN|tariff]] - Tariffs
Строка 75: Строка 75:
* [[API_trader_EN|trader]] - Vendors
* [[API_trader_EN|trader]] - Vendors
* [[API_vehicle_EN|vehicle]] - Vehicles
* [[API_vehicle_EN|vehicle]] - Vehicles
* [[API_vlan_EN|vlan]] - Vlan
* [[API_vlan_EN|vlan]] - VLAN

Текущая версия от 12:17, 10 мая 2026

en | uk | ru

This section describes how to use the built-in ERP "UserSide" API in your own projects.

The API does not currently cover all functionality and is being expanded gradually, so this page may change frequently.

Operating principle

The /api.php file is responsible for interaction.

Both GET and POST requests can be used.

Input parameters:
Required:
 key - API key
 cat - request category
Optional:
 skip_internal_api - flag - do not run internal system triggers (useful when an API method is called from a trigger and would otherwise trigger itself during normal operation)
Other additional parameters, depending on the category (see below in the relevant categories). 
For example:
 customer_id - customer id
 is_potential - flag. It can be 1 or 0. Most flags use the is prefix.

Example request:
api.php?key=apikey&cat=abon&action=msg&usercode=1
Returned data:
 If the request performs an action or returns data, the response is returned in JSON format:
  array(
   [Result] => OK / ERROR
   [ErrorText] => Error text, if an error occurred
  )
Also check the HTTP response code. For errors or invalid requests, the HTTP code will differ from 200.

Basic setup

Configure the API Key.

Categories