[Solved] Tencent cloud SMS service error: FailedOperation.TemplateIncorrectOrUnapproved

1. Problem
an error occurs when sending a text message:

"Code":"FailedOperation.TemplateIncorrectOrUnapproved",
"Message":"template is not approved or request content does not match the approved template content"

2. Solution
the reason for the error is that the template content parameters are inconsistent with the set parameters. Set to consistent. As shown in the following figure, the template content has two parameters, so the templateparamset in the code should also set two parameters

    /* Template parameters: If no template parameters, set to empty */
    String[] templateParamSet = {"", "60"};
    req.setTemplateParamSet(templateParamSet);

Read More: