我想使用twilio api在sms发送PFFile url,但是piffle url字符串太长有没有办法缩短piffle url? 提前致谢
答案 0 :(得分:0)
Twilio开发者传道者在这里。
我建议您使用API之一的可用URL缩短程序来缩短URL。我一直用Bitly来做这件事。您可以在Bitly dev site。
查看其API您可以使用GET请求将网址缩短为:
https://api-ssl.bitly.com/v3/shorten?access_token=ACCESS_TOKEN&longUrl=http%3A%2F%2Fgoogle.com%2F
示例长网址为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
如果有帮助,请告诉我。