@InvocableMethod annotation is not allowing to pass two parameters. i want to pass parameter in my rest api can any one plz tell me where i need to do changes in my code here my code
public class TwilioSendSMS {
@InvocableMethod(label='Send Message')
public static void sendSms(){
String phNumber ;
String accountSid = 'xxxxxxxxxxxxxxxxxxxxx';
String token = 'xxxxxxxxxxxxxxxxxxx';
String fromPhNumber = '+19xxxxxxxxxx';
String smsBody;
HttpRequest req = new HttpRequest();
req.setEndpoint('https://api.twilio.com/2010-04-01/Accounts/'+accountSid+'/SMS/Messages.json');
req.setMethod('POST');
String VERSION = '3.2.0';
req.setHeader('Accept', 'application/json');
req.setHeader('Accept-Charset', 'utf-8');
req.setHeader('Authorization','Basic '+EncodingUtil.base64Encode(Blob.valueOf(accountSid+':' +token)));
req.setHeader('Content-Type', '"application/x-www-form-urlencoded"');
req.setBody('To='+EncodingUtil.urlEncode(phNumber,'UTF-8')+'&From='+EncodingUtil.urlEncode(fromPhNumber,'UTF-8')+'&Body='+smsBody);
Http http = new Http();
HTTPResponse res = http.send(req);
System.debug(res.getBody());
if(res.getStatusCode()==201)
System.Debug('Message sending Successful');
else{
System.Debug('Message sending Unsuccessful');
}
}
}
@InvocableVariable
annotation, then in your method you ask for a list of wrappers, take a look at this post