我想用twilio api在短信中发送PFFile网址,但是piffle url字符串太长了,有没有办法缩短piffle url?提前感谢
发布于 2016-01-21 20:24:45
Twilio开发者的布道者在这里。
我建议您通过API使用可用的URL缩短工具来缩短URL。为此,我一直使用Bitly。你可以在Bitly dev site上查看他们的应用程序接口。
您可以使用GET请求缩短URL,以:
https://api-ssl.bitly.com/v3/shorten?access_token=ACCESS_TOKEN&longUrl=http%3A%2F%2Fgoogle.com%2F示例中的长url是http://google.com/
响应看起来有点像这样:
{
"data": {
"global_hash": "900913",
"hash": "ze6poY",
"long_url": "http://google.com/",
"new_hash": 0,
"url": "http://bit.ly/ze6poY"
},
"status_code": 200,
"status_txt": "OK"
}You can check out the documentation to the shorten endpoint here。
如果有帮助,请告诉我。
https://stackoverflow.com/questions/34923081
复制相似问题