Imaginx
asked on
Use of punctuation in twilio sms api
I have a php script that sends a string that could contain slashes, quotes, anything through Twilio's API ...
Today, I sent one single quote through & now I can't get the service to recognize the body of my messages anymore ...
I've emailed them - but I've PATIENTLY waiting a replay for hours now ... I'm stuck !!
Today, I sent one single quote through & now I can't get the service to recognize the body of my messages anymore ...
I've emailed them - but I've PATIENTLY waiting a replay for hours now ... I'm stuck !!
ASKER
I'll post code today when I'm at work. I'm using urlencode now & I added stripslashes as well to get it to work. It is a REST service.
After the problem I experienced yesterday, I'm nervous of others that could arise ...
After the problem I experienced yesterday, I'm nervous of others that could arise ...
I don't know if this applies to all SMS notifications sent through Twilio, but it seems as if a maximum of 160 characters is allowed; depending on the way Twilio handles incoming REST calls, urlencoded characters can easily break that limit. There are some useful topics in the debug section of their homepage, i.e.:
* Twilio Debugging Interface [1]
* Notification REST API, query for logs [2]
All information found here:
Debugging your application [3]
Good luck and keep us posted!
[1] http://www.twilio.com/user/account/debugger
[2] http://www.twilio.com/docs/api/rest/notification
[3] http://www.twilio.com/docs/errors/
* Twilio Debugging Interface [1]
* Notification REST API, query for logs [2]
All information found here:
Debugging your application [3]
Good luck and keep us posted!
[1] http://www.twilio.com/user/account/debugger
[2] http://www.twilio.com/docs/api/rest/notification
[3] http://www.twilio.com/docs/errors/
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yet again ... Thanks for the direction Ray.
stripslashes works, but it isn't necc if magic_quotes wasn't on.
during the development stage, this is hosted on a shared server.
once it's live (Possibly as early as May 1st.. whew) - we'll take it to a vps where I'll have control over security settings like this one...
stripslashes works, but it isn't necc if magic_quotes wasn't on.
during the development stage, this is hosted on a shared server.
once it's live (Possibly as early as May 1st.. whew) - we'll take it to a vps where I'll have control over security settings like this one...
Thanks for the points - it's a great question, ~Ray
In case you are calling a service via REST, remember to urlencode() [1] data before sending it, i.e.
Open in new window
Could you post a snippet how you are calling the Twilio API inside of your PHP file?