SMS Bower API - 集成和文档
API
API 文档
API协议逻辑简述
请求可用电话号码数量的方法 GET_SERVICES
请求号码方法 GET_NUMBER
向 SMSBOWER 服务器发送短信的方法 – PUSH_SMS
请求方法来完成激活 FINISH_ACTIVATION
协议测试
状态表
数据表

API协议逻辑简述

合作伙伴协议旨在通过 API 直接向 SMSBOWER 服务器提供电话号码和传入的短信 .

所有请求都包含参数 - KEY。此密钥由支持人员提供,可在个人账户中使用 .

数量请求 GET_SERVICES, 号码请求 GET_NUMBER 和激活完成

FINISH_ACTIVATION 直接从我们的服务器发送到合作伙伴的服务器 .

格式 URL — https://SMSBOWER 其中 SMSBOWER 可以是 partner.ru:port/SMSBOWER 或 partner.ru/SMSBOWER.php

GET_SERVICES
GET_NUMBER
PUSH_SMS
FINISH_ACTIVATION
SMSBOWER 服务器使用该方法发送电话号码数量请求 GET_SERVICES 大约每10-20秒.
如果您在响应中提供了 count > 0,则会收到一个请求,要求通过该方法分配电话号码 GET_NUMBER
在收到之后 GET_NUMBER 收到请求后,您需要提供符合所有标准的电话号码,并使用指定方式将所有接收的短信转发给我们 PUSH_SMS. 我们需要这样做,以便进行清晰和客观的过滤,并将相关的短信准确传送给客户所需的服务.
在完成与电话号码相关的所有必要任务后,您将通过该方法获得状态 3 FINISH_ACTIVATION. 此状态表示电话号码注册成功,您已获得奖励 已获得奖励.

要求

  • 请求/响应格式:JSON
  • UTF-8 编码
  • 在向 SMSBOWER 服务器发送请求时始终使用 user-agent 头
  • 对所有请求/响应使用 gzip 压缩方法

字段类型:

  • 整数 - 范围从 -2 147 483 648 到 2 147 483 647
  • 无符号整数 - 范围从 0 到 2 147 483 647
  • 长整数 - 范围从 -9 223 372 036 854 775 808 到 9 223 372 036 854 775 807
  • 无符号长整数 - 范围从 0 到 9 223 372 036 854 775 807
  • 货币 - 实数值,最多包含两位小数,例如 177.77 ;
  • 布尔值 - 字面值 true 或 false
  • 字符串 - 无限长度的字符串值

请求可用电话号码数量的方法 GET SERVICES

This request provides us with information about the quantity of phone number for services available for sale .

该POST请求从SMSBOWER服务器传输至合作伙伴服务器。 .

! Please note: If your GSM modem is limited in the number of concurrently active modules, you should provide a count equal to the number of active modules.

请求字段
字段 (Field) 类型 (Type) 是否必填 (Required) 描述 (Description)
action String GET_SERVICES
key String 协议密钥
响应字段
字段 (Field) 类型 (Type) 是否必填 (Required) 描述 (Description)
status String Status of the response (see 状态表)
countryList Array 国家列表
CountryList
字段 (Field) 类型 (Type) 是否必填 (Required) 描述 (Description)
country String Status of the response (see Status Table)
operatorMap* Associative array Key - operator (see 数据表), value - associative array of services **
请求示例
{
     "action": "GET_SERVICES",
     "key": "qwerty123"
}
已复制
答案示例
{
     "countryList":
     [
          {
              "country": "russia",
               "operatorMap":
               {
                    "beeline":
                    {
                         "ok": 15,
                         "wa": 20
                    },
                    "megafon":
                    {
                         "vk": 3,
                         "ok": 10
                    }
               }
          },
          {
               "country": "ukraine",
               "operatorMap":
               {
                    "life":
                    {
                         "vk": 0,
                         "wa": 32
                    }
               }
          }
     ],
     "status": "SUCCESS"
}
已复制

Number request method GET_NUMBER

该请求向我们提供一个电话号码,我们将此号码转交给客户。 .

该POST请求从SMSBOWER服务器传输至合作伙伴服务器。 .

若exceptionPhoneSet数组包含前缀列表(例如44742和44740),则不得提供以这些前缀中任意一个开头的号码。号码的位数不受前缀长度的限制。 不得 提供一个以这些前缀中任意一个开头的号码。号码的位数不受前缀长度的限制。 .

请求字段
字段 (Field) 类型 (Type) 是否必填 (Required) 描述 (Description)
action String GET_NUMBER
key String 状态表
country String 状态表
service String 状态表
operator String 协议密钥
sum Cur 成功注册服务后您将获得的金额
exceptionPhoneSet Array 禁止使用的前缀列表 禁止使用
响应字段
字段 (Field) 类型 (Type) 是否必填 (Required) 描述 (Description)
status String Status of the response (see 状态表)
number Ulong 带国家代码的电话号码
activationId Ulong 合作伙伴系统中的激活ID
call String 该号码是否支持闪存呼叫(Flash call available for number)
voice String 该号码是否支持语音呼叫(Voice call available for number)
请求示例
{
     "action": "GET_NUMBER",
     "key": "qwerty123",
     "country": "russia",
     "operator": "beeline",
     "service": "tg",
     "sum": "20.00"
}
已复制
答案示例
{
      "number": "79156537788",
      "activationId": "36532",
      "status": "SUCCESS",
      "call": "1",
      "voice": "1"
}
已复制
请求示例
{
      "action": "GET_NUMBER",
      "key": "qwerty123",
      "country": "russia",
      "operator": "any",
      "service": "vk",
      "sum": "10",
      "exceptionPhoneSet":
      [
          "7918",
          "79281",
      ]
}
已复制

向 SMSBOWER 服务器发送短信的方法 PUSH_SMS

This POST request is sent from the partner's server to the SMSBOWER server at the address : https://smsbower.online/agent/api/sms

If you receive a response with the status SUCCESS, mark the SMS as successfully delivered in your database and do not send it again . If a status other than SUCCESS is returned, repeat the request with a 10- second delay until you receive a SUCCESS status .

请求示例
字段 (Field) 类型 (Type) 是否必填 (Required) 描述 (Description)
action String PUSH_SMS
key String 协议密钥
smsId Ulong 合作伙伴系统中的短信ID
phone Ulong 接收短信的电话号码(含国家代码)
phoneFrom String 短信发送方名称(可为字母数字或纯数字形式)
text String SMS text
voice Boolean 该请求为闪存呼叫(Flash call)
call Boolean 该请求为语音呼叫(Voice call)
响应字段
字段 (Field) 类型 (Type) 是否必填 (Required) 描述 (Description)
status String Status of the response (see 状态表)
请求示例
{
     "action": "PUSH_SMS",
     "key": "qwerty123",
     "smsId": 1,
     "phone": 447472190082,
     "phoneFrom": "Microsoft",
     "text": "Microsoft access code: 5015"
     "call": "0",
     "voice": "0"
}
已复制
闪存呼叫请求示例
{
     "action": "PUSH_SMS",
     "key": "qwerty123",
     "smsId": 1,
     "phone": 447472190082,
     "phoneFrom": "446756540011",
     "text": "446756540011"
     "call": "1",
     "voice": "0"
}
已复制
语音呼叫请求示例
{
     "action": "PUSH_SMS",
     "key": "qwerty123",
     "smsId": 1,
     "phone": 447472190082,
     "phoneFrom": "446756540011",
     "text": "12345"
     "call": "0",
     "voice": "1"
}
已复制
响应字段
{
      "status": "SUCCESS"
}
已复制

请求方法来完成激活 FINISH_ACTIVATION

This request is transmitted from the SMSBOWER server to the partner's server to complete activation.

POST request initiated from the SMSBOWER to the partner's server.

Activation management is fully controlled by SMSBOWER. Due to factors beyond our control, we may not receive a response from you regarding a successful status change. Therefore, if SMSBOWER sends a repeat activation completion request, you should check for the existence of the activation ID on your end. If the activation exists, send a status of SUCCESS in response.

请求字段
字段 (Field) 类型 (Type) 是否必填 (Required) 描述 (Description)
action String FINISH_ACTIVATION
key String 协议密钥
activationId Ulong 第二次请求中获取的激活ID
status Unit Status of the response (see 状态表)
响应字段
字段 (Field) 类型 (Type) 是否必填 (Required) 描述 (Description)
status String Status of the response (see 状态表)
请求示例
{
     "action": "FINISH_ACTIVATION",
     "key": "qwerty123",
     "activationId": 100,
     "status": 3,
}
已复制
答案示例
{
      "status": "SUCCESS"
}
已复制

协议测试

After implementing the protocol, you need to contact our technical support team, provide the URL, and our staff will conduct testing. If the verification passes all parameters successfully, you will be successfully connected to SMSBOWER .

号码的同步发放

You should handle simultaneous requests properly and not issue numbers repeatedly. For example, if you have 100 numbers for Telegram United Kingdom, and SMSBOWER simultaneously makes 100 requests for Telegram United Kingdom, the partner server should provide 100 unique numbers. If a number is issued multiple times, the test fails .

正确的激活完成

The change in activation status is fully controlled by SMSBOWER. The partner server should 不得 autonomously complete activations.

短信投递验证

Once you receive an SMS, you must immediately forward it to the SMSBOWER server. If you receive a status of SUCCESS, you should not forward the SMS again. However, if you receive a different status, you should retry the request every 10-20 seconds. If an SMS is issued again after receiving a SUCCESS status, the test fails .

字段类型验证

Thoroughly check the field types, specified in this documentation. If this condition is violated, the testing fails .

电话号码中的国家代码

Phone number issuance should be in digital format and include the country code .

号码下发时间验证

You must issue numbers with a delay of less than 3 seconds. If it takes more than 3 seconds, the testing fails .

号码数量验证

If you issue 1000 numbers in a request for quantity of numbers, but only 100 are issued at the same time, then testing has failed .

异常处理验证

If you incorrectly handle exceptions for issuing a number, then testing has failed .

Response status
状态 描述 (Description)
SUCCESS The request was finished successfully
ERROR Error during request execution. The ERROR field should be filled with a description
NO_NUMBER No numbers are available. This response is only returned for a request number.
激活状态
状态 描述 (Description)
1 Issuing a number for this service is prohibited
3 Activation was successfully sold. You have received a reward
4 Activation was canceled*
5 Activation has been returned. The customer has been refunded for the activation. It's possible that this number was previously registered, and two-factor authentication may be enabled on the number

* The mechanism for cancellation works as follows: If a phone number has been canceled 5 times, you should not issue the same number again. It's possible that the number was not suitable for the client or was already registered for the specific service.

请求成功响应
{
     "status": "SUCCESS",
     //Information
}
已复制
错误情况下的响应
{
      "status": "ERROR",
      "error": "Description of the error"
}
已复制

数据表

国家列表

The full list of countries with names and IDs can be found at the link https://smsbower.org /api#countries.

运营商列表

At the moment, the breakdown by operators is under development, so you should pass the value any. Once this functionality is implemented, we will notify you through the technical support chat .

服务列表

The full list of services with names and IDs can be found at the link https://smsbower.org /api#services

Example Postman