Google Voice: {“ok”:false,”data”:{“code”:20}} and (500) Server Error
by Matthew Sullivan on Dec 29, 2009, under Google Voice Coding
So I’ve been coding away on Google Voice Easy SMS lately (a program to send free text messages via Google Voice). I’ve found out something the hard way, hopefully know someone else won’t have to!
When my app would try to send a message to Google, for some people Google would reply with:
{“ok”:false,”data”:{“code”:20}}
or…
{ok:false,data:{code:20}}
or…
(500) Server Error
So what was the problem? Read on. It gets technical from here, just FYI…
My app does this to SMS someone:
POST https://www.google.com/voice/sms/send/
auth=GOOGLE_AUTH_STRING&phoneNumber=PHONE_NUMBER_TO_SMS&text=MY MESSAGE&_rnr_se=GOOGLE_KEY
Google wants phoneNumber, text, and _rnr_se to be URL encoded. For instance ‘text=my message’ becomes ‘text=my%20message’. Most programming languages have some library or class already built to do the job automatically. If you want or need more details on that, just e-mail me.
My problem was that I was not URL encoding the value of _rnr_se and that causes Google to spew either one of the two errors mentioned above. In my defense, I thought the value of _rnr_se was always alphanumeric and therefore didn’t need URL encoding. It took me about 10 hours to figure out the problem; hopefully anyone else with that issue finds this post first!
January 4th, 2010 on 5:19 pm
Mr. Sullivan, you are a genius.
January 15th, 2010 on 4:37 pm
So shall we expect a 1.2 coming soon which detects/fixes this outgoing quiet failure issue that happens sometimes? Great stuff, thanks for your work!
March 16th, 2010 on 1:28 pm
Thank you so much for all your hard work! This is a great app but I keep getting a message after 2 texts that it was not able to send…Any suggestions? Thank you again for all your work!
May 22nd, 2010 on 7:12 am
Hello,
I found your soft yesterday on openmarket website.
I installed it , but I get an error corresponding approximately to the error above :
Communication error; Unable to get value of ‘_rnr_se’ key.
What should I do to solve it ?
Thanks in advance & good week end.
Stéphane LAUNAY