Including a clickable link in sms message using Twilio -


i have twilio number setup execute webhook when message received. include link in response send user. ie.

please login xyz.com @ https://login.xyz.com/?client=sms&userid=abc

however, when send in reply schema validation error in twilio debugger following message.

warning - 12200  schema validation warning  provided xml not conform twilio markup xml schema. please refer specific error , correct problem. 

this message body:

<response>     <message>please login botler @ 'https://login.xyz.com/?client=twilio&userid=foobar'</message> </response> 

i tried url encoding url , no longer schema validation error link in sms not clickable (it contains of escape characters).

how can send link in sms , have clickable user?

thanks.

solution

after trial , error found solution works. can wrap url in cdata element , passes schema validation , link correctly interpreted phones. example,

<response>     <message>please login botler @ <![cdata[https://login.xyz.com/?client=twilio&userid=foobar]]></message> </response> 

the sms text. device has text , detect link make clickeable.

following doc here problem caused by:

  • misspelled verbs
  • incorrect case verbs
  • misspelled or unknown attributes
  • unknown or unexpected nested elements.

hope help.


Comments