You need to sign in to do that
Don't have an account?
Anil Kumar 1257
How to integrate third party sms .i want integrate third party sms and send the sms my org please tell me how can do that
global class Kit19SMS {
global String sendMessage(List<String> numbers, String message){
system.debug('sent sms done');
String num = String.join(numbers,',');
String user;
String pass;
String send;
API_Credentials__mdt[] logcredentials = [Select id,Username__c,password__c,senderId__c FROM API_Credentials__mdt WHERE developername = 'Kit19' LIMIT 1];
for(API_Credentials__mdt login:logcredentials){
user = login.Username__c;
pass = login.password__c;
send = login.senderId__c;
}
system.debug('user=='+user);
system.debug('pass=='+pass);
system.debug('send=='+send);
HttpRequest req = new HttpRequest();
req.setHeader('Content-Length', '0');
req.setEndpoint('https://www.kit19.com/ComposeSMS.aspx?username='+ user +'&password='+ pass +'&sender='+ send +'&to=' + num +
'&message=' + EncodingUtil.URLENCODE(message,'UTF-8') + '&priority=1&dnd=1&unicode=0');
req.setMethod('POST');
system.debug('EndPoint========'+req);
system.debug('Sent========');
Http http = new Http();
//if (test.isRunningTest()) Test.setMock(HttpCalloutMock.class, new MockHttpResponseGenerator());
try{
HTTPResponse res = http.send(req);
system.debug('response' + res);
}
catch(Exception e){
system.debug('Exception e' + e);
}
return null;
}
global String sendPersonalizedMessage(String numbers, Id templateId){
return null;
}
}
global String sendMessage(List<String> numbers, String message){
system.debug('sent sms done');
String num = String.join(numbers,',');
String user;
String pass;
String send;
API_Credentials__mdt[] logcredentials = [Select id,Username__c,password__c,senderId__c FROM API_Credentials__mdt WHERE developername = 'Kit19' LIMIT 1];
for(API_Credentials__mdt login:logcredentials){
user = login.Username__c;
pass = login.password__c;
send = login.senderId__c;
}
system.debug('user=='+user);
system.debug('pass=='+pass);
system.debug('send=='+send);
HttpRequest req = new HttpRequest();
req.setHeader('Content-Length', '0');
req.setEndpoint('https://www.kit19.com/ComposeSMS.aspx?username='+ user +'&password='+ pass +'&sender='+ send +'&to=' + num +
'&message=' + EncodingUtil.URLENCODE(message,'UTF-8') + '&priority=1&dnd=1&unicode=0');
req.setMethod('POST');
system.debug('EndPoint========'+req);
system.debug('Sent========');
Http http = new Http();
//if (test.isRunningTest()) Test.setMock(HttpCalloutMock.class, new MockHttpResponseGenerator());
try{
HTTPResponse res = http.send(req);
system.debug('response' + res);
}
catch(Exception e){
system.debug('Exception e' + e);
}
return null;
}
global String sendPersonalizedMessage(String numbers, Id templateId){
return null;
}
}
https://pollutionmask.co/
The below thread might be helpful
https://developer.salesforce.com/forums/?id=906F00000008s03IAA
Thank you