We provide two ways to count short link clicks.
“Count short link clicks by mobile number” help you to know which specific users click on short links.
“Count total clicks" helps you to know the how many persons click the short links.
Only V2 API is supported.
Count short link clicks by mobile number
- Call the API
/v2/short_url/shorten.jsonto generate the short link. - Send SMS via
/v2/sms/single_send.jsonor/v2/sms/batch_send.json. The content should be contained the generated short link. e.g. "【Yunpian】Please click dx5.cn/YUNpian.". The short link can be not contained with"http://". Please passmobile_stat = true. Everyone will receive the unique custom short url in the SMS. It will help to know who click the short url. - Login Yunpian to check statistics. It will be updated about every 10 minutes. You can find it in the Chinese SMS – Statistic – Click statistic. You will find the users' mobile number in the excel sheet.
Or you can get the data via '/v2/short_url/clicked '.
Count total clicks
- Call the API
/v2/short_url/shorten.jsonto generate the short link - Send SMS via
/v2/sms/single_send.jsonor/v2/sms/batch_send.json. The content should be contained the generated short link. For example,【Yunpian】Please click dx5.cn/YUNpian. The short link can be not contained with"http://". - Login https://www.yunpian.com/ to check statistics. It will be updated every 10 minutes. You can find it in the Chinese SMS – Statistic – Click statistic.
- Get the statistical data from/ v2/short_url/stat.json.
HTTP Header:
Accept: application/json;charset=utf-8; Content-Type:application/x-www-form-urlencoded;charset=utf-8;
Generate Short Link
URL: https://sms.yunpian.com/v2/short_url/shorten.json
Request:
Method: POST
Request Parameter:
| PARAMETER | TYPE | REQUIRED | DESCRIPTION | EXAMPLE |
| apikey | string | Yes | APIKEY is credentials you can find on the "Account Dashboard" page. It is the string of 32-bit characters. | 9b11127a9701975c 734b8aee81ee3526 |
| long_url | string | Yes | Long url. Must be started with http:// or https:// | https://www.yunpian.com |
| name | string | No | Alias for the short url. It is 02-27 11:11生产的短链接 by default. | yunpian |
Response:
JSON Representations:
{ "code": 0, "msg": "OK", "short_url": { "enter_url": "https://dx5.cn/YRDOnF", "short_url": "https://dx5.cn/YRDOnF", "name": "2021-03-31 10:29:39 创建的短链", "sid": "YRDOnF", "long_url": "https://www.yunpian.com/" } }
JSON Representations:
| PARAMETER | TYPE | DESCRIPION | EXAMPLE |
| code | integer | 0 means success. Other values mean failed. | 0 |
| msg | string | Status of request. | "OK" |
| short_url | json | json data |
short_url parameter:
| PARAMETER | TYPE | DESCRIPION |
| sid | string | The unique id for short url. |
| long_url | string | Long url |
| short_url | string | Yunpian's short url |
| enter_url | string | Enter url. |
| name | string | Alias |

