### Install SDK via go get Source: https://cloud.tencent.com/document/product/382/43199 Recommended method for installing the SDK using the go get command. ```bash go get github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common go get github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms/v20210111 ``` -------------------------------- ### Install Go SDK via go get Source: https://cloud.tencent.com/document/product/382/43199 Recommended method for installing the Go SDK using the go get command. Links to GitHub, Gitee, and CNB repositories are provided. ```go go get github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms/v20210111 ``` -------------------------------- ### C# SDK Installation and Usage Examples Source: https://cloud.tencent.com/document/product/382/43198 This snippet covers installing the C# SDK via NuGet and provides example code for common SMS operations like sending messages, retrieving status, and managing templates. ```APIDOC ## C# SDK This documentation outlines the usage of the Tencent Cloud C# SDK for SMS services. ### Prerequisites * SMS service enabled. * Signatures and templates created and approved. * For domestic SMS, a domestic SMS package must be purchased. * SecretID and SecretKey obtained from the Access Management console. * SMS API endpoint: `sms.tencentcloudapi.com`. ### Installation #### Via NuGet (Recommended) Refer to the respective GitHub, Gitee, or CNB repositories for installation instructions. #### Via Source Code Refer to the respective GitHub, Gitee, or CNB repositories for installation instructions. ### Example Code **Note:** All example code is for reference only and requires modification for actual use. You can also use the API 3.0 Explorer to generate Demo code. Each API has a corresponding Request and Response structure. #### Sending SMS ```csharp // Example code for sending SMS (requires actual implementation) // Refer to API documentation for specific parameters and usage. ``` #### Pulling Receipt Status ```csharp // Example code for pulling SMS receipt status (requires actual implementation) // Refer to API documentation for specific parameters and usage. ``` #### Statistics for SMS Sending Data ```csharp // Example code for statistics of SMS sending data (requires actual implementation) // Refer to API documentation for specific parameters and usage. ``` #### Applying for SMS Template ```csharp // Example code for applying for an SMS template (requires actual implementation) // Refer to API documentation for specific parameters and usage. ``` ### Important Notes * Each group sending request supports a maximum of 200 numbers. * Individual authentication users cannot use signature and message body template related interfaces; they can only manage SMS signatures and message body templates through the SMS console. To use these interfaces, change "Individual Authentication" to "Enterprise Authentication" as described in the "Real-name Authentication Change Guide." ``` -------------------------------- ### Install Python SDK from Source Source: https://cloud.tencent.com/document/product/382/56059 Install the Tencent Cloud Python SDK by downloading and installing from the source code. Navigate to the downloaded directory and run the setup script. ```bash $ cd tencentcloud-sdk-python $ python setup.py install ``` -------------------------------- ### Install SDK Source: https://cloud.tencent.com/document/product/382/68853 Instructions for installing the SDK, including environment dependencies and building from source. ```bash Environment dependencies Build SDK from source ``` -------------------------------- ### Install Go SDK from Source Source: https://cloud.tencent.com/document/product/382/43199 Instructions for installing the Go SDK by compiling from source code. Links to GitHub, Gitee, and CNB repositories are provided. ```go git clone https://github.com/tencentcloud/tencentcloud-sdk-go.git cd tencentcloud-sdk-go go install ./... ``` -------------------------------- ### HTTP GET Request Structure Example Source: https://cloud.tencent.com/document/product/382/38767 Example of an HTTP GET request structure for querying cloud server instances in the Guangzhou region using the v1 signature method. ```http https://cvm.tencentcloudapi.com/?Action=DescribeInstances&Version=2017-03-12&SignatureMethod=HmacSHA256&Timestamp=1527672334&Signature=37ac2f4fde00b0ac9bd9eadeb459b1bbee224158d66e7ae5fcadb70b2d181d02&Region=ap-guangzhou&Nonce=23823223&SecretId=AKID******************************** Host: cvm.tencentcloudapi.com ``` -------------------------------- ### HTTP GET Request Structure Example (TC3-HMAC-SHA256) Source: https://cloud.tencent.com/document/product/382/38767 Example of an HTTP GET request structure using the TC3-HMAC-SHA256 signature method. This includes common parameters in the URL and HTTP headers. ```http https://cvm.tencentcloudapi.com/?Limit=10&Offset=0 Authorization: TC3-HMAC-SHA256 Credential=AKID********************************/2018-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474 Content-Type: application/x-www-form-urlencoded Host: cvm.tencentcloudapi.com X-TC-Action: DescribeInstances X-TC-Version: 2017-03-12 X-TC-Timestamp: 1539084154 X-TC-Region: ap-guangzhou ``` -------------------------------- ### Get SMS Sending Statistics with PHP SDK Source: https://cloud.tencent.com/document/product/382/43195 Use this snippet to retrieve SMS sending statistics. Ensure you have the SDK installed and your Tencent Cloud credentials configured. The example shows how to set the SMS application ID, limit, offset, and time range for the query. ```php setProxy("https://ip:port"); $httpProfile->setReqMethod("GET"); // get请求(默认为post请求) $httpProfile->setReqTimeout(30); // 请求超时时间,单位为秒(默认60秒) $httpProfile->setEndpoint("sms.tencentcloudapi.com"); // 指定接入地域域名(默认就近接入)  // 实例化一个client选项,可选的,没有特殊需求可以跳过 $clientProfile = new ClientProfile(); $clientProfile->setSignMethod("TC3-HMAC-SHA256"); // 指定签名算法 $clientProfile->setHttpProfile($httpProfile);  // 实例化要请求产品(以sms为例)的client对象,clientProfile是可选的 // 第二个参数是地域信息,可以直接填写字符串ap-guangzhou,支持的地域列表参考 https://cloud.tencent.com/document/api/382/52071#.E5.9C.B0.E5.9F.9F.E5.88.97.E8.A1.A8 $client = new SmsClient($cred, "ap-guangzhou", $clientProfile);  // 实例化一个 sms 发送短信请求对象,每个接口都会对应一个request对象。 $req = new SendStatusStatisticsRequest();  /* 填充请求参数,这里request对象的成员变量即对应接口的入参 * 您可以通过官网接口文档或跳转到request对象的定义处查看请求参数的定义 * 基本类型的设置: * 帮助链接: * 短信控制台: https://console.cloud.tencent.com/smsv2 * 腾讯云短信小助手: https://cloud.tencent.com/document/product/382/3773#.E6.8A.80.E6.9C.AF.E4.BA.A4.E6.B5.81 */  /* 短信应用ID: 短信SdkAppId在 [短信控制台] 添加应用后生成的实际SdkAppId,示例如1400006666 */ $req->SmsSdkAppId = "1400787878"; /* 拉取最大条数,最多100条 */ $req->Limit = 10; /* 偏移量 注:目前固定设置为0 */ $req->Offset = 0; /* 开始时间,yyyymmddhh 需要拉取的起始时间,精确到小时 */ $req->BeginTime = "2019122500"; /* 结束时间,yyyymmddhh 需要拉取的截止时间,精确到小时 * 注:EndTime 必须大于 BeginTime */ $req->EndTime = "2019122523";  // 通过client对象调用SendStatusStatistics方法发起请求。注意请求方法名与请求对象是对应的 // 返回的resp是一个SendStatusStatisticsResponse类的实例,与请求对象对应 $resp = $client->SendStatusStatistics($req);  // 输出json格式的字符串回包 print_r($resp->toJsonString());  // 也可以取出单个值。 // 您可以通过官网接口文档或跳转到response对象的定义处查看返回字段的定义 print_r($resp->TotalCount); } catch(TencentCloudSDKException $e) { echo $e; } ``` -------------------------------- ### Install SDK from Source Source: https://cloud.tencent.com/document/product/382/43198 Alternative method for installing the SDK by building from source. ```bash git clone https://github.com/TencentCloud/tencentcloud-sdk-dotnet.git cd tencentcloud-sdk-dotnet msbuild /t:Build src/Tencent.SMS.csproj ``` -------------------------------- ### Go SDK Installation Source: https://cloud.tencent.com/document/product/382/43199 Instructions on how to install the Go SDK for SMS services, including recommended methods and source installation. ```APIDOC ## Install SDK ### Via go get (Recommended) Refer to Github repository: [Install via go get (Recommended)](https://github.com/TencentCloud/tencentcloud-sdk-go/blob/master/docs/install.md#go-get) Refer to Gitee repository: [Install via go get (Recommended)](https://gitee.com/tencentcloud/tencentcloud-sdk-go/blob/master/docs/install.md#go-get) Refer to CNB repository: [Install via go get (Recommended)](https://git.code.tencent.com/sunshine_jiang/tencentcloud-sdk-go/blob/master/docs/install.md#go-get) ### Via Source Installation Refer to Github repository: [Install via Source](https://github.com/TencentCloud/tencentcloud-sdk-go/blob/master/docs/install.md#source-install) Refer to Gitee repository: [Install via Source](https://gitee.com/tencentcloud/tencentcloud-sdk-go/blob/master/docs/install.md#source-install) Refer to CNB repository: [Install via Source](https://git.code.tencent.com/sunshine_jiang/tencentcloud-sdk-go/blob/master/docs/install.md#source-install) ``` -------------------------------- ### Statistical SMS Sending Data Example Source: https://cloud.tencent.com/document/product/382/43199 Example code demonstrating how to get statistics on SMS sending data using the Go SDK. ```APIDOC ## Example Code ### Statistical SMS Sending Data ```go // Example code for statistical SMS sending data (requires actual modification) package main import ( "fmt" "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile" "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms/v20210111.tencentcloud" ) func main() { // TODO: Replace with your actual SecretID and SecretKey secretId := "YOUR_SECRET_ID" secretKey := "YOUR_SECRET_KEY" // Create a common client profile // TODO: Replace with your actual region if needed clientProfile := profile.NewClientProfile() clientProfile.HttpProfile.Endpoint = "sms.tencentcloudapi.com" // Create a credential credential := common.NewCredential(secretId, secretKey) // Create a client client, err := sms.NewClient(credential, "ap-guangzhou", clientProfile) if err != nil { fmt.Println("Error creating client:", err) return } // TODO: Fill in your request parameters params := sms.NewSmsDataStatRequest() // Example: Set parameters for statistical SMS sending data (replace with actual values) // params.SmsSdkAppid = common.StringPtr("1400000000") // Replace with your SDK AppID // params.BeginTime = common.StringPtr("2023-01-01") // Start date // params.EndTime = common.StringPtr("2023-01-31") // End date // Statistical SMS sending data response, err := client.SmsDataStat(params) if err != nil { fmt.Println("Error statistical SMS sending data:", err) return } fmt.Printf("Response: %+v\n", response) } ``` ``` -------------------------------- ### SDK Configuration and Initialization Source: https://cloud.tencent.com/document/product/382/3772 This snippet shows how to install the SDK using npm and how to initialize the QcloudSms object with your application's AppID and AppKey. ```APIDOC ## SDK Configuration and Initialization ### Description This section details how to set up the Node.js SDK for Tencent Cloud SMS. It covers installation via npm and the necessary steps to instantiate the `QcloudSms` client using your unique `SDKAppID` and `AppKey`. ### Installation Use npm to install the SDK: ```bash npm install qcloudsms_js ``` ### Manual Configuration Alternatively, you can manually download or clone the latest version of the `qcloudsms_js` code and include it in your project. ### Initialization Example ```javascript var QcloudSms = require("qcloudsms_js"); // SMS application SDK AppID var appid = 1400009099; // SDK AppID starts with 1400 // SMS application SDK AppKey var appkey = "9ff91d87c2cd7cd0ea762f141975d1df37481d48700d70ac37470aefc60f9bad"; // Instantiate QcloudSms var qcloudsms = QcloudSms(appid, appkey); // Callback handler for requests (for demonstration purposes) function callback(err, res, resData) { if (err) { console.log("err: ", err); } else { console.log("request data: ", res.req); console.log("response data: ", resData); } } ``` ```