You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.
Hi,
Following is piece of my code. When this code is executed, I am getting Script-thrown exception. Any idea what could be wrong config/code here ? I am setting correct 'accountId' & 'authToken' value.
private static TwilioSMS twilioSms;
//Creating Twilio Client
TwilioRestClient client = new TwilioRestClient(accountId, authToken);
//Adding parameters to send in SMS
Map<String,String> params = new Map<String,String>();
params.put('To',phoneNumber);
params.put('From',fromPhone);
params.put('Body',textMessage);
try{
twilioSms = null;
twilioSms = client.getAccount().getSMSMessages().create(params);
System.debug(LoggingLevel.Error,'SMS Sent '+twilioSms);
}catch(Exception e){
String exceptionMessage = 'Exception Message: ' + e.getMessage();
exceptionMessage += '\nTwilio Client Info: ' + client;
exceptionMessage += '\nTwilio Params Passed: ' + params;
System.debug(LoggingLevel.ERROR,'Error: '+ exceptionMessage);
throw new SmsException(exceptionMessage);
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: