2017-07-02 18 views
0

私は自分の電話番号から自分の電話番号にSMSを送信しようとしています。 「スレッド内の例外」メイン "com.twilio.exception.ApiException:要求されたリソース/2010-04/01/Accounts/[email protected]/Messages.jsonが見つかりませんでした"Twilio smsがエラーメッセージを送信する、Javaを使用

public static void main(String[] args) { 
     Twilio.init("[email protected]", "mypassword"); 
     Message message = Message.creator(new PhoneNumber("+947XXXXXXXX"), 
    new PhoneNumber("+947XXXXXXXX"), "This is the ship that made the Kessel Run in fourteen parsecs?").create(); 

System.out.println(message.getSid()); 
} 

このtwilioは初めてです。私は、この例外の理由が何であるか、それはあなたがあなたのメールアドレスとパスワードを使用することはできませんではないTwilio.init("[email protected]", "mypassword");

Twilio.init(ACCOUNT_SID, AUTH_TOKEN);でそれを

答えて

2

を修正する方法を教えする専門家が必要です。あなたはTwilioコンソールにログインした後は、https://www.twilio.com/console

enter image description here

Twilioのドキュメントhttps://www.twilio.com/docs/libraries/java#testing-your-installation

// Install the Java helper library from twilio.com/docs/java/install 
import com.twilio.Twilio; 
import com.twilio.rest.api.v2010.account.Message; 
import com.twilio.type.PhoneNumber; 

public class Example { 
    // Find your Account Sid and Token at twilio.com/user/account 
    public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
    public static final String AUTH_TOKEN = "your_auth_token"; 

    public static void main(String[] args) { 
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN); 

    Message message = Message.creator(new PhoneNumber("+15558675309"), 
     new PhoneNumber("+15017250604"), 
     "This is the ship that made the Kessel Run in fourteen parsecs?").create(); 

    System.out.println(message.getSid()); 
    } 
} 
でダッシュボード上のあなたの ACCOUNT_SIDAUTH_TOKENの正しい値を見つけることができます
関連する問題