Skip to main content

Add OAuth V1 authorization

Adds data for OAuth v1 authorization

Function AddOAuthV1Authorization(Val Token, Val Secret, Val ConsumerKey, Val ConsumerSecret, Val Version) Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken for authorization
Secret--secretStringSecret for authorization
ConsumerKey--ckStringConsumer key for authorization
ConsumerSecret--csStringConsumer secret for authorization
Version--verStringAPI version

Returns: DataProcessorObject.OPI_HTTPClient - This processor object


tip

By default, HMAC-SHA256 is used to create the signature. To change the algorithm, you can use SetOAuthV1Algorithm


1C:Enterprise/OneScript code example
    URL = "https://bin.openintegrations.dev";
URL = URL + "/get";

Token = "***";
Secret = "***";
UsersKey = "***";
UsersSecret = "***";
Version = "1.0";

Result = OPI_HTTPRequests.NewRequest()
.Initialize(URL)
.AddOAuthV1Authorization(Token, Secret, UsersKey, UsersSecret, Version) // <---
.ProcessRequest("GET")
.ReturnResponseAsJSONObject();
Result
{
"args": {},
"headers": {
"Accept": "*/*",
"Accept-Charset": "utf-8",
"Accept-Encoding": "gzip",
"Authorization": "OAuth oauth_consumer_key=\"***\",oauth_token=\"***\",oauth_signature_method=\"HMAC-SHA256\",oauth_timestamp=\"1760431036\",oauth_nonce=\"1760431036\",oauth_version=\"1.0\",oauth_signature=CwVoxFF%2FAL7nDTK9J11%2BpJdi3Fdnbqh7yek0xmV3oR4%3D",
"Connection": "Keep-Alive",
"Content-Length": "0",
"Host": "localhost:2424",
"Max-Forwards": "10",
"User-Agent": "1Script v$2.0.0.0",
"X-Arr-Log-Id": "389cd1e8-7fa7-41ee-9a19-ba443a68ec42",
"X-Arr-Ssl": "2048|256|C=BE, O=GlobalSign nv-sa, CN=GlobalSign GCC R6 AlphaSSL CA 2025|CN=*.openintegrations.dev",
"X-Forwarded-Host": "bin.openintegrations.dev",
"X-Original-Url": "/get"
},
"origin": "***",
"url": "https://bin.openintegrations.dev/get"
}