function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
neao18neao18 

Http Call for SMS api not working !

Hi all i have a sms api from http://api.mVaayoo.com/mvaayooapi/ and i have written a class to make a http call, and it execute without and errors,

But i m not recieving any sms what is wrong i dont know :

also i have made :http://api.mVaayoo.com access in remote site setting.

 

global class HttpApiSMSCall{
    
   WebService static void getsms(String id) {

// Instantiate a new http object 
    ConTest__c  web= new ConTest__c ();
    web = [select Id,Indian_Mobile_No__c from ConTest__c where Id =:id];
    
    string enpoit='http://api.mVaayoo.com/mvaayooapi/MessageCompose?user=user@gmail.com:password&senderID=test&receipientno=9420186***&dcs=0&msgtxt=Hii All Test Msg&state=4';
    Http h = new Http();
    
// Instantiate a new HTTP request, specify the method (GET) as well as the endpoint 
    system.debug('@@@@ end'+enpoit);
    HttpRequest req = new HttpRequest();
    req.setEndpoint(enpoit);
    req.setMethod('GET');

// Send the request, and return a response 
    
    HttpResponse res = h.send(req);
    system.debug('########## msg'+ res);
  }
}

 i am getting OK status in debug but sms are not sent also on server log it doent have any out bound sms. Have any idea?

 

crop1645crop1645

How are you testing this?  If you are testing using a testmethod, then callouts won't execute.

neao18neao18

thanks .. i was doing it in a testclass now ... thanks..