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
Mohammad AzamMohammad Azam 

Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = http://bhashsms.in/api/sendmsg.php?user=xxx&pass=123456&sender=xxx&phone=90000003&text=Message&priority=sdnd&stype=normal

Hi
I am trying to SMS Gateway Integration. I am struck at a point. 
I am invoking the class with Javascript button. So when the button is clicked, the sms is sent. But i am an errors. Please help.

My javaScript button code
{!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}


var callout = "" + sforce.apex.execute("DisplaySMSQueueListViewRecords","SedingSMSManullay",
    {msg:"{!Customer__c.Vehicle__c}",phone:"{!Customer__c.Phone__c}"}); 
    
    alert("SMS Sent");

My Apex Class
 
Global class DisplaySMSQueueListViewRecords 
{
    //variables
     @future(Callout=true)
    //Sending SMS Manually
    Webservice static void SedingSMSManullay(String msg,String phone)
    {               
    
                     String mobileNumber=phone;
                      String SendSMSString = msg;     
                        Http h = new Http();
                        HttpRequest req = new HttpRequest();
                        req.setEndpoint('http://bhashsms.in/api/sendmsg.php?user=xxx&pass=123456&sender=xxx&phone='+mobileNumber+'&text='+SendSMSString+'&priority=sdnd&stype=normal');        								
                        req.setHeader('Accept', 'text/xml');
                        req.setHeader('Content-Type' , 'text/plain');
                        req.setMethod('GET');
 						HttpResponse res;
        				if(!Test.isRunningTest())
                        	res = h.send(req);
        				
                       // Responsebody =res.getBody();
                        System.debug('***********'+res);
     }      
 }

Error I am getting when i click the button or execute the class from dev console.
 
00:11:22:020 FATAL_ERROR System.CalloutException: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = http://bhashsms.in/api/sendmsg.php?user=xxx&pass=xxx&sender=xxx&phone=900000003&text=Message&priority=sdnd&stype=normal
I tried adding the Endpoint URL in the Remote Site Setting as "http://bhashsms.com" but it is still throwing the same error. 

Please help
 
Best Answer chosen by Mohammad Azam
@Karanraj@Karanraj
The remote site setting end url should be http://bhashsms.in

All Answers

@Karanraj@Karanraj
The remote site setting end url should be http://bhashsms.in
This was selected as the best answer
Mohammad AzamMohammad Azam
Thanks it worked
Katleen Sulpice 18Katleen Sulpice 18
Hello, I have the same issue, but i can't undestand how to fixe it. could you give me the step by step solution please ?


Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = https://eu40.salesforce.com/insights/internal_api/v1.0/esObject/workflow
Error is in expression '{!updateDataflowNames}' in page datamanager: Class.DataManager_Dataflow.httpGet: line 248, column 1
Class.DataManager_Dataflow.pullDataflows: line 73, column 1
Class.DataManager_controller.updateDataflowNames: line 299, column 1
An unexpected error has occurred. Your development organization has been notified.