我正在使用TextLocal工具在我的java代码中发送短信。我使用了与here相同的代码片段。
这是一个事务性帐户。我收到以下错误
{"errors":[{"code":80,"message":"Invalid template"}],"status":"failure"}在TextLocal文档中找不到此错误代码。如果有人以前遇到过这个问题,请告诉我解决方案。
发布于 2016-05-12 17:22:14
之所以会发生这种情况,是因为应该通过TextLocal仪表板为TextLocal事务性消息提供消息模板,并且所有发送的SMS都应该遵循这些消息的所有规则。在创建并遵循模板之后,问题就解决了。
发布于 2017-07-20 20:15:44
转到textlocal的登录仪表板,然后在send菜单中转到template and draft。
然后打开您的模板以查看消息格式。并向您的java方法提供相同的消息格式来发送消息。
希望能对你有所帮助。
发布于 2020-12-03 20:15:01
Few quick points to check
1.Is the message that you are passing in your API as per your approved
templates? If not, this error will come in response to your API. You
can check your approved templates under Send -> Templates & Drafts
2.Are all special characters in your template (&, @, #...) URL
encoded?
3.Are you using the same placeholder name
for multiple dynamic/replaceable parameters in your API? They have
to be unique.
4.Are you exceeding the max character length set for
the placeholder? Are you using a newline character? Replace all the
newline characters with %n以上几点摘自textlocal SMS API文档。您还可以尝试将经过批准的textlocal模板的内容复制到Java代码中。
https://stackoverflow.com/questions/37181777
复制相似问题