tencent cloud

All product documents
Tencent Cloud Observability Platform
util.cloudAPISignatureV3
Last updated: 2025-03-11 20:21:26
util.cloudAPISignatureV3
Last updated: 2025-03-11 20:21:26
During the script execution, util.cloudAPISignatureV3 is used to call the TencentCloud API for Signature v3 signing;
For details, see TencentCloud API Signature v3 documentation.
cloudAPISignatureV3(param: CloudAPISignatureV3Param): string

Parameters

Parameter
Type
Description
param
Name parameters.

Return

Type
Description
string
Signature results.

Usage Examples

Call the method to sign and access the TencentCloud API:
import util from 'pts/util';
import http from 'pts/http';

export default function () {
const timestamp = parseInt(new Date().getTime() / 1000);
const body = {
EnvironmentId: 'wtp',
TopicName: 'access_server',
ClusterId: 'pulsar-vgb3w9ezndvx',
};
const headers = {
'Content-Type': 'application/json',
Host: 'tdmq.tencentcloudapi.com',
'X-TC-Action': 'DescribeSubscriptions',
'X-TC-Version': '2020-02-17',
'X-TC-Timestamp': timestamp.toString(),
'X-TC-Region': 'ap-guangzhou',
};
// Call the method.
headers.Authorization = util.cloudAPISignatureV3({
secretID: 'xxx',
secretKey: 'xxx',
service: 'tdmq',
method: 'POST',
timestamp,
headers,
body,
});
const resp = http.post('https://tdmq.tencentcloudapi.com', body, {
headers,
});
console.log(resp.body);
}

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon