Not shortening URLs with a colon while sending DMs


#1

When I try to send a DM with an URL like:
http://www.mydomain.com/path-to-url_some=:param?utm_medium=twitter&utm_campaign=web_notifications&utm_source=invitation&utm_content=join_link

The API returns an error code 151 (The text of your direct message is over 140 characters), but when I try to send it without the “:param” part, it shorts the link properly and sends the message.


#2

Make sure you encode the “:” character. It should look like this when you POST it: “http%3A%2F%2Fwww.mydomain.com%2Fpath-to-url_some%3D%3Aparam%3Futm_medium%3Dtwitter%26utm_campaign%3Dweb_notifications%26utm_source%3Dinvitation%26utm_content%3Djoin_link”