+ Start a Discussion
Ramesh SomalagariRamesh Somalagari 

Unauthorized endpoint, please check Setup->Security->Remote site settings endpoint

Hi all this my code I got the exception below,I unable to send the SMS twilio API. Please some one help me

**ERROR :** Unauthorized endpoint, please check Setup->Security->Remote site settings endpoint: uerl
Where should I add the twilio URL?

    global class SampleSMSTest
        {  
        @future (callout=true)
        Public static void testsms(){
        try{
        String account = 'xxxxxxxxx';         
        String token = 'xxxxxxxxxx';
        TwilioRestClient client = new TwilioRestClient(account, token);          
        Map<String,String> params = new Map<String,String> {
        'To'   => '+91953835xxxx',
        'From' => '+1920569xxxx',//twilio register number
         'Body' => 'Hello there!'         
          };
           TwilioMessage message = client.getAccount().getMessages().create(params);       
                }catch(exception e){
                system.debug('Main error==========>'+e);}
            }
        }
nbknbk
Have you created the remote site url 'twilio' through this navigation (Setup->Security->Remote site settings endpoint) , if not please add and make it as 'Active'