2025-05-08 09:05:34 +03:00
---
sidebar_position: 5
2025-05-14 14:53:52 +03:00
description: Set OAuth V1 algorithm and other functions to work with HTTP-client in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
2025-05-08 09:05:34 +03:00
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, HTTP-client]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2025-05-14 14:53:52 +03:00
# Set OAuth V1 algorithm
2025-05-08 09:05:34 +03:00
Changes the algorithm for OAuth signatures
`Function SetOAuthV1Algorithm(Val Algorithm, Val HashFunction) Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
2025-05-14 14:53:52 +03:00
| Algorithm | - | String | ✔ | Encryption algorithm: HMAC, RSA |
| HashFunction | - | String | ✔ | Hash function for signature: SHA1, SHA256 |
2025-05-08 09:05:34 +03:00
Returns: DataProcessorObject.OPI_HTTPClient - This processor object
<br/>
2025-05-14 14:53:52 +03:00
:::caution
**NOCLI:** this method is not available in CLI version
:::
<br/>
2025-05-08 09:05:34 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2025-06-27 11:47:43 +03:00
URL = FunctionParameters["HTTP_URL"];
2025-05-09 21:49:23 +03:00
URL = URL + "/get";
Token = "***";
Secret = "***";
UsersKey = "***";
UsersSecret = "***";
Version = "1.0";
Result = OPI_HTTPRequests.NewRequest()
.Initialize(URL)
.AddOAuthV1Authorization(Token, Secret, UsersKey, UsersSecret, Version)
.SetOAuthV1Algorithm("HMAC", "SHA1") // <---
.ProcessRequest("GET")
.ReturnResponseAsJSONObject();
2025-05-08 09:05:34 +03:00
```