一、问题描述
发送短信时报错:
"Code":"FailedOperation.TemplateIncorrectOrUnapproved",
"Message":"template is not approved or request content does not match the approved template content"
二、解决方法
报错原因为模板内容参数与设置的参数不一致,设置为一致即可。如下图,模板内容有两个参数,那么代码中的 templateParamSet 也要设置两个参数。
/* 模板参数: 若无模板参数,则设置为空 */
String[] templateParamSet = {"", "60"};
req.setTemplateParamSet(templateParamSet);