Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,51 @@ import DisclaimerNotice from '@site/src/components/DisclaimerNotice';

1. После удаления токена он будет продолжать работать ещё в течение 1,5–2 часов;
2. После истечения срока действия токена он перестанет работать;
3. Если вы потеряли ранее созданный токен, вы можете создать новый.
3. Если вы потеряли ранее созданный токен, вы можете создать новый.


---

## «Кодирование параметров (URL Encoding)»

### **Важно: Передача спецсимволов в значениях**

Если вы формируете запрос вручную (через `HttpClient`, `fetch` или `curl`), обязательно выполняйте **URL-encoding для значений** параметров.

В частности это касается параметра `screen=HD+`. Если не закодировать `+`, сервер интерпретирует его как пробел, и вы получите ошибку.

**Пример для `screen=HD+`:**

* **Неверно:** `.../create?screen=HD+`
* **Верно:** `.../create?screen=HD%2B`

### **Таблица часто используемых символов**

Для корректной работы API следующие символы в **значениях параметров** должны быть заменены.

Кодируйте эти символы, только если они являются частью передаваемых данных (значений).

| Символ | Описание | Код (Encoded) |
| :---- | :---- | :---- |
| \+ | Плюс (как в HD+) | %2B |
| | Пробел | %20 |
| & | Амперсанд (разделитель параметров) | %26 |
| \= | Равно | %3D |
| ? | Знак вопроса | %3F |
| / | Слэш | %2F |
| : | Двоеточие | %3A |

### **Примеры реализации**

**C\# (HttpClient):** Вместо прямой склейки строк можно используйте метод `Uri.EscapeDataString()` для значения параметра, где могут быть спецсимволы.
``` csharp
string screen = "HD+";
string url = $"http://localhost:8160/v1/profiles/create?name=ApiProfile&workspaceId=-1&screen={Uri.EscapeDataString(screen)}";
// Результат: ...?screen=HD%2B
```
**Python (Requests):** Библиотека `requests` делает это автоматически, если передавать параметры словарем.
``` Python
params = {'screen': 'HD+'}
response = requests.get('http://localhost:8160/v1/profiles/create', params=params)
# Библиотека сама преобразует это в HD%2B
```
4 changes: 2 additions & 2 deletions docs/ZennoPoster/Hello/Key_Advantages.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
sidebar_position: 2
title: "Основные преимущества"
description: " "
Expand Down Expand Up @@ -42,7 +42,7 @@ ZennoPoster позволяет работать в браузере в мног
## **Работа со списками, таблицами и не только**

В программу встроены средства для работы с:
- ***[Таблицами](../ProjectMaker/Project-editor/Actions-in-ProjectMaker-Actions-Blocks/Tables/Operations_on_Tables)***;
- ***[Таблицами](/zennoposter/ProjectMaker/Project-editor/Actions-in-ProjectMaker-Actions-Blocks/Tables/Operations_on_Tables)***;
- ***[Google Таблицами](../ProjectMaker/Project-editor/Actions-in-ProjectMaker-Actions-Blocks/Tables/Operations_on_Google_Sheets)***;
- ***[Списками](../ProjectMaker/Project-editor/Actions-in-ProjectMaker-Actions-Blocks/Lists/List_Operations)*** (xlsx, ods, csv, либо свой формат);
- ***[Простыми файлами](../ProjectMaker/Project-editor/Actions-in-ProjectMaker-Actions-Blocks/Data/Files)***;
Expand Down
4 changes: 2 additions & 2 deletions docs/ZennoPoster/Hello/What_ZennoPoster_Consists_Of.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
sidebar_position: 5
title: "Из чего состоит ZennoPoster"
description: " "
Expand Down Expand Up @@ -32,7 +32,7 @@ _______________________________________________
Также для создания шаблона важен режим записи действий, который добавляет в шаблон все ваши действия в браузере.

Помимо прочего в ProjectMaker можно работать с:
- ***[Таблицами](../ProjectMaker/Project-editor/Actions-in-ProjectMaker-Actions-Blocks/Tables/Operations_on_Tables)***;
- ***[Таблицами](/zennoposter/ProjectMaker/Project-editor/Actions-in-ProjectMaker-Actions-Blocks/Tables/Operations_on_Tables)***;
- ***[Google Таблицами](../ProjectMaker/Project-editor/Actions-in-ProjectMaker-Actions-Blocks/Tables/Operations_on_Google_Sheets)***;
- ***[Списками](../ProjectMaker/Project-editor/Actions-in-ProjectMaker-Actions-Blocks/Lists/List_Operations)*** (xlsx, ods, csv, либо свой формат);
- ***[Простыми файлами](../ProjectMaker/Project-editor/Actions-in-ProjectMaker-Actions-Blocks/Data/Files)***;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,52 @@ The API Token is required to execute all requests. It can obtained as follows:
1. After deleting the token, it will continue functioning within 1.5-2 hours;
2. After token has expired, it will cease to function;
3. If you have lost a previously created token, you can create a new one.

## **Parameter Encoding (URL Encoding)**

### **Important: Passing special characters in parameter values**

If you construct HTTP requests manually (using `HttpClient`, `fetch`, `curl`, etc.), you **must URL-encode parameter values**.

This is especially important for parameters like `screen=HD+`.
If the `+` character is not encoded, the server will interpret it as a **space**, which will result in an error.

**Example for `screen=HD+`**

* **Incorrect:** `.../create?screen=HD+`
* **Correct:** `.../create?screen=HD%2B`

### Commonly Used Characters

For the API to work correctly, the following characters **must be encoded when they are part of parameter values**.

Encode these characters **only if they are part of the actual data (values)**, not as URL syntax.

| Character | Description | Encoded |
| ----- | ----- | ----- |
| `+` | Plus sign (e.g. `HD+`) | `%2B` |
| (space) | Space | `%20` |
| `&` | Ampersand (parameter separator) | `%26` |
| `=` | Equals sign | `%3D` |
| `?` | Question mark | `%3F` |
| `/` | Slash | `%2F` |
| `:` | Colon | `%3A` |

### Implementation Examples

**C# (HttpClient)**

Instead of manually concatenating strings, use `Uri.EscapeDataString()` for parameter values that may contain special characters.
``` csharp
string screen = "HD+";
string url = $"http://localhost:8160/v1/profiles/create?name=ApiProfile&workspaceId=-1&screen={Uri.EscapeDataString(screen)}";
// Result: ...?screen=HD%2B
```
**Python (Requests)**

The `requests` library automatically handles URL encoding when parameters are passed as a dictionary.
``` Python
params = {'screen': 'HD+'}
response = requests.get('http://localhost:8160/v1/profiles/create',params=params)
# The library automatically converts this to HD%2B
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
sidebar_position: 2
title: "Key Advantages"
description: " "
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
sidebar_position: 5
title: "What ZennoPoster Consists Of"
description: " "
Expand Down