旭宇IOT 接入文档

概述

旭宇开放平台开放了包括流量卡在线充值、查询、定位、批量划卡、绑定身份认证信息等接口能力。

更新日志

调试接口

接口调用地址:https://openapis.shingsou.com

Note

调试前需准备:

网页调试

  • 点击进入调试页面后,设置subscriptionKey和access_token
  • 根据接口要求,设置Request Parameters
  • 点击Send按钮,发送请求,查看返回结果

桌面调试

Note

桌面调试目前大多数人使用的工具为Postman,所有请先确认安装了Postman for Chrome 或Postman for PC。

  • 进入调试页面,点击 “API definition” >> “Open API”,复制弹出页面的网址
  • 打开Postman,选择 “导入” >> “From Link”,粘贴网址
  • 查看Postman的Collection,选择接口调试即可

错误排查

常见错误:

  • 401 未授权,因为没有传入subscriptionKey或access_token
  • 404 不存在的服务,请求地址错误
  • 500 接口内部错误

获取access_token

Note

获取access_token之前,请先 创建应用 ,然后用client_Id、client_secret 获取access_token。

  • 调用各接口时都需使用access_token。开发者需要进行妥善保存。
  • access_token的有效期目前为24个小时。

平台的API调用所需的access_token使用及生成方式说明:

1、建议开发者使用中控服务器统一获取和刷新access_token,其他业务逻辑服务器所使用的access_token均来自于该中控服务器,不应该各自去刷新,否则容易造成冲突,导致access_token覆盖而影响业务;

2、目前access_token的有效期通过返回的expire_in来传达,目前是3600秒之内的值。中控服务器需要根据这个有效时间提前去刷新新access_token;

3、access_token的有效时间可能会在未来有调整,所以中控服务器不仅需要内部定时主动刷新,还需要提供被动刷新access_token的接口,这样便于业务服务器在API调用获知access_token已超时的情况下,可以触发access_token的刷新流程。

4、获取access_token地址:https://ids.shingsou.com/connect/token

网站应用

1,获取授权码

https请求方式: GET

请求地址:https://ids.shingsou.com/connect/authorize/callback?response_type=&client_id=&redirect_uri=&scope=&state

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
 // 请求参数说明

response_type: code //固定写code

client_id: {client_id} //应用的client_id

// 用户授权后会跳转到这个地址,然后用code换取token
// 回调地址必须合法,需要在开放平台中配置
redirect_uri: {redirect_uri}

// 权限集合,用英文空格分隔
scope: openid profile iot.cardservice.all iot.paymentservice.all

// 必传
state: {随机字符串}

2,获取access_token_

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$(function () {

    var AuthCode='第一步获取到的授权码';
    var client_id = '应用id';
    var client_secret = '应用密钥';
    var redirect_uri= '第一步传入的回调地址';

    var form = new FormData();
    form.append("grant_type", "authorization_code");
    form.append("code", AuthCode);
    form.append("client_id", client_id);
    form.append("client_secret", client_secret);
    form.append("redirect_uri", redirect_uri);

    var settings = {
        "async": true,
        "crossDomain": true,
        "url": "https://ids.shingsou.com/connect/token",
        "method": "POST",
        "headers": {
            "cache-control": "no-cache",
        },
        "processData": false,
        "contentType": false,
        "mimeType": "multipart/form-data",
        "data": form
    }

    $.ajax(settings).done(function (response)
    {
        var resulrJson = JSON.parse(response);
    }).fail(function (err) {
        alert(err.responseText);
     });
});

网站应用 - 示例

您可使用access_token工具直接获取token。 http://ids.shingsou.com/tool

第三方应用

https请求方式: POST

grant_type 是 固定填写 client_credentials

client_Id 是 第三方用户唯一凭证(通过申请获得)

client_secret 是 第三方用户唯一凭证密钥(通过申请获得)

scope 是 填写权限集合。(如:iot.cardservice.all iot.paymentservice.all)

第三方应用 - 示例

Javascript

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var form = new FormData();
form.append("grant_type", "client_credentials");
form.append("client_Id", "{client_Id}");
form.append("client_secret", "{client_secret}");
form.append("scope", "iot.cardservice.all iot.paymentservice.all");

var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://ids.shingsou.com/connect/token",
  "method": "POST",
  "headers": {
    "cache-control": "no-cache"
  },
  "processData": false,
  "contentType": false,
  "mimeType": "multipart/form-data",
  "data": form
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

Java

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW");
RequestBody body = RequestBody.create(mediaType, "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"grant_type\"\r\n\r\nclient_credentials\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"client_Id\"\r\n\r\n{client_Id}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"client_secret\"\r\n\r\n{client_secret}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"scope\"\r\n\r\niot.cardservice.all iot.paymentservice.all\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--");
Request request = new Request.Builder()
  .url("https://ids.shingsou.com/connect/token")
  .post(body)
  .addHeader("content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW")
  .addHeader("cache-control", "no-cache")
  .addHeader("postman-token", "3e8b9126-7452-75ae-89c3-f0989642b29c")
  .build();

Response response = client.newCall(request).execute();

Nodejs

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "ids.shingsou.com",
  "port": null,
  "path": "/connect/token",
  "headers": {
    "content-type": "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
    "cache-control": "no-cache"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write("------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"grant_type\"\r\n\r\nclient_credentials\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"client_Id\"\r\n\r\n{client_Id}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"client_secret\"\r\n\r\n{client_secret}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"scope\"\r\n\r\niot.cardservice.all iot.paymentservice.all\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--");
req.end();

C#

1
2
3
4
5
6
7
var client = new RestClient("https://ids.shingsou.com/connect/token");
var request = new RestRequest(Method.POST);
request.AddHeader("postman-token", "2a34c6bb-6070-e1f9-5516-7e5c901579b7");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW");
request.AddParameter("multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW", "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"grant_type\"\r\n\r\nclient_credentials\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"client_Id\"\r\n\r\n{client_Id}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"client_secret\"\r\n\r\n{client_secret}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"scope\"\r\n\r\niot.cardservice.all iot.paymentservice.all\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

PHP

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php

$request = new HttpRequest();
$request->setUrl('https://ids.shingsou.com/connect/token');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
));

$request->setBody('------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="grant_type"

client_credentials
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="client_Id"

{client_Id}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="client_secret"

{client_secret}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="scope"

iot.cardservice.all iot.paymentservice.all
------WebKitFormBoundary7MA4YWxkTrZu0gW--');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

Python

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
import http.client

conn = http.client.HTTPSConnection("ids.shingsou.com")

payload = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"grant_type\"\r\n\r\nclient_credentials\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"client_Id\"\r\n\r\n{client_Id}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"client_secret\"\r\n\r\n{client_secret}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"scope\"\r\n\r\niot.cardservice.all iot.paymentservice.all\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--"

headers = {
    'content-type': "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
    'cache-control': "no-cache"
    }

conn.request("POST", "/connect/token", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

Go

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package main

import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://ids.shingsou.com/connect/token"

    payload := strings.NewReader("------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"grant_type\"\r\n\r\nclient_credentials\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"client_Id\"\r\n\r\n{client_Id}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"client_secret\"\r\n\r\n{client_secret}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"scope\"\r\n\r\niot.cardservice.all iot.paymentservice.all\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--")

    req, _ := http.NewRequest("POST", url, payload)

    req.Header.Add("content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW")
    req.Header.Add("cache-control", "no-cache")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Object-C

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#import <Foundation/Foundation.h>

NSDictionary *headers = @{ @"content-type": @"multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
                           @"cache-control": @"no-cache",
NSArray *parameters = @[ @{ @"name": @"grant_type", @"value": @"client_credentials" },
                         @{ @"name": @"client_Id", @"value": @"{client_Id}" },
                         @{ @"name": @"client_secret", @"value": @"{client_secret}" },
                         @{ @"name": @"scope", @"value": @"iot.cardservice.all iot.paymentservice.all" } ];
NSString *boundary = @"----WebKitFormBoundary7MA4YWxkTrZu0gW";

NSError *error;
NSMutableString *body = [NSMutableString string];
for (NSDictionary *param in parameters) {
    [body appendFormat:@"--%@\r\n", boundary];
    if (param[@"fileName"]) {
        [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"\r\n", param[@"name"], param[@"fileName"]];
        [body appendFormat:@"Content-Type: %@\r\n\r\n", param[@"contentType"]];
        [body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];
        if (error) {
            NSLog(@"%@", error);
        }
    } else {
        [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
        [body appendFormat:@"%@", param[@"value"]];
    }
}
[body appendFormat:@"\r\n--%@--\r\n", boundary];
NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://ids.shingsou.com/connect/token"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];

cURL

1
2
3
4
5
6
7
8
9
curl -X POST \
https://ids.shingsou.com/connect/token \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-H 'postman-token: c47f7cfd-f478-d57d-5c13-0381885a4877' \
-F grant_type=client_credentials \
-F 'client_Id={client_Id}' \
-F 'client_secret={client_secret}' \
-F 'scope=iot.cardservice.all iot.paymentservice.all'

响应示例

正常情况下,会返回下述JSON数据包:

{“access_token”:”access_token”,”expires_in”:7200,”token_type”:”Bearer”}

资源下载

旭宇物联网开放能力支持大多数语言,您可以自行下载后,稍作修改使用,也可以直接使用包市场的代码包,根据使用说明,开箱即用。

客户端SDK

Note

当您需要使用旭宇物联网能力时,使用客户端SDK。

服务端SDK

Note

当您需要使用旭宇物联网能力,进行二次开发作为服务时,使用服务端SDK。

定制SDK

Note

当您需要定制SDK的代码语法时,可以联系我们,进行SDK定制。

调用示例

Note

如果你希望自行封装调用接口的代码,可以参考接口文档中的示例代码。

包市场

Note

目前支持NPM平台的JS代码包,您也可以共享代码包到旭宇的开放能力包市场。

创建应用

Note

创建应用,根据 获取access_token 教程,用client_id和client_secret获取access_token。

应用权限(默认)

  • openid
  • profile 用户资料
  • iot.cardservice.all 物联卡 - 所有权限
  • iot.paymentservice.all 支付网关 - 所有权限

1,登陆旭宇开放平台

2,创建应用

  • 1,应用名称、网址、介绍都必须填写
  • 2,token有效期默认为1小时,可根据需要改成1年或更久
  • 3,client_secret 设置后请自行妥善保存
_images/registerclient2.png _images/registerclient3.png _images/registerclient4.png

3,Subscripetion Key

_images/registerclient5.png

4,access_token工具

5,支付网关 - SDK下载

支付网关v2

Note

多商户版支付网关:✔支付宝、✔微信支付。订单创建、查询、退款和自定义接收支付通知等操作。

支付宝

电脑网站支付

官方文档:https://docs.open.alipay.com/270 iot.payment.alipay.webpayiot.payment.alipay.webpay

Link


手机网站支付

官方文档:https://docs.open.alipay.com/203 iot.payment.alipay.wappayiot.payment.alipay.wappay

Link


APP支付

官方文档:https://docs.open.alipay.com/204 iot.payment.alipay.apppayiot.payment.alipay.apppay

Link


扫码支付

官方文档:https://docs.open.alipay.com/api_1/alipay.trade.precreate iot.payment.alipay.scanpayiot.payment.alipay.scanpay

Link


条码支付

官方文档:https://docs.open.alipay.com/api_1/alipay.trade.pay iot.payment.alipay.barcodepayiot.payment.alipay.barcodepay

Link


交易查询

官方文档:https://docs.open.alipay.com/api_1/alipay.trade.query iot.payment.alipay.queryiot.payment.alipay.query

Link


交易退款

官方文档:https://docs.open.alipay.com/api_1/alipay.trade.refund iot.payment.alipay.refundiot.payment.alipay.refund

Link


退款查询

官方文档:https://docs.open.alipay.com/api_1/alipay.trade.fastpay.refund.query iot.payment.alipay.refundqueryiot.payment.alipay.refundquery

Link


交易撤销

官方文档:https://docs.open.alipay.com/api_1/alipay.trade.cancel iot.payment.alipay.canceliot.payment.alipay.cancel

Link


交易关闭

官方文档:https://docs.open.alipay.com/api_1/alipay.trade.close iot.payment.alipay.closeiot.payment.alipay.close

Link


单笔转账

官方文档:https://docs.open.alipay.com/api_28/alipay.fund.trans.toaccount.transfer iot.payment.alipay.transferiot.payment.alipay.transfer

Link


转账查询

官方文档:https://docs.open.alipay.com/api_28/alipay.fund.trans.order.query iot.payment.alipay.transferqueryiot.payment.alipay.transferquery

Link


下载对账单

官方文档:https://docs.open.alipay.com/api_15/alipay.data.dataservice.bill.downloadurl.query iot.payment.alipay.billdownloadiot.payment.alipay.billdownload

Link


商户列表

iot.payment.alipay.merchants iot.payment.alipay.merchants

Link


更新商户

iot.payment.alipay.putmerchant iot.payment.alipay.putmerchant

Link


添加商户

iot.payment.alipay.postmerchant iot.payment.alipay.postmerchant

Link


删除商户

iot.payment.alipay.deletemerchant iot.payment.alipay.deletemerchant

Link


微支付

公众号支付

官方文档:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_1 iot.payment.wechatpay.publicpayiot.payment.wechatpay.publicpay

Link


APP支付

官方文档:https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=8_1 iot.payment.wechatpay.apppayiot.payment.wechatpay.apppay

Link


小程序支付

官方文档:https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=7_3 iot.payment.wechatpay.appletpayiot.payment.wechatpay.appletpay

Link


H5支付

官方文档:https://pay.weixin.qq.com/wiki/doc/api/H5.php?chapter=15_1 iot.payment.wechatpay.wappayiot.payment.wechatpay.wappay

Link


扫码支付

官方文档:https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=6_1 iot.payment.wechatpay.scanpayiot.payment.wechatpay.scanpay

Link


条码支付

官方文档:https://pay.weixin.qq.com/wiki/doc/api/micropay.php?chapter=5_1 iot.payment.wechatpay.barcodepayiot.payment.wechatpay.barcodepay

Link


查询订单

iot.payment.wechatpay.query iot.payment.wechatpay.query

Link


申请退款

iot.payment.wechatpay.refund iot.payment.wechatpay.refund

Link


查询退款

iot.payment.wechatpay.refundquery iot.payment.wechatpay.refundquery

Link


关闭订单

iot.payment.wechatpay.close iot.payment.wechatpay.close

Link


撤销订单

iot.payment.wechatpay.cancel iot.payment.wechatpay.cancel

Link


企业付款到零钱

iot.payment.wechatpay.transfer iot.payment.wechatpay.transfer

Link


查询企业付款零钱

iot.payment.wechatpay.transferquery iot.payment.wechatpay.transferquery

Link


获取RSA公钥

iot.payment.wechatpay.publickey iot.payment.wechatpay.publickey

Link


企业付款到银行卡

iot.payment.wechatpay.transfertobank iot.payment.wechatpay.transfertobank

Link


查询企业付款银行卡

iot.payment.wechatpay.transfertobankquery iot.payment.wechatpay.transfertobankquery

Link


下载对账单

iot.payment.wechatpay.billdownload iot.payment.wechatpay.billdownload

Link


下载资金账单

iot.payment.wechatpay.fundflowdownload iot.payment.wechatpay.fundflowdownload

Link


获取OpenId

微支付 - 获取OpenId

Link


小程序登录

官方文档:https://developers.weixin.qq.com/minigame/dev/api/open-api/login/code2Session.html

Link


商户列表

iot.payment.wechatpay.merchants iot.payment.wechatpay.merchants

Link


更新商户

iot.payment.wechatpay.putmerchant iot.payment.wechatpay.putmerchant

Link


添加商户

iot.payment.wechatpay.postmerchant iot.payment.wechatpay.postmerchant

Link


上传支付证书

iot.payment.wechatpay.uploadcert iot.payment.wechatpay.uploadcert 证书类型必须是x-pkcs12,上传成功后返回证书名称

Link


删除商户

iot.payment.wechatpay.deletemerchant iot.payment.wechatpay.deletemerchant

Link


支付网关

Note

支付网关、订单查询

订单

列表

iot.paymentservice.order.get iot.paymentservice.order.get

Link


统计

iot.paymentservice.order.statistic iot.paymentservice.order.statistic

Link


错误码表

订单代码对照表

Link


支付网关

错误码表

支付网关代码对照表

Link


创建支付请求



Link


充值套餐

列表

充值套餐 - 列表

Link


分类

充值套餐 - 分类

Link


物联卡

Note

集三大运营商专为物联网应用提供的流量卡,相比传统的流量卡,物联卡拥有资费低、安全、通信效率高等特点。 解决方案涵盖:车联网、共享单车、视频监控、城市智能路灯、pos机、警用巡逻车、自动售卖机等。

充值卡

列表

iot.cardservice.datacard.get iot.cardservice.datacard.get

Link


充值记录

iot.cardservice.datacard.history iot.cardservice.datacard.history

Link


批量划卡

iot.cardservice.datacard.transfer iot.cardservice.datacard.transfer

Link


制卡

iot.cardservice.datacard.get iot.cardservice.datacard.get

Link


错误码表

充值卡代码对照表

Link


流量卡

列表

iot.cardservice.flowcard.get iot.cardservice.flowcard.get

Link


详情

iot.cardservice.flowcard.get iot.cardservice.flowcard.get

Link


更新

iot.cardservice.flowcard.get iot.cardservice.flowcard.get

Link


批量更新

iot.cardservice.flowcard.get iot.cardservice.flowcard.get

Link


查流量

iot.cardservice.flowcard.get iot.cardservice.flowcard.get

Link


查状态

iot.cardservice.flowcard.get iot.cardservice.flowcard.get

Link


停复机

iot.cardservice.flowcard.get iot.cardservice.flowcard.get

Link


划卡记录

iot.cardservice.flowcard.get iot.cardservice.flowcard.get

Link


划卡

iot.cardservice.flowcard.get iot.cardservice.flowcard.get

Link


导卡记录

iot.cardservice.flowcard.get iot.cardservice.flowcard.get

Link


导卡

iot.cardservice.flowcard.get iot.cardservice.flowcard.get

Link


实名认证

iot.cardservice.flowcard.get iot.cardservice.flowcard.get

Link


类目

iot.cardservice.flowcard.get iot.cardservice.flowcard.get

Link


分类

iot.cardservice.flowcard.get iot.cardservice.flowcard.get

Link


标签

iot.cardservice.flowcard.get iot.cardservice.flowcard.get

Link


错误码表

流量卡代码对照表

Link


定位

iot.cardservice.flowcard.location iot.cardservice.flowcard.location

Link


在线订购套餐

Note

针对有开发能力的合作伙伴,可参考如下方案,将平台的套餐集成到自有平台。

第一步:上架套餐(必须先去平台进行上架操作)

第四步:获取订单列表

案例参考:https://h5.shingsou.com

卡状态表

移动卡

 0: 正常
 1: 单向停机
 1: 停机
 2: 停机
 3: 预销号
 4: 销号
 5: 过户
 6: 休眠
 7: 待激
99: 号码不存在

电信卡

-1: 未知
 1: 在用
 2: 用户报停
 3: 用户拆机
 5: 欠停(双向)
 6: 欠停(单向)
 7: 违章停机
 8: 挂失
 11: 施工未完
 19: 活卡待激活
 120000: 停机
 100001: 已激活(测试期)
 140003: 未激活(测试期)
 150001: 未实名制违规停机
 140000: 预拆机停机
 160000: 数据异常停机
 170000: 局方原因停机

联通卡

 1: 已激活
 2: 已停用
 3: 可测试
 4: 库存
 5: 体验
 6: 可激活
 7: 已失效
 8: 已清除
 9: 
10: 当前账期
11: 一直

权限码表

物联卡

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
  {
    "code": "iot.cardservice.all",
    "name": "所有权限",
  },
  {
    "code": "iot.cardservice.datacard.all",
    "name": "充值卡 - 所有权限",
  },
  {
    "code": "iot.cardservice.datacard.generate",
    "name": "充值卡 - 制卡",
  },
  {
    "code": "iot.cardservice.datacard.transfer",
    "name": "充值卡 - 批量划卡",
  },
  {
    "code": "iot.cardservice.datacard.history",
    "name": "充值卡 - 充值记录",
  },
  {
    "code": "iot.cardservice.datacard.get",
    "name": "充值卡 - 列表",
  },
  {
    "code": "iot.cardservice.flowcard.all",
    "name": "流量卡 - 所有权限",
  },
  {
    "code": "iot.cardservice.flowcard.tags",
    "name": "流量卡 - 标签",
  },
  {
    "code": "iot.cardservice.flowcard.categories",
    "name": "流量卡 - 分类",
  },
  {
    "code": "iot.cardservice.flowcard.types",
    "name": "流量卡 - 类目",
  },
  {
    "code": "iot.cardservice.flowcard.reality",
    "name": "流量卡 - 实名认证",
  },
  {
    "code": "iot.cardservice.flowcard.importhistory",
    "name": "流量卡 - 导卡记录",
  },
  {
    "code": "iot.cardservice.flowcard.import",
    "name": "流量卡 - 导卡",
  },
  {
    "code": "iot.cardservice.flowcard.network",
    "name": "流量卡 - 停复机",
  },
  {
    "code": "iot.cardservice.flowcard.transfer",
    "name": "流量卡 - 划卡",
  },
  {
    "code": "iot.cardservice.flowcard.data",
    "name": "流量卡 - 查流量",
  },
  {
    "code": "iot.cardservice.flowcard.patch",
    "name": "流量卡 - 批量更新",
  },
  {
    "code": "iot.cardservice.flowcard.put",
    "name": "流量卡 - 更新",
  },
  {
    "code": "iot.cardservice.flowcard.detail",
    "name": "流量卡 - 详情",
  },
  {
    "code": "iot.cardservice.flowcard.get",
    "name": "流量卡 - 列表",
  },
  {
    "code": "iot.cardservice.flowcard.transferhistory",
    "name": "流量卡 - 划卡记录",
  },
  {
    "code": "iot.cardservice.flowcard.status",
    "name": "流量卡 - 查状态",
  }

支付网关


linenos:
{
“code”: “iot.paymentservice.order.get”, “name”: “订单 - 列表”,

}, {

“code”: “iot.paymentservice.order.statistic”, “name”: “订单 - 统计”,

}, {

“code”: “iot.paymentservice.order.all”, “name”: “订单 - 所有权限”,

}, {

“code”: “iot.paymentservice.all”, “name”: “所有权限”,

}

错误码表

全局

[{
  "code": 200,
  "name": "Status200OK",
  "description": "ok"
},
{
  "code": 422,
  "name": "UnprocessableEntity",
  "description": "请求实体错误"
},{
  "code": 417,
  "name": "ExpectationFailed",
  "description": "服务器内部错误"
},
{
  "code": 404,
  "name": "NotFound",
  "description": "未找到内容"
}]

流量卡

[{
  "code": 10000,
  "name": "Transfer_ConsigneeIsNotExists",
  "description": "接收人账户不存在"
}, {
  "code": 10001,
  "name": "Transfer_CardIDCanNotBeLessThanOne",
  "description": "卡号不能少于1个"
}, {
  "code": 10002,
  "name": "Generate_ExptimeNeedGreaterThanNow",
  "description": "到期时间必须大于当前时间"
}, {
  "code": 10003,
  "name": "Generate_MaximumOf99999999CardsPerDay",
  "description": "每天最多生成99,999,999张卡"
}]

充值卡

[{
  "code": 10000,
  "name": "Transfer_ConsigneeIsNotExists",
  "description": "接收人账户不存在"
}, {
  "code": 10001,
  "name": "Transfer_CardIDCanNotBeLessThanOne",
  "description": "卡号不能少于1个"
}, {
  "code": 10002,
  "name": "Generate_ExptimeNeedGreaterThanNow",
  "description": "到期时间必须大于当前时间"
}, {
  "code": 10003,
  "name": "Generate_MaximumOf99999999CardsPerDay",
  "description": "每天最多生成99,999,999张卡"
}]

反馈问题

Note

如果遇到以下情况,请及时反馈,以便于修改完善

  • 调用接口报错
  • 接口业务不明白
  • 功能改善
  • 其他
反馈

如果阅读在线帮助文档无法帮助您解决开发过程中遇到的具体问题。

联系电话:400-626-5529

联系邮件:712086838@qq.com

Indices and tables