获取错误“twilio找不到具有指定发件人地址的通道”

r6hnlfcb  于 2021-07-06  发布在  Java
关注(0)|答案(1)|浏览(429)

我无法从我的java代码发送whatsup消息,那么下面显示这个错误。

Exception in thread "main" com.twilio.exception.ApiException: Twilio could not find a Channel with the specified From address
    at com.twilio.rest.api.v2010.account.MessageCreator.create(MessageCreator.java:530)
    at com.twilio.rest.api.v2010.account.MessageCreator.create(MessageCreator.java:25)
    at com.twilio.base.Creator.create(Creator.java:45)
    at com.zinzzo.message.server.controller.MessageServiceController.sendwhatsupMessage(MessageServiceController.java:19)
    at com.zinzzo.message.server.controller.MessageServiceController.main(MessageServiceController.java:31)

这是我的密码

public void sendwhatsupMessage(){
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Message message = Message.creator(
                new com.twilio.type.PhoneNumber("whatsapp:+919540215071"),
                new com.twilio.type.PhoneNumber("whatsapp:+918882989093"),
                "Your Yummy Cupcakes Company order of 1 dozen frosted cupcakes has shipped and should be delivered on July 10, 2019. Details: http://www.yummycupcakes.com/")
                .create();

        System.out.println(message.getSid());
        System.out.println("messge sent");
}
w6mmgewl

w6mmgewl1#

您需要创建一个webook来接收入站消息。这个视频可以帮助你https://www.youtube.com/watch?v=eeudel2aj5g

相关问题