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


  1. Call the API /v2/short_url/shorten.json to generate the short link.
  2. Send SMS via /v2/sms/single_send.json or /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 pass mobile_stat = true. Everyone will receive the  unique custom short url in the SMS. It will help to know who click the short url.
  3. 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


  1. Call the API /v2/short_url/shorten.json to generate the short link
  2. Send SMS via /v2/sms/single_send.json or /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://".
  3. 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.
  4. 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:

PARAMETERTYPEREQUIREDDESCRIPTIONEXAMPLE
apikeystringYesAPIKEY is credentials you can find on the "Account Dashboard" page. It is the string of 32-bit characters.9b11127a9701975c
734b8aee81ee3526
long_urlstringYesLong url. Must be started with http:// or https://https://www.yunpian.com
namestringNoAlias 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:

PARAMETERTYPEDESCRIPIONEXAMPLE
codeinteger0 means success. Other values mean failed.0
msgstringStatus of request."OK"
short_urljsonjson data


short_url parameter:

PARAMETERTYPEDESCRIPION
sidstringThe unique id for short url.
long_urlstringLong url
short_urlstringYunpian's short url
enter_urlstringEnter url.
namestringAlias