3

When I send an SMS to my twilio phone number I see in the logs:

Error : 11200 HTTP retrieval failure Description: An attempt to retrieve content from https://xxx.xxx.com/extapi/twilio-php/twilio.xml.php returned the HTTP status code .

Here is the content of twilio.xml.php:

<?php 
    header("content-type: application/xml");
    echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<Response>
    <Sms>test</Sms>
</Response>
Matt Raines
  • 4,149
  • 8
  • 31
  • 34
B.Kevin
  • 250
  • 3
  • 12

2 Answers2

5

I found the solution. I dissable SSL Certificate Validation in Twilio's account settings.

B.Kevin
  • 250
  • 3
  • 12
  • Hello B.kevin i have disable ssl Certificate but it's not working ERROR : 11200 There was a failure attempting to retrieve the contents of this URL here was a failure attempting to retrieve the contents of this URL – kuldeep Nov 17 '17 at 14:10
  • Hello, its not exactly the same error. Is the file content correct ? – B.Kevin Nov 21 '17 at 12:58
0

From Twilio's docs at https://www.twilio.com/docs/api/twiml/sms

The <Sms> verb sends an SMS message to a phone number during a phone call.

Notice the words 'phone call'.

If what you want is to get a message back when you text to your Twilio number change to

<Response>
    <Message>test</Message>
</Response>

But from your question it also looks like the url is not available. Check by opening your url https://xxx.xxx.com/extapi/twilio-php/twilio.xml.php in a browser. Eventually change https to http.

Also, in the return <?xml version="1.0" encoding="UTF-8"?> should be on the first line.

Alex Baban
  • 11,312
  • 4
  • 30
  • 44
  • I have change the url, replace xxx.xx by test.ogust and now the file is twilio.xml and the content is ` test ` – B.Kevin May 25 '16 at 08:38
  • I don't get anything when I try to browse to your url. I suggest while testing to use a TwiML bin. https://www.twilio.com/blog/2016/05/introducing-native-twiml-bins-powered-by-the-twilio-cloud.html – Alex Baban May 25 '16 at 13:44
  • https://test.ogust.com/extapi/twilio-php/twilio.xml . I just want to get the sms and put in in my database. This is just a try to see if its works. I cant use TwiML bin for this. Regardless of the file i always have an rerror 11200 – B.Kevin May 25 '16 at 13:48
  • I just tested with your url and it works. Try to configure the same url for another phone number at Twilio if you can. I suggested the bin for testing. – Alex Baban May 25 '16 at 13:55
  • Why twilio's logs are inbound request failed Error 11200 HTTP retrieval failure Description An attempt to retrieve content from https://test.ogust.com/extapi/twilio-php/twilio.xml returned the HTTP status code 502. I can see it from my web browser and i dont get the sms response. – B.Kevin May 25 '16 at 13:59
  • Its works with the bin. ill try with an other twilio number – B.Kevin May 25 '16 at 14:03
  • It's documented here https://www.twilio.com/docs/api/errors/11200 Is your phone configuration at Twilio with http or https? Is it with POST or GET? I just configured one of my phone numbers with your url, I tried with two sms and it works. – Alex Baban May 25 '16 at 14:04
  • its https with post method, is it because i'm using a service ? – B.Kevin May 25 '16 at 14:07
  • That's the setting I have with my number and it works. Configure with URL not with "Messaging Service" – Alex Baban May 25 '16 at 14:12
  • I change the twilio's number an it still not working – B.Kevin May 25 '16 at 14:18
  • you are configuring with webhooks/twiml ? – B.Kevin May 25 '16 at 14:31
  • thanks for your help but its still not wirking i dont know what to do. – B.Kevin May 25 '16 at 14:52
  • If it works with the bin, you could try to host your file somewhere else. Also take a look at twimlets https://www.twilio.com/labs/twimlets – Alex Baban May 25 '16 at 14:59
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/112997/discussion-between-b-kevin-and-alex-baban). – B.Kevin May 26 '16 at 08:11