You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-23 22:05:15 +02:00
Обновления текста инструкций документации
This commit is contained in:
19
docs/en/md/Instructions/Airtable.md
vendored
19
docs/en/md/Instructions/Airtable.md
vendored
@@ -1,24 +1,19 @@
|
||||
---
|
||||
id: Airtable
|
||||
sidebar_class_name: Airtable
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Airtable]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/Airtable.png').default} width='64px' />
|
||||
|
||||
# Airtable
|
||||
|
||||
This section is dedicated to the library for working with Airtable API. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with Airtable API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
## Getting started
|
||||
|
||||
1. Sign in to Airtable and go to the **[personal tokens creation page](https://airtable.com/create/tokens)**, press **Create new token**
|
||||
|
||||

|
||||
|
||||
2. Enter a name for the new token, select the necessary **scopes** (permissions), and choose the databases and workspaces to which the token will have access
|
||||
|
||||

|
||||
## Getting Started
|
||||
|
||||
1. Log in to Airtable and go to [the personal token creation page](https://airtable.com/create/tokens), click *Create new token*
|
||||
2. Enter a name for the new token, select the required **Scopes** (permissions) and **Access** (bases and workspaces the token will have access to)
|
||||
3. Copy the new **token**
|
||||
|
||||

|
||||
|
||||
The obtained token must then be used when calling the library functions.
|
||||
69
docs/en/md/Instructions/Bitrix24.md
vendored
69
docs/en/md/Instructions/Bitrix24.md
vendored
@@ -1,62 +1,39 @@
|
||||
---
|
||||
id: Bitrix24
|
||||
sidebar_class_name: Bitrix24
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Bitrix24]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/Bitrix24.png').default} width='64px' />
|
||||
|
||||
# Bitrix24
|
||||
|
||||
This section is dedicated to the library for working with Bitrix24 API. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with Bitrix24 API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
## Getting started
|
||||
### Getting Started
|
||||
|
||||
There are two ways to work with Bitrix24 via API: via **Webhook** and via **local application**. For both options you need:
|
||||
To start working with Bitrix24 via API, you need to obtain authorization data. This can be done in one of two ways: by creating a **Webhook** or by creating a **local application**. Both methods are described below.
|
||||
|
||||
1. Go to **Developers** in the **Applications** section of the sidebar
|
||||
|
||||

|
||||
|
||||
2. Select **Other**
|
||||
|
||||

|
||||
|
||||
<hr/><br/>
|
||||
|
||||
### To work via Webhook
|
||||
|
||||
1. Select **Incoming Webhook**
|
||||
|
||||

|
||||
|
||||
2. Fill in the necessary permissions in **Permissions Settings** and save the URL of the webhook. This will be used to execute library methods as the **URL** parameter. The optional **Token** parameter will always remain empty in this case
|
||||
|
||||

|
||||
|
||||
<hr/><br/>
|
||||
|
||||
## To work via Local Application
|
||||
|
||||
1. Select **Local Application**
|
||||
|
||||

|
||||
|
||||
2. Select the path of the handler (if the application does not imply authorization of other users, but only Bitrix management through one administrator account, you can choose any address, for example https://localhost), tick **Use only API** (if you need only the functionality of calling library methods) and fill in the necessary permissions
|
||||
|
||||

|
||||
|
||||
3. Save the **application key** and **application code**
|
||||
|
||||

|
||||
|
||||
4. Using the application key, call the **GetAppAuthLink** function and follow the received link in the browser. After authorization, copy the received code from the address bar (or get it to the handler whose address was specified in point 2)
|
||||
|
||||

|
||||
|
||||
5. Pass the received code, along with the application key and secret, to the **GetToken** function. Save the received **access** and **refresh tokens**
|
||||
|
||||
6. Tokens have a limited lifetime. To get a new token, you can use the **UpdateToken** function, passing here the refresh token, key and application secret. The refresh creates not only a new access token, but also a refresh token as well
|
||||
### Working via Webhook
|
||||
|
||||
1. Go to the *For Developers* subsection in the *Applications* section of the sidebar
|
||||
2. Select the *Other* option
|
||||
3. Choose *Incoming Webhook*
|
||||
4. Configure the required permissions in *Rights Settings* and save the webhook URL. It will be used as the **URL** parameter when executing library methods. The optional **Token** parameter will remain empty in this case.
|
||||
|
||||
### Working via Local Application
|
||||
|
||||
1. Go to the *For Developers* subsection in the *Applications* section of the Bitrix24 sidebar
|
||||
2. Select the *Other* option
|
||||
3. Choose *Local Application*
|
||||
4. Select the handler URL. If the application does not involve authorization of other users but only manages Bitrix through a single administrator account, you can use any address, such as https://localhost.
|
||||
5. Check the **Uses only API** box (if only the library method calling functionality is needed) and configure the required permissions
|
||||
6. Save the application **key** and **secret**
|
||||
7. Pass the application key to the `GetAppAuthLink` function and navigate to the obtained link in your browser
|
||||
8. Log in and copy the received code from the address bar or obtain it from the handler whose address was specified in step 4
|
||||
9. Pass the obtained code, along with the application key and secret, to the `GetToken` function
|
||||
10. Save the obtained **access** and **refresh tokens**
|
||||
|
||||
:::important
|
||||
Token lifetime is limited. To obtain a new token, you can use the **RefreshToken** function by passing the refresh token, key, and application secret. When refreshing, not only a new access token but also a new refresh token is created - it must be saved again.
|
||||
:::
|
||||
15
docs/en/md/Instructions/CDEK.md
vendored
15
docs/en/md/Instructions/CDEK.md
vendored
@@ -1,21 +1,18 @@
|
||||
---
|
||||
id: CDEK
|
||||
sidebar_class_name: CDEK
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, CDEK]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/CDEK.png').default} width='64px' />
|
||||
|
||||
# CDEK
|
||||
|
||||
This section is dedicated to the library for working with CDEK API. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with CDEK API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
## Getting started
|
||||
## Getting Started
|
||||
|
||||
1. Contract with CDEK or use test credentials to get started. Learn more [on the documentation page](https://api-docs.cdek.ru/29923849.html)
|
||||
1. Sign an agreement with CDEK or use test credentials to get started. Learn more [on the documentation page](https://api-docs.cdek.ru/29923849.html)
|
||||
2. Use the obtained **Account** and **Secure password** to create a Token using the `GetToken` method
|
||||
|
||||

|
||||
|
||||
2. Use the obtained **Account** and **Secure password** to create a Token using the *GetToken()* method
|
||||
|
||||
|
||||
A **Token** has a limited lifetime, during which it can be used in calls to other library methods. After it expires, you can get a new one by passing the Account and Secure password to the *GetToken()* method again.
|
||||
**Token** has a limited lifetime during which it can be used in calls to other library methods. After its expiration, you can obtain a new one by again passing the Account and Secure password to the `GetToken` method.
|
||||
40
docs/en/md/Instructions/Dropbox.md
vendored
40
docs/en/md/Instructions/Dropbox.md
vendored
@@ -1,40 +1,24 @@
|
||||
---
|
||||
id: Dropbox
|
||||
sidebar_class_name: Dropbox
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Dropbox]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/Dropbox.png').default} width='64px' />
|
||||
|
||||
# Dropbox
|
||||
|
||||
This section is dedicated to the library for working with Dropbox API. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with Dropbox API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
## Getting started
|
||||
## Getting Started
|
||||
|
||||
1. Login to [Dropbox Developers](https://www.dropbox.com/developers)
|
||||
1. Log into your account on the [Dropbox Developers](https://www.dropbox.com/developers) website
|
||||
2. Navigate to the *App Console*
|
||||
3. Click *Create app*
|
||||
4. Enter a name for the new application and select *Full Dropbox*
|
||||
5. After creation, on the application page click *Scoped app* and select the permissions required for your tasks. Save the **AppKey** and **AppSecret**
|
||||
6. Obtain an authorization link using the `GetAuthorizationLink` function and navigate to it in your browser
|
||||
7. Pass the obtained code, AppKey, and AppSecret to the `GetToken` function
|
||||
8. Save the obtained **access_token** and **refresh_token**
|
||||
|
||||

|
||||
|
||||
1. Go to **App Console**
|
||||
|
||||

|
||||
|
||||
2. Click on **Create app**
|
||||
|
||||

|
||||
|
||||
4. Enter a name for the new application and select **Full Dropbox**
|
||||
|
||||

|
||||
|
||||
5. After creation, on the application page, click **Scoped app** and select the permissions that are necessary to solve your problems. Save **AppKey** and **AppSecret**
|
||||
|
||||

|
||||
|
||||
6. Get the authorization link using the *GetAuthorizationLink()* function and pass it in the browser
|
||||
|
||||

|
||||
|
||||
7. Pass the **received code**, **AppKey** and **AppSecret** to the function *GetToken()*, save the received **access_token** and **refresh_token**
|
||||
|
||||
8. After the access_token lifetime expires, it can be updated using the function *RefreshToken()*
|
||||
The access_token has a limited lifetime. Upon expiration, it can be refreshed using the `RefreshToken` function
|
||||
2
docs/en/md/Instructions/FTP.md
vendored
2
docs/en/md/Instructions/FTP.md
vendored
@@ -8,7 +8,7 @@ keywords: [1C, 1C:Enterprise, 1C:Enterprise 8.3, API, Integration, Services, Dat
|
||||
|
||||
# FTP(s)
|
||||
|
||||
This section is dedicated to the library for working with FTP(s). On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with FTP(s) protocol in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
<div class="theme-admonition theme-admonition-info admonition_node_modules-@docusaurus-theme-classic-lib-theme-Admonition-Layout-styles-module alert alert--info">
|
||||
|
||||
|
||||
117
docs/en/md/Instructions/GoogleCalendar.md
vendored
117
docs/en/md/Instructions/GoogleCalendar.md
vendored
@@ -1,93 +1,56 @@
|
||||
---
|
||||
id: GoogleCalendar
|
||||
sidebar_class_name: GoogleCalendar
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Google Calendar]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/GoogleCalendar.png').default} width='64px' />
|
||||
|
||||
# Google Calendar
|
||||
|
||||
This section is dedicated to the library for working with API Google Calendar. On this page, all the steps necessary to start working are described
|
||||
### Getting Started
|
||||
|
||||
To get started, you need to create an account and a new project on the [Google Cloud Console main page](https://console.cloud.google.com/), then enable the Calendar service on [its Marketplace page](https://console.cloud.google.com/marketplace/product/google/calendar-json.googleapis.com).
|
||||
|
||||
Next, you need to obtain an access token for authorization when calling library functions. This can be done in one of two ways:
|
||||
|
||||
### Authorization via Service Account
|
||||
|
||||
You can obtain an access token using a Service Account secret key. To do this:
|
||||
|
||||
1. Select your project and navigate to *IAM & Admin -> Service Accounts* in the sidebar
|
||||
2. Click *Create service account* and fill in the required fields to create a new account
|
||||
3. Find the created account in the list and click *Actions* (three dots) on the right side of the entry
|
||||
4. Select *Manage keys*
|
||||
5. Click *Add key -> Create new key*
|
||||
6. Choose *JSON* and download the obtained key data
|
||||
|
||||
The obtained JSON file must then be passed (as a collection, file path, or binary data) to the `GetServiceAccountToken` function. You can also specify scopes and token lifetime when calling this function. After the token expires, a new one can be obtained by calling the `GetServiceAccountToken` function again.
|
||||
|
||||
### OAuth Authorization
|
||||
|
||||
OAuth authorization allows obtaining a temporary, refreshable access token for a specific Google user through an authorization page. To enable OAuth authorization in your project, follow these steps:
|
||||
|
||||
1. Select your project and navigate to *APIs and Services -> OAuth consent screen* in the sidebar
|
||||
2. Choose *External*
|
||||
3. Fill in the required information in the provided fields
|
||||
4. Click *Save and continue* after completing the setup process
|
||||
5. Click *Publish App*
|
||||
6. In the sidebar, select *Credentials -> Create Credentials -> OAuth client ID*
|
||||
7. Enter a name and select *Application type - Desktop app*
|
||||
8. Save the **ClientID** and **Client Secret**
|
||||
|
||||
After obtaining the client ID, you need to get the authorization URL. This can be done by passing the ClientID to the `FormCodeRetrievalLink` function. Open the resulting link in a browser, log in with your Google account, then quickly pass the access code from the URL (the text in the address bar after `code=`) to the `GetTokenByCode` function.
|
||||
|
||||
:::important
|
||||
If you're already using the API to interact with other Google Workspace services and have completed the initial setup, you can skip the steps for **Creating a Project** and **Setting Up OAuth**. You just need to enable the Google Drive** service in your existing project and reacquire the token (the last two steps in the instructions).
|
||||
**The code has a very short lifetime.** After navigating to the link from the `FormCodeRetrievalLink` function and logging in with your Google account, you must pass it to the `GetTokenByCode` function as quickly as possible. It's best to prepare a processing form with an input field and button (in 1C) in advance, or use the OIPI CLI version. If the code expires before executing the `GetTokenByCode` function, you will receive an `invalid_grant` error.
|
||||
:::
|
||||
|
||||
## Getting started
|
||||
The function will return a structure containing `access_token` and `refresh_token`: the first is used when calling other library functions, and the second is for obtaining a new `access_token` when it expires (using the `RefreshToken` function).
|
||||
|
||||
<hr/>
|
||||
The `refresh_token` does not change when obtaining a new `access_token` and can be used multiple times.
|
||||
|
||||
### Project creation
|
||||
|
||||
1. Go to the [Google Cloud Console](https://console.cloud.google.com) and create a project
|
||||
|
||||

|
||||
|
||||
2. Select the created project and in the side menu go to APIs and Services -> OAuth consent screen
|
||||
|
||||

|
||||
|
||||
3. Choose External
|
||||
|
||||

|
||||
|
||||
4. Fill in the fields: App name, User support email, and Email addresses (all fields with asterisks)
|
||||
|
||||

|
||||
|
||||
5. Click on Next and then Save and continue on the last tab
|
||||
|
||||

|
||||
|
||||
6. Click on Publish App
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### OAuth settings
|
||||
|
||||
1. In the side menu, select Credentials -> Create Credentials -> OAuth client ID
|
||||
|
||||

|
||||
|
||||
2. Enter the name and choose Application type - Desktop app
|
||||
|
||||

|
||||
|
||||
3. Save ClientID and Client Secret
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Enable service - Google Calendar
|
||||
|
||||
1. Go to the [Calendar page on the Marketplace](https://console.cloud.google.com/marketplace/product/google/calendar-json.googleapis.com)
|
||||
|
||||
2. Click Enable
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Token retrieval
|
||||
|
||||
1. Pass the ClientID to the function OPI_GoogleWorkspace.FormCodeRetrievalLink() with boolean parameters of the services you use. The function will result in a URL that needs to be opened in the browser. Authorize with your Google account
|
||||
|
||||

|
||||
|
||||
2. Copy the code from the URL after authorization
|
||||
|
||||

|
||||
|
||||
:::important
|
||||
**The code life time is extremely short.** After receiving it, you need to perform step 3 as quickly as possible. It is best to prepare a data processor with an input field and a button (in 1C), or use the CLI version of OPI for this step. In case of code lifetime expiry before completing step 3, the error `invalid_grant` will occur
|
||||
:::
|
||||
|
||||
3. Use the obtained code, ClientID, and Client Secret to call the function OPI_GoogleWorkspace.GetTokenByCode(ClientID, ClientSecret, Code)
|
||||
|
||||
```json title="Result of the function GetTokenByCode() if converted to JSON"
|
||||
```json title="Result of the GetTokenByCode function in JSON format"
|
||||
|
||||
{
|
||||
"token_type": "Bearer",
|
||||
@@ -96,7 +59,3 @@ If you're already using the API to interact with other Google Workspace services
|
||||
"expires_in": 3599,
|
||||
"access_token": "ya29.a0AfB_byA344tXkIawdawdwadadhyZQV8bSZn_snNXtY2HLb7l71awdawdawdad-ASgpzyOSWIvEmPruhUa_1yCCq6jvoD0r_q-fNEsARrH8zpJ3c6LNGWvwdg8CXsSxYaCgYKAWkSawfwafawfrCK0EP5kZY_A0171"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
4. Use the **access_token** to pass as a Token parameter when calling functions of the library, and the **refresh_token** - to obtain a new access_token (function OPI_GoogleWorkspace.RefreshToken(ClientID, ClientSecret, RefreshToken)), when the old one expires. When refreshing the token, the refresh_token is not updated - you can use the same one to get a new access_token each time.
|
||||
|
||||
119
docs/en/md/Instructions/GoogleDrive.md
vendored
119
docs/en/md/Instructions/GoogleDrive.md
vendored
@@ -1,102 +1,61 @@
|
||||
---
|
||||
id: GoogleDrive
|
||||
sidebar_class_name: GoogleDrive
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Google Drive]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/GoogleDrive.png').default} width='64px' />
|
||||
|
||||
# Google Drive
|
||||
|
||||
This section is dedicated to the library for working with API Google Drive. On this page, all the steps necessary to start working are described
|
||||
### Getting Started
|
||||
|
||||
To get started, you need to create an account and a new project on the [Google Cloud Console main page](https://console.cloud.google.com/), then enable the Drive service on [its Marketplace page](https://console.cloud.google.com/marketplace/product/google/drive.googleapis.com).
|
||||
|
||||
Next, you need to obtain an access token for authorization when calling library functions. This can be done in one of two ways:
|
||||
|
||||
### Authorization via Service Account
|
||||
|
||||
You can obtain an access token using a Service Account secret key. To do this:
|
||||
|
||||
1. Select your project and navigate to *IAM & Admin -> Service Accounts* in the sidebar
|
||||
2. Click *Create service account* and fill in the required fields to create a new account
|
||||
3. Find the created account in the list and click *Actions* (three dots) on the right side of the entry
|
||||
4. Select *Manage keys*
|
||||
5. Click *Add key -> Create new key*
|
||||
6. Choose *JSON* and download the obtained key data
|
||||
|
||||
The obtained JSON file must then be passed (as a collection, file path, or binary data) to the `GetServiceAccountToken` function. You can also specify scopes and token lifetime when calling this function. After the token expires, a new one can be obtained by calling the `GetServiceAccountToken` function again.
|
||||
|
||||
### OAuth Authorization
|
||||
|
||||
OAuth authorization allows obtaining a temporary, refreshable access token for a specific Google user through an authorization page. To enable OAuth authorization in your project, follow these steps:
|
||||
|
||||
1. Select your project and navigate to *APIs and Services -> OAuth consent screen* in the sidebar
|
||||
2. Choose *External*
|
||||
3. Fill in the required information in the provided fields
|
||||
4. Click *Save and continue* after completing the setup process
|
||||
5. Click *Publish App*
|
||||
6. In the sidebar, select *Credentials -> Create Credentials -> OAuth client ID*
|
||||
7. Enter a name and select *Application type - Desktop app*
|
||||
8. Save the **ClientID** and **Client Secret**
|
||||
|
||||
After obtaining the client ID, you need to get the authorization URL. This can be done by passing the ClientID to the `FormCodeRetrievalLink` function. Open the resulting link in a browser, log in with your Google account, then quickly pass the access code from the URL (the text in the address bar after `code=`) to the `GetTokenByCode` function.
|
||||
|
||||
:::important
|
||||
If you're already using the API to interact with other Google Workspace services and have completed the initial setup, you can skip the steps for **Creating a Project** and **Setting Up OAuth**. You just need to enable the Google Drive** service in your existing project and reacquire the token (the last two steps in the instructions).
|
||||
**The code has a very short lifetime.** After navigating to the link from the `FormCodeRetrievalLink` function and logging in with your Google account, you must pass it to the `GetTokenByCode` function as quickly as possible. It's best to prepare a processing form with an input field and button (in 1C) in advance, or use the OIPI CLI version. If the code expires before executing the `GetTokenByCode` function, you will receive an `invalid_grant` error.
|
||||
:::
|
||||
|
||||
## Getting started
|
||||
The function will return a structure containing `access_token` and `refresh_token`: the first is used when calling other library functions, and the second is for obtaining a new `access_token` when it expires (using the `RefreshToken` function).
|
||||
|
||||
<hr/>
|
||||
The `refresh_token` does not change when obtaining a new `access_token` and can be used multiple times.
|
||||
|
||||
### Project creation
|
||||
|
||||
1. Go to the [Google Cloud Console](https://console.cloud.google.com) and create a project
|
||||
|
||||

|
||||
|
||||
2. Select the created project and in the side menu go to APIs and Services -> OAuth consent screen
|
||||
|
||||

|
||||
|
||||
3. Choose External
|
||||
|
||||

|
||||
|
||||
4. Fill in the fields: App name, User support email, and Email addresses (all fields with asterisks)
|
||||
|
||||

|
||||
|
||||
5. Click on Next and then Save and continue on the last tab
|
||||
|
||||

|
||||
|
||||
6. Click on Publish App
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### OAuth settings
|
||||
|
||||
1. In the side menu, select Credentials -> Create Credentials -> OAuth client ID
|
||||
|
||||

|
||||
|
||||
2. Enter the name and choose Application type - Desktop app
|
||||
|
||||

|
||||
|
||||
3. Save ClientID and Client Secret
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Enable service - Google Drive
|
||||
|
||||
1. Go to [page Drive in Marketplace](https://console.cloud.google.com/marketplace/product/google/drive.googleapis.com)
|
||||
|
||||
2. Click Enable
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Token retrieval
|
||||
|
||||
1. Pass the ClientID to the function OPI_GoogleWorkspace.FormCodeRetrievalLink() with boolean parameters of the services you use. The function will result in a URL that needs to be opened in the browser. Authorize with your Google account
|
||||
|
||||

|
||||
|
||||
2. Copy the code from the URL after authorization
|
||||
|
||||

|
||||
|
||||
:::important
|
||||
**The code life time is extremely short.** After receiving it, you need to perform step 3 as quickly as possible. It is best to prepare a data processor with an input field and a button (in 1C), or use the CLI version of OPI for this step. In case of code lifetime expiry before completing step 3, the error `invalid_grant` will occur
|
||||
:::
|
||||
|
||||
3. Use the obtained code, ClientID, and Client Secret to call the function OPI_GoogleWorkspace.GetTokenByCode(ClientID, ClientSecret, Code)
|
||||
|
||||
```json title="Result of the function GetTokenByCode() if converted to JSON"
|
||||
```json title="Result of the GetTokenByCode function in JSON format"
|
||||
|
||||
{
|
||||
"token_type": "Bearer",
|
||||
"refresh_token": "1//09au6OES3JN9oCgYIARAAGAkSNwF-L9Ir1B7uawfwafT1wE0FKO519Xj6JxawfawfyjMyJ_QlUZYLHZqw",
|
||||
"scope": "https://www.googleapis.com/auth/...",
|
||||
"scope": "https://www.googleapis.com/auth/drive",
|
||||
"expires_in": 3599,
|
||||
"access_token": "ya29.a0AfB_byA344tXkIawdawdwadadhyZQV8bSZn_snNXtY2HLb7l71awdawdawdad-ASgpzyOSWIvEmPruhUa_1yCCq6jvoD0r_q-fNEsARrH8zpJ3c6LNGWvwdg8CXsSxYaCgYKAWkSawfwafawfrCK0EP5kZY_A0171"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
4. Use the **access_token** to pass as a Token parameter when calling functions of the library, and the **refresh_token** - to obtain a new access_token (function OPI_GoogleWorkspace.RefreshToken(ClientID, ClientSecret, RefreshToken)), when the old one expires. When refreshing the token, the refresh_token is not updated - you can use the same one to get a new access_token each time.
|
||||
|
||||
119
docs/en/md/Instructions/GoogleSheets.md
vendored
119
docs/en/md/Instructions/GoogleSheets.md
vendored
@@ -1,102 +1,61 @@
|
||||
---
|
||||
id: GoogleSheets
|
||||
sidebar_class_name: GoogleSheets
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Google Sheets]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/GoogleSheets.png').default} width='64px' />
|
||||
|
||||
# Google Sheets
|
||||
|
||||
This section is dedicated to the library for working with API Google Sheets. On this page, all the steps necessary to start working are described
|
||||
### Getting Started
|
||||
|
||||
To get started, you need to create an account and a new project on the [Google Cloud Console main page](https://console.cloud.google.com/), then enable the Sheets service on [its Marketplace page](https://console.cloud.google.com/marketplace/product/google/sheets.googleapis.com).
|
||||
|
||||
Next, you need to obtain an access token for authorization when calling library functions. This can be done in one of two ways:
|
||||
|
||||
### Authorization via Service Account
|
||||
|
||||
You can obtain an access token using a Service Account secret key. To do this:
|
||||
|
||||
1. Select your project and navigate to *IAM & Admin -> Service Accounts* in the sidebar
|
||||
2. Click *Create service account* and fill in the required fields to create a new account
|
||||
3. Find the created account in the list and click *Actions* (three dots) on the right side of the entry
|
||||
4. Select *Manage keys*
|
||||
5. Click *Add key -> Create new key*
|
||||
6. Choose *JSON* and download the obtained key data
|
||||
|
||||
The obtained JSON file must then be passed (as a collection, file path, or binary data) to the `GetServiceAccountToken` function. You can also specify scopes and token lifetime when calling this function. After the token expires, a new one can be obtained by calling the `GetServiceAccountToken` function again.
|
||||
|
||||
### OAuth Authorization
|
||||
|
||||
OAuth authorization allows obtaining a temporary, refreshable access token for a specific Google user through an authorization page. To enable OAuth authorization in your project, follow these steps:
|
||||
|
||||
1. Select your project and navigate to *APIs and Services -> OAuth consent screen* in the sidebar
|
||||
2. Choose *External*
|
||||
3. Fill in the required information in the provided fields
|
||||
4. Click *Save and continue* after completing the setup process
|
||||
5. Click *Publish App*
|
||||
6. In the sidebar, select *Credentials -> Create Credentials -> OAuth client ID*
|
||||
7. Enter a name and select *Application type - Desktop app*
|
||||
8. Save the **ClientID** and **Client Secret**
|
||||
|
||||
After obtaining the client ID, you need to get the authorization URL. This can be done by passing the ClientID to the `FormCodeRetrievalLink` function. Open the resulting link in a browser, log in with your Google account, then quickly pass the access code from the URL (the text in the address bar after `code=`) to the `GetTokenByCode` function.
|
||||
|
||||
:::important
|
||||
If you're already using the API to interact with other Google Workspace services and have completed the initial setup, you can skip the steps for **Creating a Project** and **Setting Up OAuth**. You just need to enable the Google Sheets** service in your existing project and reacquire the token (the last two steps in the instructions).
|
||||
**The code has a very short lifetime.** After navigating to the link from the `FormCodeRetrievalLink` function and logging in with your Google account, you must pass it to the `GetTokenByCode` function as quickly as possible. It's best to prepare a processing form with an input field and button (in 1C) in advance, or use the OIPI CLI version. If the code expires before executing the `GetTokenByCode` function, you will receive an `invalid_grant` error.
|
||||
:::
|
||||
|
||||
## Getting started
|
||||
The function will return a structure containing `access_token` and `refresh_token`: the first is used when calling other library functions, and the second is for obtaining a new `access_token` when it expires (using the `RefreshToken` function).
|
||||
|
||||
<hr/>
|
||||
The `refresh_token` does not change when obtaining a new `access_token` and can be used multiple times.
|
||||
|
||||
### Project creation
|
||||
|
||||
1. Go to the [Google Cloud Console](https://console.cloud.google.com) and create a project
|
||||
|
||||

|
||||
|
||||
2. Select the created project and in the side menu go to APIs and Services -> OAuth consent screen
|
||||
|
||||

|
||||
|
||||
3. Choose External
|
||||
|
||||

|
||||
|
||||
4. Fill in the fields: App name, User support email, and Email addresses (all fields with asterisks)
|
||||
|
||||

|
||||
|
||||
5. Click on Next and then Save and continue on the last tab
|
||||
|
||||

|
||||
|
||||
6. Click on Publish App
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### OAuth settings
|
||||
|
||||
1. In the side menu, select Credentials -> Create Credentials -> OAuth client ID
|
||||
|
||||

|
||||
|
||||
2. Enter the name and choose Application type - Desktop app
|
||||
|
||||

|
||||
|
||||
3. Save ClientID and Client Secret
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Enable service - Google Sheets
|
||||
|
||||
1. Go to [page Sheets in Marketplace](https://console.cloud.google.com/marketplace/product/google/sheets.googleapis.com)
|
||||
|
||||
2. Click Enable
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Token retrieval
|
||||
|
||||
1. Pass the ClientID to the function OPI_GoogleWorkspace.FormCodeRetrievalLink() with boolean parameters of the services you use. The function will result in a URL that needs to be opened in the browser. Authorize with your Google account
|
||||
|
||||

|
||||
|
||||
2. Copy the code from the URL after authorization
|
||||
|
||||

|
||||
|
||||
:::important
|
||||
**The code life time is extremely short.** After receiving it, you need to perform step 3 as quickly as possible. It is best to prepare a data processor with an input field and a button (in 1C), or use the CLI version of OPI for this step. In case of code lifetime expiry before completing step 3, the error `invalid_grant` will occur
|
||||
:::
|
||||
|
||||
3. Use the obtained code, ClientID, and Client Secret to call the function OPI_GoogleWorkspace.GetTokenByCode(ClientID, ClientSecret, Code)
|
||||
|
||||
```json title="Result of the function GetTokenByCode() if converted to JSON"
|
||||
```json title="Result of the GetTokenByCode function in JSON format"
|
||||
|
||||
{
|
||||
"token_type": "Bearer",
|
||||
"refresh_token": "1//09au6OES3JN9oCgYIARAAGAkSNwF-L9Ir1B7uawfwafT1wE0FKO519Xj6JxawfawfyjMyJ_QlUZYLHZqw",
|
||||
"scope": "https://www.googleapis.com/auth/...",
|
||||
"scope": "https://www.googleapis.com/auth/sheets",
|
||||
"expires_in": 3599,
|
||||
"access_token": "ya29.a0AfB_byA344tXkIawdawdwadadhyZQV8bSZn_snNXtY2HLb7l71awdawdawdad-ASgpzyOSWIvEmPruhUa_1yCCq6jvoD0r_q-fNEsARrH8zpJ3c6LNGWvwdg8CXsSxYaCgYKAWkSawfwafawfrCK0EP5kZY_A0171"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
4. Use the **access_token** to pass as a Token parameter when calling functions of the library, and the **refresh_token** - to obtain a new access_token (function OPI_GoogleWorkspace.RefreshToken(ClientID, ClientSecret, RefreshToken)), when the old one expires. When refreshing the token, the refresh_token is not updated - you can use the same one to get a new access_token each time.
|
||||
|
||||
26
docs/en/md/Instructions/GreenAPI.md
vendored
26
docs/en/md/Instructions/GreenAPI.md
vendored
@@ -1,33 +1,23 @@
|
||||
---
|
||||
id: GreenAPI
|
||||
sidebar_class_name: GreenAPI
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, GreenAPI]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/GreenAPI.png').default} width='64px' />
|
||||
|
||||
# WhatsApp (GreenAPI)
|
||||
|
||||
This section is dedicated to the library for working with WhatsApp via Green API. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with WhatsApp via Green API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
## Getting started
|
||||
### Getting Started
|
||||
|
||||
1. Go to [Green API console](https://console.green-api.com/registration) and complete the registration procedure
|
||||
1. Go to the [Green API Personal Account](https://console.green-api.com/registration) and complete the registration process
|
||||
2. Navigate to the [instance list](https://console.green-api.com/instanceList) and create a new instance
|
||||
3. Select the new instance and link it to your WhatsApp account via QR code or phone number
|
||||
4. Save the instance credentials. To work with the library, you need `apiUrl`, `mediaUrl`, `idInstance`, and `apiTokenInstance`
|
||||
|
||||

|
||||
|
||||
2. Go to [instances list](https://console.green-api.com/instanceList) and create a new one
|
||||
|
||||

|
||||
|
||||
3. Select a new instance and link it to your WhatsApp account by QR code or phone number
|
||||
|
||||

|
||||
|
||||
4. Save the instance credentials. The `apiUrl`, `mediaUrl`, `idInstance` and `apiTokenInstance` are required to work with the library
|
||||
|
||||

|
||||
|
||||
The received data should be passed to the `FormAccessParameters` function. The resulting structure will be used for authorization in all other functions of work with GreenAPI
|
||||
The obtained data must be passed to the `FormAccessParameters` function. The resulting structure will be used for authorization in all other GreenAPI functions.
|
||||
|
||||
```bsl
|
||||
ApiUrl = "https://7105.api.greenapi.com";
|
||||
|
||||
26
docs/en/md/Instructions/GreenMax.md
vendored
26
docs/en/md/Instructions/GreenMax.md
vendored
@@ -1,33 +1,23 @@
|
||||
---
|
||||
id: GreenMax
|
||||
sidebar_class_name: GreenMax
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, GreenAPI, Max]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/GreenMax.png').default} width='64px' />
|
||||
|
||||
# Max (GreenAPI)
|
||||
|
||||
This section is dedicated to the library for working with Max via Green API. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with Max via Green API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
## Getting started
|
||||
### Getting Started
|
||||
|
||||
1. Go to [Green API console](https://console.green-api.com/registration) and complete the registration procedure
|
||||
1. Go to the [Green API Personal Account](https://console.green-api.com/registration) and complete the registration process
|
||||
2. Navigate to the [instance list](https://console.green-api.com/instanceList) and create a new instance
|
||||
3. Select the new instance and link it to your Max account via phone number
|
||||
4. Save the instance credentials. To work with the library, you need `apiUrl`, `mediaUrl`, `idInstance`, and `apiTokenInstance`
|
||||
|
||||

|
||||
|
||||
2. Go to [instances list](https://console.green-api.com/instanceList) and create a new one
|
||||
|
||||

|
||||
|
||||
3. Select a new instance and link it to your Max account by phone number
|
||||
|
||||

|
||||
|
||||
4. Save the instance credentials. The `apiUrl`, `mediaUrl`, `idInstance` and `apiTokenInstance` are required to work with the library
|
||||
|
||||

|
||||
|
||||
The received data should be passed to the `FormAccessParameters` function. The resulting structure will be used for authorization in all other functions of work with GreenAPI
|
||||
The obtained data must be passed to the `FormAccessParameters` function. The resulting structure will be used for authorization in all other GreenAPI functions.
|
||||
|
||||
```bsl
|
||||
ApiUrl = "https://3100.api.green-api.com/v3";
|
||||
|
||||
2
docs/en/md/Instructions/HTTP.md
vendored
2
docs/en/md/Instructions/HTTP.md
vendored
@@ -8,7 +8,7 @@ sidebar_class_name: HTTP
|
||||
# HTTP (Client)
|
||||
|
||||
|
||||
This section is dedicated to the library for working with the HTTP client. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with HTTP(s) protocol in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
## Getting started
|
||||
|
||||
|
||||
2
docs/en/md/Instructions/MSSQL.md
vendored
2
docs/en/md/Instructions/MSSQL.md
vendored
@@ -7,7 +7,7 @@ sidebar_class_name: MSSQL
|
||||
|
||||
# MSSQL
|
||||
|
||||
This section is dedicated to the MSSQL database library. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with MS SQL Server in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
<div class="theme-admonition theme-admonition-info admonition_node_modules-@docusaurus-theme-classic-lib-theme-Admonition-Layout-styles-module alert alert--info">
|
||||
|
||||
|
||||
2
docs/en/md/Instructions/MySQL.md
vendored
2
docs/en/md/Instructions/MySQL.md
vendored
@@ -7,7 +7,7 @@ sidebar_class_name: MySQL
|
||||
|
||||
# MySQL
|
||||
|
||||
This section is dedicated to the MySQL database library. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with MySQL databases in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
<div class="theme-admonition theme-admonition-info admonition_node_modules-@docusaurus-theme-classic-lib-theme-Admonition-Layout-styles-module alert alert--info">
|
||||
|
||||
|
||||
19
docs/en/md/Instructions/Neocities.md
vendored
19
docs/en/md/Instructions/Neocities.md
vendored
@@ -1,26 +1,19 @@
|
||||
---
|
||||
id: Neocities
|
||||
sidebar_class_name: Neocities
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Neocities]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/Neocities.png').default} width='64px' />
|
||||
|
||||
# Neocities
|
||||
|
||||
This section is dedicated to the library for working with Neocities API. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with Neocities API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
## Getting started
|
||||
|
||||
1. Log in to the [Neocities portal](https://neocities.org) and go to settings
|
||||
|
||||

|
||||
## Getting Started
|
||||
|
||||
1. Log in to the [Neocities](https://neocities.org) portal and go to settings
|
||||
2. Select the required site from the list and click **Manage Site Settings**
|
||||
3. Navigate to the **API** tab, generate and save the **API KEY**
|
||||
|
||||

|
||||
|
||||
3. Click on the **API** tab, generate and save the **API KEY**
|
||||
|
||||

|
||||
|
||||
API Key is used in each API method as a Token parameter. You can also generate a token based on your login and password using the *GetToken* method
|
||||
The API Key is used in every API method as the Token parameter. You can also generate a token based on your login and password using the `GetToken` function
|
||||
36
docs/en/md/Instructions/Notion.md
vendored
36
docs/en/md/Instructions/Notion.md
vendored
@@ -1,38 +1,22 @@
|
||||
---
|
||||
id: Notion
|
||||
sidebar_class_name: Notion
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Notion]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/Notion.png').default} width='64px' />
|
||||
|
||||
# Notion
|
||||
|
||||
This section is dedicated to the library for working with Notion API. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with Notion API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
## Getting started
|
||||
## Getting Started
|
||||
|
||||
1. Go to the **[section of integrations of the developer portal](https://www.notion.so/my-integrations)**
|
||||
1. Log in and navigate to [the integrations section of the developer portal](https://www.notion.so/my-integrations)
|
||||
2. Enter your integration name
|
||||
3. After completing the integration creation, click *Show* and copy the **Token (Secret)**
|
||||
4. Go to the *[main Notion interface](https://notion.so)* and create a new page. This page will be the parent for all other objects created via API
|
||||
5. Click the three dots in the upper right corner and find the *Add connections* option at the bottom. Select your integration from step 3
|
||||
6. Get the page ID. This can be done by clicking *Share -> Copy link* or simply copying from the URL
|
||||
|
||||

|
||||
|
||||
2. Enter the name of your integration
|
||||
|
||||

|
||||
|
||||
3. After finishing the integration creation, click *Show* and copy the **Token (Secret)**
|
||||
|
||||

|
||||
|
||||
4. Go to the **[main interface of Notion](https://notion.so)** and create a new page. This page will serve as the parent for all other objects created through the API
|
||||
|
||||

|
||||
|
||||
5. Click on the three dots in the upper right corner and at the very bottom find the item *Add connections*. Select your integration from items 1-3 there
|
||||
|
||||

|
||||
|
||||
6. Get the ID of this page. You can do this by clicking Share -> Copy link or simply by copying it from the URL
|
||||
|
||||

|
||||
|
||||
**Token** and **Page ID** are the two parameters required for working through the API.
|
||||
**Token** and **Page ID** are the two parameters required for using the other library functions
|
||||
21
docs/en/md/Instructions/Ollama.md
vendored
21
docs/en/md/Instructions/Ollama.md
vendored
@@ -1,26 +1,19 @@
|
||||
---
|
||||
id: Ollama
|
||||
sidebar_class_name: Ollama
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Ollama]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/Ollama.png').default} width='64px' />
|
||||
|
||||
# Ollama
|
||||
|
||||
This section covers the library for working with Ollama in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
## Getting Started
|
||||
|
||||
This section is dedicated to the library for working with Ollama API. On this page, all the steps necessary to start working are described
|
||||
1. Download Ollama from the [official website](https://ollama.com/) and run it on the target machine
|
||||
2. `(optional)` To enable uploading your own models to Ollama servers, you also need to create an account and add a public key to the local solution, following the instructions in the [Ollama keys](https://ollama.com/settings/keys) section
|
||||
3. `(optional)` To add authorization and enable processing requests from external sources, you need to configure proxying through a third-party web server
|
||||
|
||||
## Getting started
|
||||
|
||||
1. Download Ollama from [official website](https://ollama.com/) and run it on the target machine
|
||||
|
||||

|
||||
|
||||
2. `(optional)` To be able to send your models to the Ollama servers, you are also required to create an account and add a public key to the local solution by following the instructions in the [Ollama keys](https://ollama.com/settings/keys) section
|
||||
|
||||

|
||||
|
||||
3. `(optional)` To add authorization and the ability to handle requests from outside, you must configure proxying through a third-party web server
|
||||
|
||||
> By default, the Ollama server is only available on the local network at `localhost:11434`
|
||||
> By default, the Ollama server is only accessible on the local network at `localhost:11434`
|
||||
2
docs/en/md/Instructions/OpenAI.md
vendored
2
docs/en/md/Instructions/OpenAI.md
vendored
@@ -7,7 +7,7 @@ sidebar_class_name: OpenAI
|
||||
|
||||
# OpenAI
|
||||
|
||||
This section is devoted to the library for working with the OpenAI API in 1C:Enterprise, OneScript, and CLI. This page describes all actions required to fully start working with it.
|
||||
This section covers the library for working with OpenAI API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
## Preface
|
||||
|
||||
|
||||
2
docs/en/md/Instructions/PostgreSQL.md
vendored
2
docs/en/md/Instructions/PostgreSQL.md
vendored
@@ -7,7 +7,7 @@ sidebar_class_name: PostgreSQL
|
||||
|
||||
# PostgreSQL
|
||||
|
||||
This section is dedicated to the PostgreSQL database library. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with PostgreSQL databases in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
<div class="theme-admonition theme-admonition-info admonition_node_modules-@docusaurus-theme-classic-lib-theme-Admonition-Layout-styles-module alert alert--info">
|
||||
|
||||
|
||||
2
docs/en/md/Instructions/RCON.md
vendored
2
docs/en/md/Instructions/RCON.md
vendored
@@ -7,7 +7,7 @@ sidebar_class_name: RCON
|
||||
|
||||
# RCON (Client)
|
||||
|
||||
This section is dedicated to the library for working with the RCON. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with RCON protocol in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
<div class="theme-admonition theme-admonition-info admonition_node_modules-@docusaurus-theme-classic-lib-theme-Admonition-Layout-styles-module alert alert--info">
|
||||
|
||||
|
||||
2
docs/en/md/Instructions/S3.md
vendored
2
docs/en/md/Instructions/S3.md
vendored
@@ -7,7 +7,7 @@ sidebar_class_name: S3
|
||||
|
||||
# AWS S3 (MinIO)
|
||||
|
||||
This section is dedicated to the library for working with AWS S3 API. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with AWS S3 API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
:::important
|
||||
|
||||
|
||||
2
docs/en/md/Instructions/SFTP.md
vendored
2
docs/en/md/Instructions/SFTP.md
vendored
@@ -8,7 +8,7 @@ keywords: [1C, 1C:Enterprise, 1C:Enterprise 8.3, API, Integration, Services, Dat
|
||||
|
||||
# SFTP
|
||||
|
||||
This section is dedicated to the library for working with SFTP. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with SFTP protocol in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
<div class="theme-admonition theme-admonition-info admonition_node_modules-@docusaurus-theme-classic-lib-theme-Admonition-Layout-styles-module alert alert--info">
|
||||
|
||||
|
||||
2
docs/en/md/Instructions/SQLite.md
vendored
2
docs/en/md/Instructions/SQLite.md
vendored
@@ -7,7 +7,7 @@ sidebar_class_name: SQLite
|
||||
|
||||
# SQLite
|
||||
|
||||
This section is dedicated to the SQLite database library. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with SQLite databases in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
<div class="theme-admonition theme-admonition-info admonition_node_modules-@docusaurus-theme-classic-lib-theme-Admonition-Layout-styles-module alert alert--info">
|
||||
|
||||
|
||||
2
docs/en/md/Instructions/SSH.md
vendored
2
docs/en/md/Instructions/SSH.md
vendored
@@ -8,7 +8,7 @@ keywords: [1C, 1C:Enterprise, 1C:Enterprise 8.3, API, Integration, Services, Dat
|
||||
|
||||
# SSH
|
||||
|
||||
This section is dedicated to the library for working with SSH. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with SSH protocol in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
<div class="theme-admonition theme-admonition-info admonition_node_modules-@docusaurus-theme-classic-lib-theme-Admonition-Layout-styles-module alert alert--info">
|
||||
|
||||
|
||||
67
docs/en/md/Instructions/Slack.md
vendored
67
docs/en/md/Instructions/Slack.md
vendored
@@ -1,64 +1,27 @@
|
||||
---
|
||||
id: Slack
|
||||
sidebar_class_name: Slack
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Slack]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/Slack.png').default} width='64px' />
|
||||
|
||||
# Slack
|
||||
|
||||
This section is dedicated to the library for working with the Slack Web API. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with Slack Web API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
## Getting started
|
||||
### Getting Started
|
||||
|
||||
1. Log in to your account and go to the **Your Apps** page on the website [Slack API](https://api.slack.com)
|
||||
1. Log into your account and go to the **Your Apps** page on the [Slack API](https://api.slack.com) website
|
||||
2. Click **Create App** and select **From scratch**
|
||||
3. Choose a name and the workspace where you need to create the application
|
||||
4. Create a new token by clicking **Generate Token and Scopes** further down on the application page
|
||||
5. Navigate to the **OAuth & Permissions** section from the app settings
|
||||
6. Add the permissions required for your purposes
|
||||
7. Install the application by clicking the **Install to Workspace** button
|
||||
8. Save the generated token
|
||||
|
||||

|
||||
|
||||
<br/>
|
||||
|
||||
2. Click **Create App** and choose **From scratch**
|
||||
|
||||

|
||||
|
||||
3. Select the name and workspace where you need to create the application
|
||||
|
||||

|
||||
|
||||
<br/>
|
||||
|
||||
4. Create a new token by clicking Generate Token and Scopes below on the application page
|
||||
|
||||

|
||||
|
||||
<br/>
|
||||
|
||||
5. Select a name and add permissions
|
||||
|
||||

|
||||
|
||||
<br/>
|
||||
|
||||
6. Go to **Premission scope** page
|
||||
|
||||

|
||||
|
||||
<br/>
|
||||
|
||||
7. Add the permissions required for your purposes
|
||||
|
||||

|
||||
|
||||
<br/>
|
||||
|
||||
8. Install the application
|
||||
|
||||

|
||||
|
||||
<br/>
|
||||
|
||||
9. Save the generated token
|
||||
|
||||

|
||||
|
||||
<br/>
|
||||
```
|
||||
xoxb-1234567890123-4567890123456-QWERTYUIOPASDFGHJKLZXCVB
|
||||
```
|
||||
This token will then be used for authorization when performing actions on behalf of the created application
|
||||
2
docs/en/md/Instructions/TCP.md
vendored
2
docs/en/md/Instructions/TCP.md
vendored
@@ -7,7 +7,7 @@ sidebar_class_name: TCP
|
||||
|
||||
# TCP (Client)
|
||||
|
||||
This section is dedicated to the library for working with the TCP. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with TCP protocol in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
<div class="theme-admonition theme-admonition-info admonition_node_modules-@docusaurus-theme-classic-lib-theme-Admonition-Layout-styles-module alert alert--info">
|
||||
|
||||
|
||||
45
docs/en/md/Instructions/Telegram.md
vendored
45
docs/en/md/Instructions/Telegram.md
vendored
@@ -1,41 +1,32 @@
|
||||
---
|
||||
id: Telegram
|
||||
sidebar_class_name: Telegram
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Telegram]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/Telegram.png').default} width='64px' />
|
||||
|
||||
# Telegram
|
||||
|
||||
This section is dedicated to the library for working with Telegram API. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with Telegram Bot API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
## Getting started
|
||||
### Getting Started
|
||||
|
||||
- Create a Telegram bot
|
||||
1. Start a conversation with [@BotFather](https://t.me/BotFather) to create a new bot
|
||||
2. Select the `/newbot` command
|
||||
3. Complete the new bot creation procedure, choose a display name and username
|
||||
4. Save the **token** received upon completion of creation
|
||||
|
||||
1. All actions with the Telegram API are carried out through bots. To create a new bot, you need to start a conversation with [@BotFather](https://t.me/BotFather)
|
||||
```
|
||||
1234567890:AAXcxHjoAmgkhgae67fmnghjfmggkTRFkgf
|
||||
```
|
||||
|
||||

|
||||
You can then use this token to perform actions on behalf of the bot in available chats. The chat for performing actions is determined by its `id` - this can be a Telegram user ID or a channel name starting with the `@` symbol. To perform actions in channels, the bot must be appointed as its administrator.
|
||||
|
||||
2. Choose */newbot* command
|
||||
|
||||

|
||||
|
||||
3. BotFather will prompt you to choose a name and a username for the bot, after which the creation process will be completed
|
||||
|
||||
- Save the **token** that BotFather sent you after completing the bot creation
|
||||
|
||||

|
||||
|
||||
- (Optional) Determine the purpose of the interaction
|
||||
|
||||
The bot you created can now be used in two ways
|
||||
|
||||
- Like a chat-bot
|
||||
- For automating channel management
|
||||
|
||||
Depending on the chosen path, the way to obtain the **ChatID** (the parameter responsible for identifying the interaction object) will differ.
|
||||
|
||||
In the case of a chat bot, the chat ID will be the user ID with whom the bot is conversing. If the bot is to be used for channel management, after adding it as an administrator, you can use the channel's name with @ (e.g., @MyChannel) instead of the chat ID
|
||||
|
||||
The token and chat ID are the primary parameters for all methods of working with the Telegram API
|
||||
### Data Retrieval
|
||||
|
||||
After creating the bot, you can retrieve bot event data in one of two ways:
|
||||
|
||||
- By sending requests to the Telegram server (polling). For this, you need to regularly call the `GetUpdates` method, which allows collecting information about new events in any chat that the bot has access to.
|
||||
|
||||
- Using Webhook. For this, you need to create an HTTP service with a public address and SSL certificate, then pass it to the `SetWebhook` function. Telegram will automatically send data about new events to the specified address, where these events can be processed.
|
||||
174
docs/en/md/Instructions/Twitter.md
vendored
174
docs/en/md/Instructions/Twitter.md
vendored
@@ -1,120 +1,98 @@
|
||||
---
|
||||
id: Twitter
|
||||
sidebar_class_name: Twitter
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Twitter]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/Twitter.png').default} width='64px' />
|
||||
|
||||
# Twitter | X
|
||||
|
||||
This section is dedicated to the library for working with Twitter API. On this page, all the steps necessary to start working are described. This library allows you to work with the functionality of the free plan, meaning you can create tweets.
|
||||
This section covers the library for working with Twitter API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started. This library allows working with the functionality of the free plan, i.e., creating tweets.
|
||||
|
||||
## Getting started
|
||||
|
||||
|
||||
Working with Twitter involves using two APIs - v1 (1.1) and v2, which are not separate types of actions but simply different versions of the API. Despite Twitter's preference for v2, it turned out that some mechanisms (such as the file upload mechanism) did not appear in it. Therefore, even for creating a regular tweet with an image, you need to work with both API versions, resulting in a double set of authentication data. This set is described in the function *GetStandardParameters()*
|
||||
### Getting Started
|
||||
|
||||
Working with Twitter involves working with two APIs - v1 (1.1) and v2, each responsible for its own set of functionality. To start working with them, you need to form a specific set of data and authorization parameters. Its structure is described in the `GetStandardParameters` function.
|
||||
|
||||
```bsl
|
||||
|
||||
Parameters_.Insert("redirect_uri", "");
|
||||
Parameters_.Insert("scope", "");
|
||||
Parameters_.Insert("client_id", "");
|
||||
Parameters_.Insert("client_secret", "");
|
||||
Parameters_.Insert("access_token", "");
|
||||
Parameters_.Insert("refresh_token", "");
|
||||
Parameters_.Insert("oauth_token", "");
|
||||
Parameters_.Insert("oauth_token_secret", "");
|
||||
Parameters_.Insert("oauth_consumer_key", "");
|
||||
Parameters_.Insert("redirect_uri" , "");
|
||||
Parameters_.Insert("scope" , "");
|
||||
Parameters_.Insert("client_id" , "");
|
||||
Parameters_.Insert("client_secret" , "");
|
||||
Parameters_.Insert("access_token" , "");
|
||||
Parameters_.Insert("refresh_token" , "");
|
||||
Parameters_.Insert("oauth_token" , "");
|
||||
Parameters_.Insert("oauth_token_secret" , "");
|
||||
Parameters_.Insert("oauth_consumer_key" , "");
|
||||
Parameters_.Insert("oauth_consumer_secret", "");
|
||||
|
||||
```
|
||||
|
||||
You can define these parameters directly within the structure inside this function or pass them directly when calling the functions for working with the API - each of them accepts parameters as the last optional argument. When passing parameters in this way, the default parameters will be overwritten by keys. Let's consider the creation of an application and obtaining each field
|
||||
You can define these parameters directly in the structure within this function or pass them directly when calling API functions - each of them accepts parameters as the last optional argument. When passed this way, standard parameters will be overwritten by keys. Let's examine application creation and obtaining each field.
|
||||
|
||||
### Creating an Application
|
||||
|
||||
### Creating an application
|
||||
To work with the Twitter API, you need to go to the following address: [https://developer.twitter.com/](https://developer.twitter.com/), register, and create a new application
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
### Definition of fields
|
||||
After creating the application, you can fill in the necessary data in 1C
|
||||
|
||||
To work with Twitter API, you need to go to [developer.twitter.com](https://developer.twitter.com/), register, and complete the procedure for creating a new application. After that, in the application management panel, you need to define the fields required for creating the authorization structure:
|
||||
|
||||
- **redirect_uri**
|
||||
|
||||
redirect_uri - The URL of the HTTP request handler specified during registration. Authorization for API v2 requires confirmation of login through the browser, after which a request with a special code will be sent to this handler. Further details will be provided in the section on access_token and refresh_token.
|
||||
|
||||
|
||||
- **scope**
|
||||
|
||||
The scope determines the functions available for operation. In GetStandardParameters(), the scope list is defined by default.
|
||||
|
||||
- **client_id**
|
||||
|
||||

|
||||
- **redirect_uri**
|
||||
|
||||
`redirect_uri` - the HTTP request handler address specified during registration. API v2 authorization requires login confirmation through a browser, after which a request with a special code will be sent to this handler. More details in the *access_token and refresh_token* section.
|
||||
|
||||
|
||||
- **scope**
|
||||
|
||||
- **client_secret**
|
||||
|
||||

|
||||
|
||||
- **access_token** and **refresh_token**
|
||||
|
||||
These tokens need to be obtained via an HTTP request with the code that comes during authorization on the HTTP service redirect_uri. The sequence of actions is as follows:
|
||||
1. Create a link for authorization in the browser using the *GetAuthorizationLink* function
|
||||
2. Add to the HTTP service module (GET) a call to the *HandleIncomingRequestAfterAuthorization* function, passing the HTTP service request as a parameter.
|
||||
3. Authorize in the browser using the link from step 1
|
||||
3. Save the access_token and refresh_token obtained from the *HandleIncomingRequestAfterAuthorization* function in step 2 into constants or another storage
|
||||
|
||||
|
||||
```bsl title="Obtaining"
|
||||
|
||||
Function Twitterget(Request)
|
||||
|
||||
Code = Request.RequestParameters["code"];
|
||||
TokenResponse = OPI_Twitter.GetToken(Code, Parameters);
|
||||
|
||||
Constants.TwitterRefresh.Set(ResponseToken["refresh_token"]);
|
||||
Constants.TwitterToken.Set(ResponseToken["access_token"]);
|
||||
|
||||
Response = New HTTPServiceResponse(200);
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
scope defines the available functions for work. In *GetStandardParameters()*, the scope list is defined by default.
|
||||
|
||||
- **client_id**
|
||||
|
||||
```
|
||||
|
||||
```bsl title="Updating"
|
||||
|
||||
Procedure UpdateTokenEveryTwoHours(Val Parameters)
|
||||
|
||||
Response = OPI_Twitter.RefreshToken(Parameters);
|
||||
Constants.TwitterToken.Set(Response["access_token"]);
|
||||
Constants.TwitterRefresh.Set(Response["refresh_token"]);
|
||||
Client ID can be found on the main settings page in the *OAuth 2.0 Client ID and Client Secret* section.
|
||||
|
||||
EndProcedure
|
||||
```
|
||||
|
||||
Hardcoding token data is not recommended because the access_token expires after only 2 hours. Upon expiration, the token needs to be refreshed using the RefreshToken function. During this update, both the access_token and refresh_token are refreshed. Therefore, when refreshing the expired access_token token next time, the refresh_token should be from the previous request.
|
||||
|
||||

|
||||
|
||||
|
||||
- **oauth_token** and **oauth_token_secret**
|
||||
|
||||

|
||||
|
||||
- **oauth_consumer_key** and **oauth_consumer_secret**
|
||||
|
||||

|
||||
|
||||
|
||||
After filling in the data fields, you can proceed to work with the API methods
|
||||
|
||||
|
||||
|
||||
- **client_secret**
|
||||
|
||||
Client secret can be generated using the `Generate` button in the same section as the Client ID.
|
||||
|
||||
- **oauth_token** and **oauth_token_secret**
|
||||
|
||||
Can be generated in the *Authentication Tokens* section, under *Access Token and Secret*.
|
||||
|
||||
- **oauth_consumer_key** and **oauth_consumer_secret**
|
||||
|
||||
Can be generated in the *Consumer Keys* section, under *API Key and Secret*.
|
||||
|
||||
- **access_token** and **refresh_token**
|
||||
|
||||
These tokens need to be obtained via an HTTP request specifying the code that comes during authorization to the `redirect_uri` HTTP service. Procedure:
|
||||
|
||||
1. Create an authorization link for the browser using the `GetAuthorizationLink` function.
|
||||
2. Add a call to the `HandleIncomingRequestAfterAuthorization` function to the HTTP service module (GET), passing `HTTPServiceRequest` as a parameter.
|
||||
3. Authorize in the browser using the link from step 1.
|
||||
4. Save the **access_token** and **refresh_token** obtained from the `HandleIncomingRequestAfterAuthorization` function in step 2 to constants or other storage.
|
||||
|
||||
```bsl title="Retrieval"
|
||||
|
||||
Function TwitterGet(Request)
|
||||
|
||||
Code = Request.QueryOptions["code"];
|
||||
TokenResponse = OPI_Twitter.GetToken(Code, Parameters);
|
||||
|
||||
Constants.TwitterRefresh.Set(TokenResponse["refresh_token"]);
|
||||
Constants.TwitterToken.Set(TokenResponse["access_token"]);
|
||||
|
||||
Response = New HTTPServiceResponse(200);
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
```
|
||||
|
||||
```bsl title="Refreshing"
|
||||
Procedure RefreshTokenEveryTwoHours(Parameters)
|
||||
|
||||
Response = OPI_Twitter.RefreshToken(Parameters);
|
||||
Constants.TwitterToken.Set(Response["access_token"]);
|
||||
Constants.TwitterRefresh.Set(Response["refresh_token"]);
|
||||
|
||||
EndProcedure
|
||||
```
|
||||
|
||||
Access_token is valid for 2 hours. After this period, the token must be refreshed using the `RefreshToken` function. Both `access_token` and `refresh_token` are updated during this process. This means that when refreshing an expired `access_token` next time, the `refresh_token` must be from the **previous** request.
|
||||
|
||||
After defining all fields and creating the authorization structure, they can be used in various library functions to perform specific actions.
|
||||
97
docs/en/md/Instructions/VK.md
vendored
97
docs/en/md/Instructions/VK.md
vendored
@@ -1,94 +1,39 @@
|
||||
---
|
||||
id: VK
|
||||
sidebar_class_name: VK
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, VK]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/VK.png').default} width='64px' />
|
||||
|
||||
# VKontakte
|
||||
|
||||
This section is dedicated to the library for working with VK API. It is geared towards working with communities and performing actions on their behalf. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with VK API in 1С:Enterprise, OneScript, and CLI. It is designed for working with communities and performing actions on their behalf. This page describes all the steps required to get started.
|
||||
|
||||
## Getting started
|
||||
### Getting Started
|
||||
|
||||
To begin, you need to obtain certain parameters for the VK API.
|
||||
Most functions in this library serve to perform various operations when administering groups and public pages. To start working with them, you need to create an application and obtain a specific set of credentials that will be used in further work:
|
||||
|
||||
<br/><br/>
|
||||
The list of necessary data in the form of a structure is contained in the function *GetStandardParameters()*. You can specify parameter values directly within it or pass them as a structure when calling any other library methods as an optional parameter *Parameters* (the last one in all library methods). In the latter case, the standard parameters will be overwritten by the ones passed during the method call. Only the data with matching keys will be overwritten. If a parameter exists in the standard set but was not passed during the method call, it will retain its default value.
|
||||
<br/><br/>
|
||||
|
||||
```bsl
|
||||
_Parameters = New Structure;
|
||||
1. Complete the procedure for creating a new Web application [on the VK ID page](https://id.vk.com/about/business/go)
|
||||
2. Obtain the ID of the created application
|
||||
3. Select the required group and obtain its ID in the *Basic Information* section of the management panel
|
||||
4. Generate a URL for obtaining the application token using the `CreateTokenRetrievalLink` function or manually. The URL has the following structure:
|
||||
|
||||
_Parameters.Insert("v", "5.131");
|
||||
_Parameters.Insert("from_group", "1");
|
||||
_Parameters.Insert("group_id", "123456789");
|
||||
_Parameters.Insert("owner_id", "-123456789");
|
||||
_Parameters.Insert("app_id", "87654321");
|
||||
_Parameters.Insert("access_token", "vk1.a.E-byuFeG1qcN7...");
|
||||
|
||||
```
|
||||
```
|
||||
https://oauth.vk.com/authorize?client_id= + Application ID from step 2 + &scope=offline,wall,groups,photos,stats,stories,ads&v=5.131&response_type=token&redirect_uri=https://api.vk.com/blank.html
|
||||
```
|
||||
|
||||
Let's consider obtaining of each value:
|
||||
|
||||
**1. v**
|
||||
|
||||
The parameter `v` denotes the version of the VK API. Testing was conducted on version 5.131, and it is recommended to keep it as such
|
||||
5. Navigate to the created link in your browser and log in with your VK account
|
||||
6. Copy the token from the address bar (the string after `access_token=`)
|
||||
7. (Optional) Create a group access key on the *API Work* tab if you plan to send messages to users on behalf of the group
|
||||
|
||||
**2. from_group**
|
||||
After obtaining the necessary data, you can form an authorization structure using the `GetAuthParameters` function. This structure is used when calling any of the library functions as the `Parameters` parameter for authorizing outgoing requests.
|
||||
|
||||
On behalf of the group. It should be set to 1
|
||||
```bsl
|
||||
GroupID = "123456789"; // Group ID from step 3
|
||||
AppID = "123456789"; // Application ID from step 2
|
||||
Token = "vk1.a...."; // Authorization token from step 6
|
||||
|
||||
**3. group_id and owner_id**
|
||||
|
||||
Group ID. If you have a standard group URL, you can find the ID in the URL. Otherwise, it will be on the 'Manage' tab in the group, below the Address field. 'owner_id' is the same but with a '-' sign in front of it
|
||||
|
||||

|
||||
|
||||
**4. app_id**
|
||||
|
||||
app_id - Application ID. To create an application, you need to:
|
||||
|
||||
* Go to the https://id.vk.com/about/business/go, authorize and enter your personal or company information
|
||||
|
||||

|
||||
|
||||
* Enter the application name and select the **Web**
|
||||
|
||||

|
||||
|
||||
* Enter the domain name and the URL of the redirect handler. It's worth noting that this mechanism for creating VK applications is new. Until recently, VK applications were created differently, and having a redirect URL was unnecessary. At the moment, it's not entirely clear why it's needed for our server application - VK no longer distinguishes server applications as such. Theoretically, you can enter anything there - there is no need for receiving callback data to work with the library. However, this may change over time.
|
||||
|
||||

|
||||
|
||||
* Enter passport details or organization information, enable access to communities (in short, if you already had an application before, you're lucky, but if you don't have a Russian passport, you'll have to contact support)
|
||||
|
||||

|
||||
|
||||
* Get app_id at the application page
|
||||
|
||||

|
||||
|
||||
**5. access_token**
|
||||
|
||||
You can obtain a link for acquiring the access token using the function *CreateTokenRetrievalLink* or manually concatenate it
|
||||
|
||||
https://oauth.vk.com/authorize?client_id= + *app_id* + &scope=offline,wall,groups,photos,stats,stories,ads&v=5.131&response_type=token&redirect_uri=https://api.vk.com/blank.html
|
||||
|
||||
* You need to follow this link in your browser
|
||||
* Authorize through VK and confirm access
|
||||
* Retrieve the token from the URL parameter in the address bar
|
||||
|
||||

|
||||
|
||||
**(Additionally) communitytoken**
|
||||
|
||||
Some methods, such as those for working with community chat bots, accept the parameter 'communitytoken' instead of 'access_token'. To obtain it, you need to:
|
||||
|
||||
* Go to the 'Manage' section in the VK group
|
||||
* Find the 'API usage' tab
|
||||
* Click on 'Create key' and retrieve it
|
||||
|
||||

|
||||
|
||||
You don't need to obtain the 'communitytoken' if you're not using such methods at the moment
|
||||
Parameters = OPI_VK.GetAuthParameters(GroupID, AppID, Token);
|
||||
```
|
||||
40
docs/en/md/Instructions/VKTeams.md
vendored
40
docs/en/md/Instructions/VKTeams.md
vendored
@@ -1,47 +1,29 @@
|
||||
---
|
||||
id: VKTeams
|
||||
sidebar_class_name: VKTeams
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, VKTeams, VK Teams]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/VKTeams.png').default} width='64px' />
|
||||
|
||||
# VK Teams
|
||||
|
||||
This section is dedicated to the library for working with VK Teams API. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with VK Teams API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
## Getting started
|
||||
|
||||
1. Register, book a tariff and download the VK Teams app [on the home page](https://biz.mail.ru/teams)
|
||||
|
||||

|
||||
|
||||
2. Log in to the application using the one-time password that should arrive in the mail. You can view the mail of the required user in the administration panel
|
||||
|
||||

|
||||
|
||||
3. Start a dialog with [@metabot](http://teams.vk.com/profile/70001) and follow the procedure to create a new bot
|
||||
|
||||

|
||||
### Getting Started
|
||||
|
||||
1. Register, choose a tariff plan, and download the VK Teams application [on the main page](https://biz.mail.ru/teams)
|
||||
2. Log into the application using a one-time password that will be sent to your email. You can view the email of the required user in the administration panel
|
||||
3. Start a conversation with [@metabot](http://teams.vk.com/profile/70001) and complete the procedure for creating a new bot
|
||||
4. Generate a new **token** and enable the ability to add the bot to a group (if necessary)
|
||||
|
||||

|
||||
|
||||
5. Save the bot ID by retrieving it using the "Show My Bots" button
|
||||
|
||||

|
||||
|
||||
6. Form a link and click on it in your browser
|
||||
5. Save the bot ID by obtaining it using the "Show my bots" button
|
||||
6. Generate a link and navigate to it in your browser
|
||||
|
||||
```
|
||||
|
||||
At the end of the URL should be your bot ID
|
||||
The URL should end with your bot ID
|
||||
https://teams.vk.com/profile/1234567890
|
||||
|
||||
```
|
||||
|
||||
7. Start a dialog with the bot
|
||||
7. Start a conversation with the bot
|
||||
|
||||
Now you will be able to add a bot to groups and control it with **Token** and **ID of the desired dialog** (group or user)
|
||||
|
||||

|
||||
Now you can add the bot to groups and manage it using the **Token** and **ID of the required chat** (group or user)
|
||||
64
docs/en/md/Instructions/Viber.md
vendored
64
docs/en/md/Instructions/Viber.md
vendored
@@ -1,63 +1,45 @@
|
||||
---
|
||||
id: Viber
|
||||
sidebar_class_name: Viber
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Viber]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/Viber.png').default} width='64px' />
|
||||
|
||||
# Viber
|
||||
|
||||
This section is dedicated to the library for working with Viber API. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with Viber API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
:::warning
|
||||
Starting from February 5, 2024, this method of creating bots is no longer valid: Rakuten has canceled the ability to create bots for free, and now working with the API requires verification under a commercial model. More details [here](https://help.viber.com/hc/en-us/articles/15247629658525-Bot-commercial-model)
|
||||
As of 02/05/2024, this method of creating bots is no longer valid: Rakuten has discontinued the ability to create bots for free, and now working with the API requires verification under a commercial model. Learn more [here](https://help.viber.com/hc/en-us/articles/15247629658525-Bot-commercial-model)
|
||||
:::
|
||||
|
||||
:::caution
|
||||
The methods of this library have not been tested since 10.01.2025
|
||||
Methods in this library have not been tested since 01/10/2025
|
||||
:::
|
||||
|
||||
## Getting started
|
||||
### Getting Started
|
||||
|
||||
For Viber, there are two REST APIs: one for working with channels and the other for chatbots. In both cases, the main parameters are **Token** and **UserID**
|
||||
Viber has two REST API variants: for working with channels and for chat bots. In both cases, the main parameters for operation are **Token** and **UserID**.
|
||||
|
||||
### Channel Management
|
||||
|
||||
1. Open the Viber application and create a new channel
|
||||
2. After creation, go to channel settings -> For developers, and copy the channel **Token**
|
||||
3. Set up a Webhook to receive updates. See [Set webhook](/docs/Viber/Settings-and-information/Set-webhook)
|
||||
4. **UserID** - your ID or the channel administrator's ID. See [Get channel information](/docs/Viber/Settings-and-information/Get-channel-information)
|
||||
|
||||
- If you need to manage a channel:
|
||||
1. Open the Viber app and create a new channel
|
||||
|
||||

|
||||
|
||||
2. After creation, go to the channel settings -> For developers, and copy the **Token**
|
||||
|
||||

|
||||
|
||||
3. Set webhook (see Set webhook)
|
||||
4. **UserID** - your ID (channel administrator). See Get Channel Information for details
|
||||
|
||||
<br/>
|
||||
|
||||
- If you need a chatbot:
|
||||
1. Go to the link [https://partners.viber.com/account/create-bot-account](https://partners.viber.com/account/create-bot-account) and authorize yourself with your phone number linked to Viber
|
||||
|
||||

|
||||
|
||||
2. Select the option to create a new bot
|
||||
|
||||

|
||||
|
||||
3. In the bot creation menu, fill in all the required fields
|
||||
|
||||

|
||||
|
||||
4. Copy the **Token**
|
||||
|
||||

|
||||
|
||||
4. To find your new bot, you can scan the QR code on the creation page or in the settings (chat bots section) within the Viber app.
|
||||
|
||||

|
||||
|
||||
5. You cannot start a conversation with the bot right now. First, you need to set up a webhook. See Set Webhook
|
||||
6. After launch, the **User ID** will be the ID of the specific person engaging with the bot. You can obtain it from processing incoming messages via Webhook
|
||||
### Chat Bot Management
|
||||
|
||||
1. Go to the [Viber Partner Cabinet](https://partners.viber.com/account/create-bot-account) and log in with your phone number linked to Viber
|
||||
2. Select the option to create a new bot
|
||||
3. Fill in all required fields in the bot creation menu
|
||||
4. Copy the **Token**
|
||||
5. Get information about your bot by scanning the QR code on the creation page or in the settings (bots section) in the Viber application
|
||||
6. Set up a Webhook to receive updates. See [Set webhook](/docs/Viber/Settings-and-information/Set-webhook)
|
||||
|
||||
**Important**: The ID of the same user in chat and channel is different. You cannot use the ID obtained from a message to the bot to invoke channel management methods and vice versa
|
||||
When working with a chat bot, the **UserID** will be the ID of the specific person you're communicating with. This can be obtained when processing incoming messages via Webhook.
|
||||
|
||||
**Important:** The ID of the same user for chat and channel have different values. You cannot use an ID obtained from a bot message to call channel management methods and vice versa.
|
||||
62
docs/en/md/Instructions/YandexDisk.md
vendored
62
docs/en/md/Instructions/YandexDisk.md
vendored
@@ -1,56 +1,44 @@
|
||||
---
|
||||
id: YandexDisk
|
||||
sidebar_class_name: YandexDisk
|
||||
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, YandexDisk, Yandex.Disk, Yandex Disk]
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/YandexDisk.png').default} width='64px' />
|
||||
|
||||
# Yandex Disk
|
||||
|
||||
This section is dedicated to the library for working with Yandex Disk API. On this page, all the steps necessary to start working are described
|
||||
This section covers the library for working with Yandex Disk API in 1С:Enterprise, OneScript, and CLI. This page describes all the steps required to get started.
|
||||
|
||||
## Getting started
|
||||
## Getting Started
|
||||
|
||||
To start working, you need to obtain an access token for the disk:
|
||||
To get started, you need to obtain an access token for the disk:
|
||||
|
||||
1. Go to [app creation page](https://oauth.yandex.ru/client/new/)
|
||||
1. Go to the [application creation page](https://oauth.yandex.ru/client/new/)
|
||||
2. Enter the service name, select *Web Services* as the platform. You can specify any Redirect URI or choose *Insert URL for debugging* - it won't be needed for working with the library.
|
||||
3. In the *Data Access* field, add permissions as shown in the screenshot below, then click *Create Application*
|
||||
4. Save the **ClientID** and **Client secret** from the application page
|
||||
5. Call the `GetConfirmationCode` function, passing ClientID as a parameter. The function will return a Yandex server response containing the following fields:
|
||||
|
||||

|
||||
- **user_code** - will need to be entered in the browser
|
||||
- **device_code** - will need to be passed to another function
|
||||
- **verification_url** - URL that needs to be opened in the browser
|
||||
|
||||
2. Enter the service name, select *Web services* as the platform. You can specify any *Redirect URI* or select the Insert debugging URL option - it will not be needed for working with the library.
|
||||
```json title="Result of the GetConfirmationCode function in JSON format"
|
||||
{
|
||||
"verification_url": "https://ya.ru/device",
|
||||
"user_code": "gjehyruw",
|
||||
"interval": 5,
|
||||
"expires_in": 300,
|
||||
"device_code": "12207cafec1b40ad8d0052af3faf0d12"
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
6. Open the URL from **verification_url** in your browser. Enter the **user_code** from step 5 in the field that appears
|
||||
|
||||
3. In the **Data Access** field, add permissions as shown in the screenshot below, then click **Create Application**
|
||||
7. After entering the code in step 6, call the `ConvertCodeToToken` function, passing the *ClientID* and *ClientSecret* from step 4, as well as the *device_code* from step 5. Save the obtained **access_token** and **refresh_token**
|
||||
|
||||

|
||||
|
||||
4. Save **ClientID** and **ClientSecret** from the application page
|
||||
|
||||

|
||||
|
||||
5. Call the function *OPI_YandexID.GetConfirmationCode()*, passing ClientID as a parameter. It will return a response from the Yandex server, which will contain the fields:
|
||||
- **user_code** - you will need to enter in the browser
|
||||
- **device_code** - you will need to pass to another function
|
||||
- **verification_url** - the URL that needs to be opened in the browser
|
||||
<br/>
|
||||
```json title="The result of the function GetConfirmationCode(), if convert it to JSON"
|
||||
{
|
||||
"verification_url": "https://ya.ru/device",
|
||||
"user_code": "gjehyruw",
|
||||
"interval": 5,
|
||||
"expires_in": 300,
|
||||
"device_code": "12207cafec1b40ad8d0052af3faf0d12"
|
||||
}
|
||||
```
|
||||
|
||||
6. Open the URL from **verification_url** in the browser. Most likely, it will be https://ya.ru/device. In the field that appears, enter the **user_code** from step 5
|
||||
|
||||

|
||||
|
||||
7. After entering the code in step 6, call the function *OPI_YandexID.ConvertCodeToToken()*, passing **ClientID** and **ClientSecret** from step 4, as well as **device_code** from step 5. Save the obtained **access_token** and **refresh_token**
|
||||
|
||||
```json title="The result of the function ConvertCodeToToken(), if convert it to JSON"
|
||||
```json title="Result of the ConvertCodeToToken function in JSON format"
|
||||
{
|
||||
"token_type": "bearer",
|
||||
"refresh_token": "1:Tj6nD2vgE2L8jwSm:YgWjQXPv6_y3e07GW70ig2AOyEXoRVsKKpApGHq2EOg7pfx0MKrXiCrfLBFtzgQawdawdwadad3Sasa9z2H0vSeZKNmZmA",
|
||||
@@ -59,4 +47,4 @@ To start working, you need to obtain an access token for the disk:
|
||||
}
|
||||
```
|
||||
|
||||
**access_token** is used in all other functions of the library, and with the help of **refresh_token**, it can be refreshed when its lifespan is nearing the end (using the function *RefreshToken()*)
|
||||
**access_token** is used for authorization in all other library functions. **refresh_token** must be passed to the `RefreshToken` function to obtain a new access_token when the previous one's lifetime is about to expire.
|
||||
10
docs/ru/md/Instructions/Airtable.md
vendored
10
docs/ru/md/Instructions/Airtable.md
vendored
@@ -12,14 +12,8 @@ keywords: [1C, 1С, 1С:Предприятие, 1С:Предприятие 8.3,
|
||||
|
||||
## Начало работы
|
||||
|
||||
1. Авторизуйтесь в Airtable и перейдите **[на страницу создания персональных токенов](https://airtable.com/create/tokens)**, нажмите **Create new token**
|
||||
|
||||

|
||||
|
||||
1. Авторизуйтесь в Airtable и перейдите [на страницу создания персональных токенов](https://airtable.com/create/tokens), нажмите *Create new token*
|
||||
2. Введите название для нового токена, выберите из перечня необходимые **Scopes** (разрешения) и **Access** (базы и рабочие пространства, к которым у токена будет доступ)
|
||||
|
||||

|
||||
|
||||
3. Скопируйте новый **токен**
|
||||
|
||||

|
||||
Далее полученный токен необходимо использовать при вызове функций библиотеки
|
||||
|
||||
66
docs/ru/md/Instructions/Bitrix24.md
vendored
66
docs/ru/md/Instructions/Bitrix24.md
vendored
@@ -10,54 +10,30 @@ keywords: [1C, 1С, 1С:Предприятие, 1С:Предприятие 8.3,
|
||||
|
||||
Этот раздел посвящен библиотеке для работы с Bitrix24 API в 1С:Предприятие, OneScript и CLI. На данной странице описаны все действия, необходимые для полноценного начала работы
|
||||
|
||||
## Начало работы
|
||||
### Начало работы
|
||||
|
||||
Работать с Bitrix24 через API можно двумя способами: через **Webhook** и через **локальное приложение**. Для обоих вариантов необходимо:
|
||||
Для начала работы с Bitrix24 через API необходимо получить данные для авторизации. Сделать это можно одним из двух способов: через создание **Webhook** или через создание **локального приложения**. Оба эти способа описаны ниже
|
||||
|
||||
1. Перейти в подраздел **Разработчикам** в разделе **Приложения** боковой панели
|
||||
|
||||

|
||||
|
||||
2. Выбрать пункт **Другое**
|
||||
|
||||

|
||||
|
||||
<hr/><br/>
|
||||
|
||||
### Для работы через Webhook
|
||||
|
||||
1. Выберите пункт **Входящий вебхук**
|
||||
|
||||

|
||||
|
||||
2. Заполните необходимые разрешения в **Настройках прав** и сохраните URL вебхука. Он будет использоваться для выполнения методов библиотеки как параметр **URL**. Необязательный параметр **Токен** в данном случае будет всегда оставаться пустым
|
||||
|
||||

|
||||
|
||||
<hr/><br/>
|
||||
|
||||
## Для работы через Локальное приложение
|
||||
|
||||
1. Выберите пункт **Локальное приложение**
|
||||
|
||||

|
||||
|
||||
2. Выберите путь обработчика (если приложение не подразумевает авторизацию других пользователей, но только управление Bitrix через один аккаунт администратора, то можно выбрать любой адрес, например https://localhost), поставьте галочку **Использует только API** (если необходим только функционал вызова методов библиотеки) и заполните необходимые права
|
||||
|
||||

|
||||
|
||||
3. Сохраните **ключ** и **код** приложения
|
||||
|
||||

|
||||
|
||||
4. При помощи ключа приложения вызовите функцию **ПолучитьСсылкуАвторизацииПриложения** и перейдите по полученной ссылке в браузере. После авторизации, скопируйте полученный код из адресной строки (или получите его на обработчик, адрес которого был указан в пункте 2)
|
||||
|
||||

|
||||
|
||||
5. Передайте полученный код, вместе с ключом и секретом приложения, в функцию **ПолучитьТокен**. Сохраните полученные **access** и **refresh токены**
|
||||
|
||||
6. Время жизни токенов ограничено. Для получение нового токена можно воспользоваться функцией **ОбновитьТокен**, передав туда refresh токен, ключ и секрет приложения. При обновлении создается не только новый access токен, но и refresh токен тоже
|
||||
### Работа через Webhook
|
||||
|
||||
1. Перейти в подраздел *Разработчикам* в разделе *Приложения* боковой панели
|
||||
2. Выбрать пункт *Другое*
|
||||
3. Выберите пункт *Входящий вебхук*
|
||||
4. Заполните необходимые разрешения в *Настройках прав* и сохраните URL вебхука. Он будет использоваться для выполнения методов библиотеки как параметр **URL**. Необязательный параметр **Токен** в данном случае будет всегда оставаться пустым
|
||||
|
||||
### Работа через локальное приложение
|
||||
|
||||
1. Перейти в подраздел *Разработчикам* в разделе *Приложения* боковой панели Bitrix24
|
||||
2. Выбрать пункт *Другое*
|
||||
3. Выберите пункт *Локальное приложение*
|
||||
4. Выберите URL обработчика. Если приложение не подразумевает авторизацию других пользователей, а только управление Bitrix через один аккаунт администратора, то можно выбрать любой адрес, например https://localhost.
|
||||
5. Поставьте галочку **Использует только API** (если необходим только функционал вызова методов библиотеки) и заполните необходимые права
|
||||
6. Сохраните **ключ** и **код** приложения
|
||||
7. Передайте ключ приложения в функцию `ПолучитьСсылкуАвторизацииПриложения` и перейдите по полученной ссылке в браузере
|
||||
8. Авторизуйтесь и скопируйте полученный код из адресной строки или получите его на обработчик, адрес которого был указан в пункте 4
|
||||
9. Передайте полученный код, вместе с ключом и секретом приложения, в функцию `ПолучитьТокен`
|
||||
10. Сохраните полученные **access** и **refresh токены**
|
||||
|
||||
:::important
|
||||
Время жизни токенов ограничено. Для получение нового токена можно воспользоваться функцией **ОбновитьТокен**, передав туда refresh токен, ключ и секрет приложения. При обновлении создается не только новый access, но и refresh токен - его необходимо сохранить заново
|
||||
:::
|
||||
|
||||
8
docs/ru/md/Instructions/CDEK.md
vendored
8
docs/ru/md/Instructions/CDEK.md
vendored
@@ -13,10 +13,6 @@ keywords: [1C, 1С, 1С:Предприятие, 1С:Предприятие 8.3,
|
||||
## Начало работы
|
||||
|
||||
1. Оформите договор со СДЭК или используйте тестовые учетные данные для начала работы. Подробнее [на странице документации](https://api-docs.cdek.ru/29923849.html)
|
||||
2. Используйте полученные **Account** и **Secure password** для создания Токена при помощи метода `ПолучитьТокен`
|
||||
|
||||

|
||||
|
||||
2. Используйте полученные **Account** и **Secure password** для создания Токена при помощи метода *ПолучитьТокен()*
|
||||
|
||||
|
||||
**Токен** существует ограниченное время, в течении которого может быть использован в вызовах других методов библиотеки. После истечения срока его существовании, получить новый можно снова передав Account и Secure password в метод *ПолучитьТокен()*
|
||||
**Токен** существует ограниченное время, в течении которого может быть использован в вызовах других методов библиотеки. После истечения срока его существовании, получить новый можно снова передав Account и Secure password в метод `ПолучитьТокен`
|
||||
33
docs/ru/md/Instructions/Dropbox.md
vendored
33
docs/ru/md/Instructions/Dropbox.md
vendored
@@ -13,29 +13,12 @@ keywords: [1C, 1С, 1С:Предприятие, 1С:Предприятие 8.3,
|
||||
## Начало работы
|
||||
|
||||
1. Войдите в свой аккаунт на сайте [Dropbox Developers](https://www.dropbox.com/developers)
|
||||
2. Перейдите к *App Console*
|
||||
3. Нажмите *Create app*
|
||||
4. Введите имя нового приложения и выберите *Full Dropbox*
|
||||
5. После создания, на странице приложения нажмите *Scoped app* и выберите разрешения, которые необходимы для решения ваших задач. Сохраните **AppKey** и **AppSecret**
|
||||
6. Получите ссылку авторизации при помощи функции `ПолучитьСсылкуАвторизации` и перейдите по ней в браузере
|
||||
7. Передайте полученный код, AppKey и AppSecret в функцию `ПолучитьТокен`
|
||||
8. Сохраните полученные **access_token** и **refresh_token**
|
||||
|
||||

|
||||
|
||||
1. Перейдите к **App Console**
|
||||
|
||||

|
||||
|
||||
2. Нажмите **Create app**
|
||||
|
||||

|
||||
|
||||
4. Введите имя нового приложения и выберите **Full Dropbox**
|
||||
|
||||

|
||||
|
||||
5. После создания, на странице приложения нажмите **Scoped app** и выберите разрешения, которые необходимы для решения ваших задач. Сохраните **AppKey** и **AppSecret**
|
||||
|
||||

|
||||
|
||||
6. Получите ссылку авторизации при помощи функции *ПолучитьСсылкуАвторизации(Знач КлючПриложения)* и перейдите по ней в браузере
|
||||
|
||||

|
||||
|
||||
7. Передайте **полученный код**, **AppKey** и **AppSecret** в функцию *ПолучитьТокен(Знач КлючПриложения, Знач СекретПриложения, Знач Код)*, сохраните полученные **access_token** и **refresh_token**
|
||||
|
||||
8. По истечении времени жизни access_token, его можно обновить при помощи функции *ОбновитьТокен(Знач КлючПриложения, Знач СекретПриложения, Знач РефрешТокен)*
|
||||
Времени жизни access_token ограниченно. По истечении этого времени его можно обновить при помощи функции `ОбновитьТокен`
|
||||
114
docs/ru/md/Instructions/GoogleCalendar.md
vendored
114
docs/ru/md/Instructions/GoogleCalendar.md
vendored
@@ -8,87 +8,50 @@ keywords: [1C, 1С, 1С:Предприятие, 1С:Предприятие 8.3,
|
||||
|
||||
# Google Календарь
|
||||
|
||||
Этот раздел посвящен библиотеке для работы с API Google Calendar в 1С:Предприятие, OneScript и CLI. На данной странице описаны все действия, необходимые для полноценного начала работы
|
||||
### Начало работы
|
||||
|
||||
Для начала работы необходимо создать аккаунт и новый проект на [главной странице консоли Google Cloud](https://console.cloud.google.com/), после чего подключить сервис Calendar на [его странице в Marketplace](https://console.cloud.google.com/marketplace/product/google/calendar-json.googleapis.com)
|
||||
|
||||
Далее необходимо получить токен доступа для авторизации при вызове функций библиотеки. Сделать это можно одним из двух способов:
|
||||
|
||||
### Авторизация через Service Account
|
||||
|
||||
Получить токен доступа можно при помощи секретного ключа Service Account. Для этого необходимо:
|
||||
|
||||
1. Выбрать проект и в боковом меню перейти в раздел *IAM & Admin -> Service Accounts*
|
||||
2. Нажать *Create service account* и заполнить необходимые поля для создания нового аккаунта
|
||||
3. В списке аккаунтов найти созданный и нажать *Actions* (три точки) в правой части записи
|
||||
4. Выбрать пункт *Manage keys*
|
||||
5. Нажать *Add key -> Create new key*
|
||||
6. Выбрать *JSON* и скачать данные полученного ключа
|
||||
|
||||
Далее полученный JSON файл необходимо передать (как коллекцию, путь к файлу или двоичные данные) в функцию `ПолучитьТокенServiceАккаунта`. Также при вызове этой функции можно указать доступы и время жизни полученного токена. По истечении времени жизни, новый токен может быть получен повторным вызовом функции `ПолучитьТокенServiceАккаунта`
|
||||
|
||||
### OAuth авторизация
|
||||
|
||||
OAuth авторизация позволяет получать временный обновляемый токен доступа для конкретного пользователя Google через страницу авторизации. Для активации OAuth авторизации в проекте необходимо выполнить следуюшие действия:
|
||||
|
||||
1. Выберите проект и в боковом меню перейдите в раздел *APIs and Services -> OAuth consent screen*
|
||||
2. Выберите пункт *External*
|
||||
3. Заполните необходимую информацию в предложенных полях
|
||||
4. Нажмите *Save and continue* по окончанию процесса настройки
|
||||
5. Нажмите *Publish App*
|
||||
6. В боковом меню выберите пункт *Credentials -> Create Credentials -> OAuth client ID*
|
||||
7. Введите имя и выберите *Application type - Desktop app*
|
||||
8. Сохраните **ClientID** и **Client Secret**
|
||||
|
||||
После получения клиентского ID, необходимо получить URL для авторизации. Сделать это можно передав ClientID в функцию `СформироватьСсылкуПолученияКода`. Полученную в результате выполнения функцию ссылку необходимо открыть в барузере, авторизоваться со своим аккаунтом Google, после чего быстро передать код доступа из URL (текст в адресной строке после `code=`) в функцию `ПолучитьТокенПоКоду`
|
||||
|
||||
|
||||
:::important
|
||||
Если вы уже используете ОПИ для работы с другими сервисами Google Workspaсe и выполняли стартовую настройку, то пункты **Создание проекта** и **Настройка OAuth** можно пропустить. Необходимо лишь **включить сервис Google Drive** в своем проекте и **заново получить токен** (последние два пункта инструкции).
|
||||
**Время жизни кода крайне мало.** После перехода по ссылке из функции `СформироватьСсылкуПолученияКода` и авторизации со своим аккаунтом Google, необходимо максимально быстро передать его в функцию `ПолучитьТокенПоКоду`. Лучше всего заранее подготовить обработку с полем для ввода и кнопкой (в 1С), либо же использовать CLI версию ОПИ. В случае истечения срока жизни кода до выполнения функции `ПолучитьТокенПоКоду`, будет получена ошибка `invalid_grant`
|
||||
:::
|
||||
|
||||
## Начало работы
|
||||
В результате функции будет структура, содержащая `access_token` и `refresh_token`: первый служит для использования при вызове остальных функций библиотеки, а второй - для получения нового `access_token` по истечению срока его действия (при помощи функции `ОбновитьТокен`)
|
||||
|
||||
<hr/>
|
||||
`refresh_token` не изменяется при получении нового `access_token` и может быть использован многократно
|
||||
|
||||
### Создание проекта
|
||||
|
||||
1. Перейдите на [главную страницу Google Cloud](https://console.cloud.google.com) и создайте проект
|
||||
|
||||

|
||||
|
||||
2. Выберите созданный проект и в боковом меню перейдите APIs and Services -> OAuth consent screen
|
||||
|
||||

|
||||
|
||||
3. Выберите пункт External
|
||||
|
||||

|
||||
|
||||
4. Заполните поля App name, User support email и Email addresses (все поля со звездочками)
|
||||
|
||||

|
||||
|
||||
5. Нажимайте далее и Save and continue на последней вкладке
|
||||
|
||||

|
||||
|
||||
6. Нажмите Publish App
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Настройка OAuth
|
||||
|
||||
1. В боковом меню выберите пункт Credentials -> Create Credentials -> OAuth client ID
|
||||
|
||||

|
||||
|
||||
2. Введите имя и выберите Application type - Desktop app
|
||||
|
||||

|
||||
|
||||
3. Сохраните ClientID и Client Secret
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Включение сервиса Google Calendar
|
||||
|
||||
1. Перейдите на [страницу Календаря в Marketplace](https://console.cloud.google.com/marketplace/product/google/calendar-json.googleapis.com)
|
||||
|
||||
2. Нажмите Enable
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Получение Токена
|
||||
|
||||
1. Передайте ClientID в функцию OPI_GoogleWorkspace.СформироватьСсылкуПолученияКода() с булево параметрами используемых вами сервисов. Результатом функции будет URL, который необходимо открыть в браузере. Авторизуйтесь при помощи своего аккаунта Google
|
||||
|
||||

|
||||
|
||||
2. Скопируйте код из URL после авторизации
|
||||
|
||||

|
||||
|
||||
:::important
|
||||
**Время жизни кода крайне мало.** После его получения нужно выполнить шаг 3 максимально быстро. Лучше всего заранее подготовить обработку с полем для ввода и кнопкой (в 1С), либо же использовать CLI версию ОПИ. В случае истечения срока жизни кода до выполнения пункта 3, будет получена ошибка `invalid_grant`
|
||||
:::
|
||||
|
||||
3. Используйте полученный код, ClientID и Client Secret для вызова функции OPI_GoogleWorkspace.ПолучитьТокенПоКоду(ClientID, ClientSecret, Code)
|
||||
|
||||
```json title="Результат функции ПолучитьТокенПоКоду(), если перевести его в JSON"
|
||||
```json title="Результат функции ПолучитьТокенПоКоду в виде JSON"
|
||||
|
||||
{
|
||||
"token_type": "Bearer",
|
||||
@@ -100,4 +63,3 @@ keywords: [1C, 1С, 1С:Предприятие, 1С:Предприятие 8.3,
|
||||
|
||||
```
|
||||
|
||||
4. Используйте **access_token** для передачи в качестве параметра Токен при вызове функций библиотеки, а refresh_token - для получения нового access_token (функция OPI_GoogleWorkspace.ОбновитьТокен(ClientID, ClientSecret, RefreshToken)), когда время жизни старого истечет. При обновлении токена refresh_token не обновляется - вы можете использовать его один и тот же для получения нового access_token каждый раз.
|
||||
|
||||
94
docs/ru/md/Instructions/GoogleDrive.md
vendored
94
docs/ru/md/Instructions/GoogleDrive.md
vendored
@@ -10,94 +10,58 @@ keywords: [1C, 1С, 1С:Предприятие, 1С:Предприятие 8.3,
|
||||
|
||||
Этот раздел посвящен библиотеке для работы с API Google Drive в 1С:Предприятие, OneScript и CLI. На данной странице описаны все действия, необходимые для полноценного начала работы
|
||||
|
||||
:::important
|
||||
Если вы уже используете ОПИ для работы с другими сервисами Google Workspaсe и выполняли стартовую настройку, то пункты **Создание проекта** и **Настройка OAuth** можно пропустить. Необходимо лишь **включить сервис Google Drive** в своем проекте и **заново получить токен** (последние два пункта инструкции).
|
||||
:::
|
||||
### Начало работы
|
||||
|
||||
## Начало работы
|
||||
Для начала работы необходимо создать аккаунт и новый проект на [главной странице консоли Google Cloud](https://console.cloud.google.com/), после чего подключить сервис Drive на [его странице в Marketplace](https://console.cloud.google.com/marketplace/product/google/drive.googleapis.com)
|
||||
|
||||
<hr/>
|
||||
Далее необходимо получить токен доступа для авторизации при вызове функций библиотеки. Сделать это можно одним из двух способов:
|
||||
|
||||
### Создание проекта
|
||||
### Авторизация через Service Account
|
||||
|
||||
1. Перейдите на [главную страницу Google Cloud](https://console.cloud.google.com) и создайте проект
|
||||
Получить токен доступа можно при помощи секретного ключа Service Account. Для этого необходимо:
|
||||
|
||||

|
||||
1. Выбрать проект и в боковом меню перейти в раздел *IAM & Admin -> Service Accounts*
|
||||
2. Нажать *Create service account* и заполнить необходимые поля для создания нового аккаунта
|
||||
3. В списке аккаунтов найти созданный и нажать *Actions* (три точки) в правой части записи
|
||||
4. Выбрать пункт *Manage keys*
|
||||
5. Нажать *Add key -> Create new key*
|
||||
6. Выбрать *JSON* и скачать данные полученного ключа
|
||||
|
||||
2. Выберите созданный проект и в боковом меню перейдите APIs and Services -> OAuth consent screen
|
||||
Далее полученный JSON файл необходимо передать (как коллекцию, путь к файлу или двоичные данные) в функцию `ПолучитьТокенServiceАккаунта`. Также при вызове этой функции можно указать доступы и время жизни полученного токена. По истечении времени жизни, новый токен может быть получен повторным вызовом функции `ПолучитьТокенServiceАккаунта`
|
||||
|
||||

|
||||
### OAuth авторизация
|
||||
|
||||
3. Выберите пункт External
|
||||
OAuth авторизация позволяет получать временный обновляемый токен доступа для конкретного пользователя Google через страницу авторизации. Для активации OAuth авторизации в проекте необходимо выполнить следуюшие действия:
|
||||
|
||||

|
||||
1. Выберите проект и в боковом меню перейдите в раздел *APIs and Services -> OAuth consent screen*
|
||||
2. Выберите пункт *External*
|
||||
3. Заполните необходимую информацию в предложенных полях
|
||||
4. Нажмите *Save and continue* по окончанию процесса настройки
|
||||
5. Нажмите *Publish App*
|
||||
6. В боковом меню выберите пункт *Credentials -> Create Credentials -> OAuth client ID*
|
||||
7. Введите имя и выберите *Application type - Desktop app*
|
||||
8. Сохраните **ClientID** и **Client Secret**
|
||||
|
||||
4. Заполните поля App name, User support email и Email addresses (все поля со звездочками)
|
||||
После получения клиентского ID, необходимо получить URL для авторизации. Сделать это можно передав ClientID в функцию `СформироватьСсылкуПолученияКода`. Полученную в результате выполнения функцию ссылку необходимо открыть в барузере, авторизоваться со своим аккаунтом Google, после чего быстро передать код доступа из URL (текст в адресной строке после `code=`) в функцию `ПолучитьТокенПоКоду`
|
||||
|
||||

|
||||
|
||||
5. Нажимайте далее и Save and continue на последней вкладке
|
||||
|
||||

|
||||
|
||||
6. Нажмите Publish App
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Настройка OAuth
|
||||
|
||||
1. В боковом меню выберите пункт Credentials -> Create Credentials -> OAuth client ID
|
||||
|
||||

|
||||
|
||||
2. Введите имя и выберите Application type - Desktop app
|
||||
|
||||

|
||||
|
||||
3. Сохраните ClientID и Client Secret
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Включение сервиса Google Drive
|
||||
|
||||
1. Перейдите на [страницу Drive в Marketplace](https://console.cloud.google.com/marketplace/product/google/drive.googleapis.com)
|
||||
|
||||
2. Нажмите Enable
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Получение Токена
|
||||
|
||||
1. Передайте ClientID в функцию OPI_GoogleWorkspace.СформироватьСсылкуПолученияКода() с булево параметрами используемых вами сервисов. Результатом функции будет URL, который необходимо открыть в браузере. Авторизуйтесь при помощи своего аккаунта Google
|
||||
|
||||

|
||||
|
||||
2. Скопируйте код из URL после авторизации
|
||||
|
||||

|
||||
|
||||
:::important
|
||||
**Время жизни кода крайне мало.** После его получения нужно выполнить шаг 3 максимально быстро. Лучше всего заранее подготовить обработку с полем для ввода и кнопкой (в 1С), либо же использовать CLI версию ОПИ. В случае истечения срока жизни кода до выполнения пункта 3, будет получена ошибка `invalid_grant`
|
||||
**Время жизни кода крайне мало.** После перехода по ссылке из функции `СформироватьСсылкуПолученияКода` и авторизации со своим аккаунтом Google, необходимо максимально быстро передать его в функцию `ПолучитьТокенПоКоду`. Лучше всего заранее подготовить обработку с полем для ввода и кнопкой (в 1С), либо же использовать CLI версию ОПИ. В случае истечения срока жизни кода до выполнения функции `ПолучитьТокенПоКоду`, будет получена ошибка `invalid_grant`
|
||||
:::
|
||||
|
||||
3. Используйте полученный код, ClientID и Client Secret для вызова функции OPI_GoogleWorkspace.ПолучитьТокенПоКоду(ClientID, ClientSecret, Code)
|
||||
В результате функции будет структура, содержащая `access_token` и `refresh_token`: первый служит для использования при вызове остальных функций библиотеки, а второй - для получения нового `access_token` по истечению срока его действия (при помощи функции `ОбновитьТокен`)
|
||||
|
||||
```json title="Результат функции ПолучитьТокенПоКоду(), если перевести его в JSON"
|
||||
`refresh_token` не изменяется при получении нового `access_token` и может быть использован многократно
|
||||
|
||||
```json title="Результат функции ПолучитьТокенПоКоду в виде JSON"
|
||||
|
||||
{
|
||||
"token_type": "Bearer",
|
||||
"refresh_token": "1//09au6OES3JN9oCgYIARAAGAkSNwF-L9Ir1B7uawfwafT1wE0FKO519Xj6JxawfawfyjMyJ_QlUZYLHZqw",
|
||||
"scope": "https://www.googleapis.com/auth/...",
|
||||
"scope": "https://www.googleapis.com/auth/drive",
|
||||
"expires_in": 3599,
|
||||
"access_token": "ya29.a0AfB_byA344tXkIawdawdwadadhyZQV8bSZn_snNXtY2HLb7l71awdawdawdad-ASgpzyOSWIvEmPruhUa_1yCCq6jvoD0r_q-fNEsARrH8zpJ3c6LNGWvwdg8CXsSxYaCgYKAWkSawfwafawfrCK0EP5kZY_A0171"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
4. Используйте **access_token** для передачи в качестве параметра Токен при вызове функций библиотеки, а refresh_token - для получения нового access_token (функция OPI_GoogleWorkspace.ОбновитьТокен(ClientID, ClientSecret, RefreshToken)), когда время жизни старого истечет. При обновлении токена refresh_token не обновляется - вы можете использовать его один и тот же для получения нового access_token каждый раз.
|
||||
|
||||
90
docs/ru/md/Instructions/GoogleSheets.md
vendored
90
docs/ru/md/Instructions/GoogleSheets.md
vendored
@@ -14,90 +14,58 @@ keywords: [1C, 1С, 1С:Предприятие, 1С:Предприятие 8.3,
|
||||
Если вы уже используете ОПИ для работы с другими сервисами Google Workspaсe и выполняли стартовую настройку, то пункты **Создание проекта** и **Настройка OAuth** можно пропустить. Необходимо лишь **включить сервис Google Sheets** в своем проекте и **заново получить токен** (последние два пункта инструкции).
|
||||
:::
|
||||
|
||||
## Начало работы
|
||||
### Начало работы
|
||||
|
||||
<hr/>
|
||||
Для начала работы необходимо создать аккаунт и новый проект на [главной странице консоли Google Cloud](https://console.cloud.google.com/), после чего подключить сервис Sheets на [его странице в Marketplace](https://console.cloud.google.com/marketplace/product/google/sheets.googleapis.com)
|
||||
|
||||
### Создание проекта
|
||||
Далее необходимо получить токен доступа для авторизации при вызове функций библиотеки. Сделать это можно одним из двух способов:
|
||||
|
||||
1. Перейдите на [главную страницу Google Cloud](https://console.cloud.google.com) и создайте проект
|
||||
### Авторизация через Service Account
|
||||
|
||||

|
||||
Получить токен доступа можно при помощи секретного ключа Service Account. Для этого необходимо:
|
||||
|
||||
2. Выберите созданный проект и в боковом меню перейдите APIs and Services -> OAuth consent screen
|
||||
1. Выбрать проект и в боковом меню перейти в раздел *IAM & Admin -> Service Accounts*
|
||||
2. Нажать *Create service account* и заполнить необходимые поля для создания нового аккаунта
|
||||
3. В списке аккаунтов найти созданный и нажать *Actions* (три точки) в правой части записи
|
||||
4. Выбрать пункт *Manage keys*
|
||||
5. Нажать *Add key -> Create new key*
|
||||
6. Выбрать *JSON* и скачать данные полученного ключа
|
||||
|
||||

|
||||
Далее полученный JSON файл необходимо передать (как коллекцию, путь к файлу или двоичные данные) в функцию `ПолучитьТокенServiceАккаунта`. Также при вызове этой функции можно указать доступы и время жизни полученного токена. По истечении времени жизни, новый токен может быть получен повторным вызовом функции `ПолучитьТокенServiceАккаунта`
|
||||
|
||||
3. Выберите пункт External
|
||||
### OAuth авторизация
|
||||
|
||||

|
||||
OAuth авторизация позволяет получать временный обновляемый токен доступа для конкретного пользователя Google через страницу авторизации. Для активации OAuth авторизации в проекте необходимо выполнить следуюшие действия:
|
||||
|
||||
4. Заполните поля App name, User support email и Email addresses (все поля со звездочками)
|
||||
1. Выберите проект и в боковом меню перейдите в раздел *APIs and Services -> OAuth consent screen*
|
||||
2. Выберите пункт *External*
|
||||
3. Заполните необходимую информацию в предложенных полях
|
||||
4. Нажмите *Save and continue* по окончанию процесса настройки
|
||||
5. Нажмите *Publish App*
|
||||
6. В боковом меню выберите пункт *Credentials -> Create Credentials -> OAuth client ID*
|
||||
7. Введите имя и выберите *Application type - Desktop app*
|
||||
8. Сохраните **ClientID** и **Client Secret**
|
||||
|
||||

|
||||
После получения клиентского ID, необходимо получить URL для авторизации. Сделать это можно передав ClientID в функцию `СформироватьСсылкуПолученияКода`. Полученную в результате выполнения функцию ссылку необходимо открыть в барузере, авторизоваться со своим аккаунтом Google, после чего быстро передать код доступа из URL (текст в адресной строке после `code=`) в функцию `ПолучитьТокенПоКоду`
|
||||
|
||||
5. Нажимайте далее и Save and continue на последней вкладке
|
||||
|
||||

|
||||
|
||||
6. Нажмите Publish App
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Настройка OAuth
|
||||
|
||||
1. В боковом меню выберите пункт Credentials -> Create Credentials -> OAuth client ID
|
||||
|
||||

|
||||
|
||||
2. Введите имя и выберите Application type - Desktop app
|
||||
|
||||

|
||||
|
||||
3. Сохраните ClientID и Client Secret
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Включение сервиса Google Sheets
|
||||
|
||||
1. Перейдите на [страницу Sheets в Marketplace](https://console.cloud.google.com/marketplace/product/google/sheets.googleapis.com)
|
||||
|
||||
2. Нажмите Enable
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Получение Токена
|
||||
|
||||
1. Передайте ClientID в функцию OPI_GoogleWorkspace.СформироватьСсылкуПолученияКода() с булево параметрами используемых вами сервисов. Результатом функции будет URL, который необходимо открыть в браузере. Авторизуйтесь при помощи своего аккаунта Google
|
||||
|
||||

|
||||
|
||||
2. Скопируйте код из URL после авторизации
|
||||
|
||||

|
||||
|
||||
:::important
|
||||
**Время жизни кода крайне мало.** После его получения нужно выполнить шаг 3 максимально быстро. Лучше всего заранее подготовить обработку с полем для ввода и кнопкой (в 1С), либо же использовать CLI версию ОПИ. В случае истечения срока жизни кода до выполнения пункта 3, будет получена ошибка `invalid_grant`
|
||||
**Время жизни кода крайне мало.** После перехода по ссылке из функции `СформироватьСсылкуПолученияКода` и авторизации со своим аккаунтом Google, необходимо максимально быстро передать его в функцию `ПолучитьТокенПоКоду`. Лучше всего заранее подготовить обработку с полем для ввода и кнопкой (в 1С), либо же использовать CLI версию ОПИ. В случае истечения срока жизни кода до выполнения функции `ПолучитьТокенПоКоду`, будет получена ошибка `invalid_grant`
|
||||
:::
|
||||
|
||||
3. Используйте полученный код, ClientID и Client Secret для вызова функции OPI_GoogleWorkspace.ПолучитьТокенПоКоду(ClientID, ClientSecret, Code)
|
||||
В результате функции будет структура, содержащая `access_token` и `refresh_token`: первый служит для использования при вызове остальных функций библиотеки, а второй - для получения нового `access_token` по истечению срока его действия (при помощи функции `ОбновитьТокен`)
|
||||
|
||||
```json title="Результат функции ПолучитьТокенПоКоду(), если перевести его в JSON"
|
||||
`refresh_token` не изменяется при получении нового `access_token` и может быть использован многократно
|
||||
|
||||
```json title="Результат функции ПолучитьТокенПоКоду в виде JSON"
|
||||
|
||||
{
|
||||
"token_type": "Bearer",
|
||||
"refresh_token": "1//09au6OES3JN9oCgYIARAAGAkSNwF-L9Ir1B7uawfwafT1wE0FKO519Xj6JxawfawfyjMyJ_QlUZYLHZqw",
|
||||
"scope": "https://www.googleapis.com/auth/...",
|
||||
"scope": "https://www.googleapis.com/auth/sheets",
|
||||
"expires_in": 3599,
|
||||
"access_token": "ya29.a0AfB_byA344tXkIawdawdwadadhyZQV8bSZn_snNXtY2HLb7l71awdawdawdad-ASgpzyOSWIvEmPruhUa_1yCCq6jvoD0r_q-fNEsARrH8zpJ3c6LNGWvwdg8CXsSxYaCgYKAWkSawfwafawfrCK0EP5kZY_A0171"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
4. Используйте **access_token** для передачи в качестве параметра Токен при вызове функций библиотеки, а refresh_token - для получения нового access_token (функция OPI_GoogleWorkspace.ОбновитьТокен(ClientID, ClientSecret, RefreshToken)), когда время жизни старого истечет. При обновлении токена refresh_token не обновляется - вы можете использовать его один и тот же для получения нового access_token каждый раз.
|
||||
|
||||
10
docs/ru/md/Instructions/Neocities.md
vendored
10
docs/ru/md/Instructions/Neocities.md
vendored
@@ -13,15 +13,7 @@ keywords: [1C, 1С, 1С:Предприятие, 1С:Предприятие 8.3,
|
||||
## Начало работы
|
||||
|
||||
1. Авторизуйтесь на портале [Neocities](https://neocities.org) и перейдите в настройки
|
||||
|
||||

|
||||
|
||||
2. Выберите необходимый сайт из списка и нажмите **Manage Site Settings**
|
||||
|
||||

|
||||
|
||||
3. Перейдите на вкладку **API**, сгенерируйте и сохраните **API KEY**
|
||||
|
||||

|
||||
|
||||
API Key используется в каждом методе работы с API в качестве параметра Токен. Также вы можете сгенерировать токен на основе своего логина и пароля методом *ПолучитьТокен*
|
||||
API Key используется в каждом методе работы с API в качестве параметра Токен. Также вы можете сгенерировать токен на основе своего логина и пароля при помощи функции `ПолучитьТокен`
|
||||
|
||||
27
docs/ru/md/Instructions/Notion.md
vendored
27
docs/ru/md/Instructions/Notion.md
vendored
@@ -12,28 +12,11 @@ keywords: [1C, 1С, 1С:Предприятие, 1С:Предприятие 8.3,
|
||||
|
||||
## Начало работы
|
||||
|
||||
1. Перейдите **[в раздел интеграций портала для разработчиков](https://www.notion.so/my-integrations)**
|
||||
|
||||

|
||||
|
||||
1. Авторизуйтесь и перейдите [в раздел интеграций портала для разработчиков](https://www.notion.so/my-integrations)
|
||||
2. Введите название вашей интеграции
|
||||
|
||||

|
||||
|
||||
3. После завершения создания интеграции, нажмите *Show* и скопируйте **Токен (Secret)**
|
||||
|
||||

|
||||
4. Перейдите в *[основной интерфейс Notion](https://notion.so)* и создайте новую страницу. Эта страница будет родительской для всех остальных объектов, создаваемых через API
|
||||
5. Нажмите три точки в правом верхнем углу и в самом низу найдите пункт *Add connections*. Выберите там свою интеграцию из пункта 3
|
||||
6. Получите ID страницы. Это можно сделать нажав *Share -> Copy link* или просто скопировав из URL
|
||||
|
||||
4. Перейдите в **[основной интерфейс Notion](https://notion.so)** и создайте новую страницу. Эта страница будет родительской для всех остальных объектов, создаваемых через API
|
||||
|
||||

|
||||
|
||||
5. Нажмите три точки в правом верхнем углу и в самом низу найдите пункт *Add connections*. Выберите там свою интеграцию из пунктов 1-3
|
||||
|
||||

|
||||
|
||||
6. Получите ID этой страницы. Это можно сделать нажав Share -> Copy link или просто скопировав из URL
|
||||
|
||||

|
||||
|
||||
**Токен** и **ID страницы** - два параметра, необходимые для работы через API
|
||||
**Токен** и **ID страницы** - два параметра, необходимые для использования остальных функций библиотеки
|
||||
6
docs/ru/md/Instructions/Ollama.md
vendored
6
docs/ru/md/Instructions/Ollama.md
vendored
@@ -14,13 +14,7 @@ keywords: [1C, 1С, 1С:Предприятие, 1С:Предприятие 8.3,
|
||||
## Начало работы
|
||||
|
||||
1. Скачайте Ollama c [официального сайта](https://ollama.com/) и запустите на целевой машине
|
||||
|
||||

|
||||
|
||||
2. `(опционально)` Для получения возможности отправки своих моделей на сервера Ollama, требуется также создать аккаунт и добавить открытый ключ в локальное решение, следуя инструкциям из раздела [Ollama keys](https://ollama.com/settings/keys)
|
||||
|
||||

|
||||
|
||||
3. `(опционально)` Для добавления авторизации и возможности обработки запросов извне, необходимо настроить проксирование через сторонний веб-сервер
|
||||
|
||||
> По умолчанию сервер Ollama доступен только в локальной сети на `localhost:11434`
|
||||
64
docs/ru/md/Instructions/Twitter.md
vendored
64
docs/ru/md/Instructions/Twitter.md
vendored
@@ -67,42 +67,42 @@ keywords: [1C, 1С, 1С:Предприятие, 1С:Предприятие 8.3,
|
||||
|
||||
- **access_token** и **refresh_token**
|
||||
|
||||
Эти токены необходимо получить http запросом с указанием кода, который приходит при авторизации на http-сервис `redirect_uri`.Порядок действий:
|
||||
Эти токены необходимо получить http запросом с указанием кода, который приходит при авторизации на http-сервис `redirect_uri`.Порядок действий:
|
||||
|
||||
1. Создать ссылку для авторизации в браузере при помощи функции `ПолучитьСсылкуАвторизации`
|
||||
2. Добавить в модуль http-сервиса (GET) вызов функции `ОбработкаВходящегоЗапросаПослеАвторизации`, передавая `HTTPСервисЗапрос` как параметр.
|
||||
3. Авторизоваться в браузере по ссылке из п.1.
|
||||
3. Сохранить **access_token** и **refresh_token**, полученные из функции `ОбработкаВходящегоЗапросаПослеАвторизации` п. 2, в константы или другое хранилище
|
||||
|
||||
|
||||
```bsl title="Получение"
|
||||
|
||||
Функция Twitterget(Запрос)
|
||||
|
||||
Код = Запрос.ПараметрыЗапроса["code"];
|
||||
ОтветТокен = OPI_Twitter.ПолучитьТокен(Код, Параметры);
|
||||
|
||||
Константы.TwitterRefresh.Установить(ОтветТокен["refresh_token"]);
|
||||
Константы.TwitterToken.Установить(ОтветТокен["access_token"]);
|
||||
|
||||
Ответ = Новый HTTPСервисОтвет(200);
|
||||
Возврат Ответ;
|
||||
|
||||
КонецФункции
|
||||
1. Создать ссылку для авторизации в браузере при помощи функции `ПолучитьСсылкуАвторизации`
|
||||
2. Добавить в модуль http-сервиса (GET) вызов функции `ОбработкаВходящегоЗапросаПослеАвторизации`, передавая `HTTPСервисЗапрос` как параметр.
|
||||
3. Авторизоваться в браузере по ссылке из п.1.
|
||||
3. Сохранить **access_token** и **refresh_token**, полученные из функции `ОбработкаВходящегоЗапросаПослеАвторизации` п. 2, в константы или другое хранилище
|
||||
|
||||
```
|
||||
|
||||
```bsl title="Обновление"
|
||||
|
||||
Процедура ОбновлятьТокенКаждыеДваЧаса(Знач Параметры)
|
||||
|
||||
```bsl title="Получение"
|
||||
|
||||
Функция Twitterget(Запрос)
|
||||
|
||||
Ответ = OPI_Twitter.ОбновитьТокен(Параметры);
|
||||
Константы.TwitterToken.Установить(Ответ["access_token"]);
|
||||
Константы.TwitterRefresh.Установить(Ответ["refresh_token"]);
|
||||
Код = Запрос.ПараметрыЗапроса["code"];
|
||||
ОтветТокен = OPI_Twitter.ПолучитьТокен(Код, Параметры);
|
||||
|
||||
Константы.TwitterRefresh.Установить(ОтветТокен["refresh_token"]);
|
||||
Константы.TwitterToken.Установить(ОтветТокен["access_token"]);
|
||||
|
||||
Ответ = Новый HTTPСервисОтвет(200);
|
||||
Возврат Ответ;
|
||||
|
||||
КонецФункции
|
||||
|
||||
КонецПроцедуры
|
||||
```
|
||||
```
|
||||
|
||||
```bsl title="Обновление"
|
||||
|
||||
Процедура ОбновлятьТокенКаждыеДваЧаса(Знач Параметры)
|
||||
|
||||
Access_token действует 2 часа. По истечении этого времени, токен необходимо обновить при помощи функции `ОбновитьТокен`. При этом обновляется как `access_token`, так и `refresh_token`. Т.е. при следующем обновлении сгоревшего `access_token`, `refresh_token` должен быть из **предыдущего** запроса
|
||||
Ответ = OPI_Twitter.ОбновитьТокен(Параметры);
|
||||
Константы.TwitterToken.Установить(Ответ["access_token"]);
|
||||
Константы.TwitterRefresh.Установить(Ответ["refresh_token"]);
|
||||
|
||||
КонецПроцедуры
|
||||
```
|
||||
|
||||
Access_token действует 2 часа. По истечении этого времени, токен необходимо обновить при помощи функции `ОбновитьТокен`. При этом обновляется как `access_token`, так и `refresh_token`. Т.е. при следующем обновлении сгоревшего `access_token`, `refresh_token` должен быть из **предыдущего** запроса
|
||||
|
||||
После определения всех полей и создания структуры авторизации, они могут быть использованы в различных функция библиотеки для выполнения конкретных действий
|
||||
2
docs/ru/md/Instructions/VK.md
vendored
2
docs/ru/md/Instructions/VK.md
vendored
@@ -34,5 +34,5 @@ IDГруппы = "123456789"; // ID группы из п.3
|
||||
IDПриложения = "123456789"; // ID приложения из п.2
|
||||
Токен = "vk1.a...."; // Токен авторизации из п.6
|
||||
|
||||
Параметры = ПолучитьПараметрыАвторизации(IDГруппы, IDПриложения, Токен);
|
||||
Параметры = OPI_VK.ПолучитьПараметрыАвторизации(IDГруппы, IDПриложения, Токен);
|
||||
```
|
||||
47
docs/ru/md/Instructions/YandexDisk.md
vendored
47
docs/ru/md/Instructions/YandexDisk.md
vendored
@@ -15,43 +15,30 @@ keywords: [1C, 1С, 1С:Предприятие, 1С:Предприятие 8.3,
|
||||
Для начала работы необходимо получить токен доступа к диску:
|
||||
|
||||
1. Перейдите на [страницу создания приложения](https://oauth.yandex.ru/client/new/)
|
||||
|
||||

|
||||
|
||||
2. Введите название сервиса, выберите *Веб-сервисы* в качестве платформы. Redirect URI можно указать любой или выбрать пункт *Подставить URL для отладки* - для работы с библиотекой он не понадобится.
|
||||
|
||||

|
||||
|
||||
3. В поле *Доступ к данным* добавьте разрешения как на скриншоте ниже, после чего нажмите *Создать приложение*
|
||||
|
||||

|
||||
|
||||
4. Сохраните **ClientID** и **Client secret** со страницы приложения
|
||||
5. Вызовите функцию `ПолучитьКодПодтверждения`, передав ClientID в качестве параметра. Функция вернет ответ сервера Yandex, содержащий следующие поля:
|
||||
|
||||

|
||||
- **user_code** - необходимо будет ввести в браузере
|
||||
- **device_code** - необходимо будет передать в другую функцию
|
||||
- **verification_url** - URL, который нужно открыть в браузере
|
||||
|
||||
5. Вызовите функцию *OPI_YandexID.ПолучитьКодПодтверждения()*, передав ClientID в качестве параметра. Она вернет ответ сервера Yandex, где будут поля:
|
||||
- **user_code** - необходимо будет ввести в браузере
|
||||
- **device_code** - необходимо будет передать в другую функцию
|
||||
- **verification_url** - URL, который нужно открыть в браузере
|
||||
<br/>
|
||||
```json title="Результат функции ПолучитьКодПодтверждения(), если перевести его в JSON"
|
||||
{
|
||||
"verification_url": "https://ya.ru/device",
|
||||
"user_code": "gjehyruw",
|
||||
"interval": 5,
|
||||
"expires_in": 300,
|
||||
"device_code": "12207cafec1b40ad8d0052af3faf0d12"
|
||||
}
|
||||
```
|
||||
```json title="Результат функции ПолучитьКодПодтверждения в виде JSON"
|
||||
{
|
||||
"verification_url": "https://ya.ru/device",
|
||||
"user_code": "gjehyruw",
|
||||
"interval": 5,
|
||||
"expires_in": 300,
|
||||
"device_code": "12207cafec1b40ad8d0052af3faf0d12"
|
||||
}
|
||||
```
|
||||
|
||||
6. Откройте URL из **verification_url** в браузере. Скорее всего это будет https://ya.ru/device. В появившееся поле введите **user_code** из пункта 5
|
||||
6. Откройте URL из **verification_url** в браузере. В появившееся поле введите **user_code** из пункта 5
|
||||
|
||||

|
||||
7. После ввода кода в пункте 6, вызовите функцию `ПреобразоватьКодВТокен`, передав туда *ClientID* и *ClientSecret* из пункта 4, а также *device_code* из пункта 5. Сохраните полученные **access_token** и **refresh_token**
|
||||
|
||||
7. После ввода кода в пункте 6, вызовите функцию *OPI_YandexID.ПреобразоватьКодВТокен()*, передав туда **ClientID** и **ClientSecret** из пункта 4, а также **device_code** из пункта 5. Сохраните полученные **access_token** и **refresh_token**
|
||||
|
||||
```json title="Результат функции ПреобразоватьКодВТокен(), если перевести его в JSON"
|
||||
```json title="Результат функции ПреобразоватьКодВТокен в виде JSON"
|
||||
{
|
||||
"token_type": "bearer",
|
||||
"refresh_token": "1:Tj6nD2vgE2L8jwSm:YgWjQXPv6_y3e07GW70ig2AOyEXoRVsKKpApGHq2EOg7pfx0MKrXiCrfLBFtzgQawdawdwadad3Sasa9z2H0vSeZKNmZmA",
|
||||
@@ -60,4 +47,4 @@ keywords: [1C, 1С, 1С:Предприятие, 1С:Предприятие 8.3,
|
||||
}
|
||||
```
|
||||
|
||||
**access_token** используется во всех остальных функциях библиотеки, а при помощи **refresh_token** его можно обновить, когда срок жизни будет подходить к концу (при помощи функции *ОбновитьТокен()*)
|
||||
**access_token** используется для авторизации во всех остальных функциях библиотеки. **refresh_token** необходимо передать в функцию `ОбновитьТокен` для полчения нового access_token, когда время жизни предыдущего подойдет к концу
|
||||
Reference in New Issue
Block a user