失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 腾讯云-语音指定模板-电话告警通知

腾讯云-语音指定模板-电话告警通知

时间:2024-06-02 02:31:39

相关推荐

腾讯云-语音指定模板-电话告警通知

腾讯云语音告警模板demo参考链接

pom引入:

<!--腾讯语音sdk--><dependency><groupId>com.tencentcloudapi</groupId><artifactId>tencentcloud-sdk-java</artifactId><version>3.1.188</version></dependency>

后台demo:

import mon.Credential;import mon.profile.ClientProfile;import mon.profile.HttpProfile;import mon.exception.TencentCloudSDKException;import com.tencentcloudapi.vms.v2002.VmsClient;import com.tencentcloudapi.vms.v2002.models.*;public class SendTtsVoice{public static void main(String [] args) {try{Credential cred = new Credential("AKIDCCwPbWBZfU2JJ2Uf***", "cx1nIXUAZgW5MO***");HttpProfile httpProfile = new HttpProfile();httpProfile.setEndpoint("");ClientProfile clientProfile = new ClientProfile();clientProfile.setHttpProfile(httpProfile);//电话分组VmsClient client = new VmsClient(cred, "ap-guangzhou", clientProfile);SendTtsVoiceRequest req = new SendTtsVoiceRequest();//语音模板req.setTemplateId("1026**");String[] templateParamSet1 = {"秦淮区", "报警器0001"};req.setTemplateParamSet(templateParamSet1);//放入手机号码req.setCalledNumber("+86177***");//播放次数指定req.setPlayTimes(2L);//语音账号appidreq.setVoiceSdkAppid("1400***");SendTtsVoiceResponse resp = client.SendTtsVoice(req);System.out.println(SendTtsVoiceResponse.toJsonString(resp));} catch (TencentCloudSDKException e) {System.out.println(e.toString());}}}

如果觉得《腾讯云-语音指定模板-电话告警通知》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。