7.3 KiB
Open Integrations Package
An 1C/OneScript and CLI open-source toolkit for integrating with APIs of popular online services
The implemented methods perform specific tasks (such as SendMessage
or CreatePost
), allowing them to be used without delving into the implementation details. However, the code is highly decomposed – authorization methods, data retrieval, etc., are separated into individual functions where possible. This makes it easy to add new methods, even if they are not yet implemented in the library at the current time.
List of currently available APIs:
Work example
Sending picture to Telegram chat for 1C/OneScript
Token = "6129457865:AAFyzNYOAFbu...";
ChatID = "461699897";
Text = "Cool pic";
Picture = "C:/picture.jpg"; // URL, путь на диске или Двоичные данные
Result = OPI_Telegram.SendImage(Token, ChatID, Text, Picture);
Same thing, but for CLI (bash example)
oint telegram SendImage \
--token "6129457865:AAFyzNYOAFbu..." \
--chat 461699897 \
--text "Cool pic" \
--picture "picture.jpg"
You can use the standard >
redirect or the oint's --out
option to save the response in the console. For more details of working with the CLI version, see the corresponding documentation section
Releases
The library releases come in five versions:
- As a CLI application for Windows and Linux (exe, rpm, deb)
- As XML extension files for loading via the configurator
- As an EDT extension project
- As a standalone extension file in cfe format
- As a OneScript extension package in ospx format
Regardless of the chosen installation method, the files must be obtained from the Release section, as the repository files may contain intermediate data and functions that are still in development.
To get started with OneScript, you also need to install the package
From Hub (only ru version):
opm install oint
From file:
opm install -f "./OInt-x.x.x.ospx"
The CLI version requires .Net Framework 4.8 or Mono of the corresponding version. When installing from rpm or deb packages, it is installed automatically.
Warning
It is not recommended to directly use the methods of service modules (1C and OneScript; OPI_Tools, OPI_Cryptography etc.) in your project (if you plan to update to new versions in the future). To maintain backward compatibility, the number/purpose of parameters and the return types for API methods do not change, but this does not apply to service modules, which may change as needed for optimization and adaptation to new requirements. If you need functionality from the service modules, it is recommended to copy it separately.
Documentation
OpenIntegrations has detailed documentation with examples available at https://en.openintegrations.dev. There you can find both general guidelines for getting started with each specific API and descriptions of each method with code examples, parameters, and return values.
The CLI version of OpenIntegrations has its own built-in help for all methods. The help is displayed when calling the library without a method, a method without options, or by specifying the --help
option.
- Open Integrations Package (OpenIntegrations)
Licensed under the MIT License