Skip to content

API

When your account balance reaches $30, we will automatically grant you access to 'apis'. After granting access, the balance will drop below $30 without affecting the ability to access' apis'

endpoint

The endpoint is the root of the API request, and all API requests need to be initiated through the following endpoints

https://api.smswudi.com/api/v1

Authentication method

`The apiKey can be found in 'My'>'apiKey' and placed in the requested 'header' in the following format:

Authorization: $apiKey

Request&Response

The request method is always' POST ', the' Content Type 'is always' application/JSON', and the response format is' JSON '. The basic format of the interface response is as follows:

{
    "code": 0,
    "msg": "error message",
    "data": { ... }
}
  • If the request is successful, then the 'code' will always be '0'`
  • If the request fails, the first step is to distinguish the response status code of 'http'. If the status code is not equal to '200', the above JSON information may not exist, and the returned error is an internal server error, If the request status code is' 200 'and' code 'is not equal to' 0 ', the program returns an error. The exception information is based on the [Error Code] (# Error Code) list or the' msg 'prompt

User Information Interface

Obtain account balance

  • API Address:
/user/balance
  • Request parameters
json
{}
  • Response parameters
json
{
  "code": 0,
  "msg": "",
  "data": {
    "balance": 0.78,     ### Float type
    "freeze": 1.1        ### Assets being frozen
  }
}

Recharge confirmation

This interface can shorten the recharge to account time. Normally, the server queries the recharge results every 5 minutes. This interface can immediately initiate a query to the blockchain after being called

  • API address
/user/recharge/confirm
  • request

blockHash The recipient address in the parameters must be the correct official receiving address

json
{
  "blockHash": "a3c14ff57d39c3ce05e340b0ebaf1fd2e5f32e5b213428061cccae963d06d6af",   # Transaction hash, which can query transaction details in the blockchain browser
}
  • response
json
{
  "code": 0,
  "msg": "",
  "data": {
    "result": true   # True represents successful recharge, false represents failed recharge or not received, or it may be due to incorrect blcokHash address
  }
}

Public Information Interface

Obtain a list of supported operators

  • API address
/common/platform
  • request
{}
  • response
json
{
  "code": 0,
  "msg": "",
  "data": [
    {
      "id": 1,                  # Platform ID
      "name": "platforms in china"         # name
    },
    {
      "id": 2,
      "name": "platforms out of china"
    }
  ]
}

Get a list of countries/regions

  • API address
/common/area
  • request
json
{
    "platformId": 1 ### The platform ID obtained from the platform interface
}
  • response
json
{
  "code": 0,
  "msg": "",
  "data": [
    {
      "id": 1,              # Country/Region ID
      "name": "美国"         # name
    }
  ]
}

Get a list of supported applications

  • API address
/common/apps
  • request
json
{
    "platformId": 1,  ### The platform ID obtained from the platform interface
    "areaId": 2       ### area id
}
  • response
json
{
  "code": 0,
  "msg": "",
  "data": [
    {
      "id": 1,                   #  appid
      "name": "微信",             # name
      "price":  1.1              # price
    }
  ]
}

Code connection interface

Get mobile phone numbers (in bulk)

After obtaining the phone number, the phone number will be locked for the current app, during which some of the account balance will be frozen. After exceeding the 30 minute limit, the phone number will be reclaimed. After recycling, the unused amount will be returned in the original way, and the used amount will be directly deducted For example, if the account balance is $10, 5 WeChat phone numbers worth $5 are purchased in bulk, the account balance is $5, and the frozen assets are $5, within 30 minutes, 2 successful codes are used and 3 are not used, The final balance is: $7, frozen $0`

  • API address
/mobile/batch
  • request
json
{
    "platformId": 1,        # 平台id
    "areaId":  1,           # 地区id
    "appId":  1,            # 应用id
    "requestNumber": 10    # 请求号码的数量
}
  • response
json
{
  "code": 0,
  "msg": "",
  "data": [
    {
      "id": 1,                      #  sms id
      "mobile": "13800138000",       #  mobile
      "appId": 1,                   # appId
      "appName": "Wechat" ,          # app name
      "areaId": 1,                  #  area id
      "areaName":   "美国",          # area name
      "platformId": 1,               # platform id
      "platformName": "平台名称",           # platform name,
      "status": 1,                  # status ,   1 = reading code in loop,  2 user confirm already send code, 3 already get code, 4  failed to get sms code (timeout)
    }
  ]
}

Confirm the issuance of verification codes

This interface is optional and calling it can make receiving verification codes faster

  • API address
/mobile/confirm
  • request
json
{
    "id": 1,    # Obtain the business ID returned by the phone number
}
  • response
json
{
  "code": 0,
  "msg": "",
  "data": {}
}

Query verification code information

  • API address
/mobile/getcode
  • response
json
{
    "id": 1         # biz id
}
  • 响应
json
{
    "code": 0
    "msg": "",
    "data": {
      "id": 1,
      "mobile": "13800138000",
      "appId": 1,
      "appName": "Wechat" ,
      "areaId": 1,
      "areaName":   "美国",
      "platformId": 1,
      "platformName": "平台名称",
      "status": 1,
      "code": "1234",   # code
      "text": "【腾讯】您正在登录微信账号,验证码是: 1234。请勿告知他人。"  # content
    }
}

Renting a historical phone number again (must have been rented before)

  • API address
/mobile/gethistory
  • request
json
{
  "mobile": "13800138000",
  "appId": 1,
  "platformId": 1,
  "areaId": 1
}
  • response
json
{
  "code": 0,
  "msg": "",
  "data": [
    {
      "id": 1,
      "mobile": "13800138000",
      "appId": 1,
      "appName": "Wechat",
      "areaId": 1,
      "areaName": "美国",
      "platformId": 1,
      "platformName": "平台名称",
      "status": 1
    }
  ]
}

Rental interface

Rent Number (Batch)

Renting a number will not freeze the balance, but will directly deduct the remaining balance of the already rented number. If the number is no longer needed, you can use the termination interface to return the number. The return fee is calculated on a daily basis, and less than 1 day is calculated on a daily basis, 返还费用计算公式为: (total - day * perDayUse) * 0.8 , 也就是需要扣除 20 % 的手续费

The formula for calculating the return fee is: (total - day * perDayUse) * 0.8, which means a handling fee of '20%' needs to be deducted

  • API address
/mobile/rent
  • request
json
{
  "platformId": 1,
  "areaId": 1,
  "type":   1,                  #  1 = day, 2=week , 3= month, 4 = quarter
  "callbackMobile": "13800138000",    # Forwarding number, the received text message will be forwarded to this address,
  "callbackUrl": "https://baidu.com"  # Choose between CallbackMobile and CallbackMobile. After receiving the number, it will call back to this interface to send the number. If it fails, it will retry 3 times The callback format can be found in the callback number parameter section below the document
}
  • 响应参数
json
{
  "code": 0,
  "msg": "",
  "data": [
    {
      "id": 1,                      # rent id
      "mobile": "13800138000",
      "appId": 1,
      "appName": "Wechat" ,
      "areaId": 1,
      "areaName":   "美国",
      "platformId": 1,
      "platformName": "平台名称"
    }
  ]
}
  • The callback method is as follows:
h
POST https://yourcallbackurl.com
Authorization: $apiKey
Content-Type: application/json

{
    "mobile": "13800138000",
    "id": 1                        # rent id
    "code": "1234"                  #  sms code
    "text": "【google】your code is: 1234"
}

Error Code

The following is a list of error codes, which refer to the values of the corresponding 'code' field in the 'json' response of the 'http'

错误码原因
-1params error
401Identity authentication failed
429If the rate of API requests exceeds the account's rated rate, this error will be prompted
500Server error
600There is currently no online phone number available
601Phone number is offline, unable to obtain verification code
602Insufficient user balance
603Exceeded the additional SMS access limit
604Insufficient number of phone numbers, failed to obtain
605Channel ID error, channel does not exist
606Business code error
607Obtaining SMS number timeout
608The account has been banned. Please contact customer service for assistance