通用离线升级

  1. 请求地址:POST /sns/update_code

  2. 接口概述:

    使用升级请求串获取升级串。

  3. 请求参数:

    请求参数

    参数名 参数类型 参数说明 必需 备注
    scope string 响应体内容设置 否 支持
    - formatted 格式化升级串

    仅支持请求串,不支持设备码和MAC

  4. 请求体:

    参数名 参数类型 参数说明 必需 备注
    code string 升级请求串 是
  5. 请求示例:

    POST /bitanswer/api/sns/update_code HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    {
       "code":"<requestInfo>...</requestInfo>"
    }

    仅支持请求串,不支持设备码和MAC

  6. 响应示例:

    {
       "status": 0,
       "data": {
           "total": 1,
           "items": [
               {
                   "code": "<updateInfo>...</updateInfo>"
               }
           ]
       }
    }

离线升级(指定)

  1. 请求地址:POST /sns/{sn}/update_code

  2. 接口概述:

    • 支持使用“客户端请求串”激活。
    • 支持使用“MAC地址”激活,服务会记录原始值,在升级串中返回。
    • 支持使用“设备码”激活,服务会记录设备码,在升级串中返回。
    • 支持使用“设备ID”单项升级,或直接升级全部设备。

    同时可以指定设备名称作为备注。

    输入授权码与多个设备,获取批量单向升级串。

  3. 请求参数:

    地址参数

    参数名 参数类型 参数说明 必需 备注
    sn string 授权码 是

    请求参数

    参数名 参数类型 参数说明 必需 备注
    scope string 响应体内容设置 否 支持
    - formatted 格式化升级串
  4. 请求体

    参数名 参数类型 参数说明 必需 备注
    updateAllMachine boolean 升级全部设备 否 不传任何设备,返回SN的所有设备的升级串
    devices array 批量设备 否 传多个设备的升级串进行激活
    machineId integer 设备ID,通过设备接口获得 否 使用设备ID进行单向升级
    code string 升级请求串或设备串 否 通过客户端请求串或设备码进行激活
    mac string MAC地址 否 入参格式为"00-00-00-00-00-00"或["00-00-00-00-00-00","00-00-00-00-00-01"],使用mac进行单向升级
    machineName string 设备名称 否 新设备激活时会生效,为设备添加机器名

    updateAllMachine、devices、machineId、code、mac五选一,按顺序生效,必须存在一种。

    devices

    参数名 参数类型 参数说明 必需 备注
    mac array MAC地址 否 由string类型组成的数组,使用mac进行单向升级,mac和code必须存在一个
    code string 升级请求串或设备串 否 通过客户端请求串或设备码进行激活,mac和code必须存在一个
    machineName string mac 否 新设备激活时会生效,为设备添加机器名
  5. 请求示例:

    使用请求串进行升级,获取升级串(方法一):

    POST /bitanswer/api/sns/{sn}/update_code HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    "<requestInfo>...</requestInfo>"

    使用请求串进行升级,获取升级串(方法二):

    POST /bitanswer/api/sns/{sn}/update_code HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: •••••
    
    { 
       "code":"<requestInfo>...</requestInfo>",
       "machineName": "test"
    }

    使用单个mac进行单向升级,获取升级串(也可用多个mac的传参格式):

    POST /bitanswer/api/sns/{sn}/update_code HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: •••••
    
    { 
       "mac":"00-00-00-00-00-00",
       "machineName": "test"
    }

    使用多个mac进行单向升级,获取升级串:

    POST /bitanswer/api/sns/{sn}/update_code HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: •••••
    
    { 
       "mac":["00-00-00-00-00-00","00-00-00-00-00-01"],
       "machineName": "test"
    }

    使用设备串进行升级,获取升级串(方法一):

    POST /bitanswer/api/sns/{sn}/update_code HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    "BRW1A7  000000000  000000000  000000000  000000000  000000000  000000000"

    使用设备串进行升级,获取升级串(方法二):

    POST /bitanswer/api/sns/{sn}/update_code HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    { 
       "code":"BRW1A7  000000000  000000000  000000000  000000000  000000000  000000000",
       "machineName": "test"
    }

    使用设备ID获取升级串:

    POST /bitanswer/api/sns/{sn}/update_code?scope=formatted HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    { 
      "machineId":1
    }

    获取全部设备的升级串:

    POST /bitanswer/api/sns/{sn}/update_code?scope=formatted HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    { 
      "updateAllMachine":true
    }

    使用多个设备获取批量升级串:

    POST /bitanswer/api/sns/{sn}/update_code HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    { 
       "devices":[
           {"code":"BRW1A7  000000000  000000000  000000000  000000000  000000000  000000000"},
           {"mac":["11:11:11:11:11:11"]},
           {"mac":["00-00-00-00-00-00","00-00-00-00-00-01"]}
       ]
    }
  6. 响应示例:

    使用请求串/单个设备激活/设备ID/获取全部设备时响应示例:

    {
       "status": 0,
       "data": {
           "total": 1,
           "items": [
               {
                   "code": "<updateInfo>...</updateInfo>"
               },
               {
                   "code": "<updateInfo>...</updateInfo>"
               }
           ]
       }
    }

    使用多个设备获取批量升级串时响应示例:

    {
       "status": 0,
       "data": {
           "total": 1,
           "items": [
               {
                   "code": "<bitLicenseList><bitLicense>...</bitLicense><bitLicense>...</bitLicense><bitLicense>...</bitLicense></bitLicenseList>"
               }
           ]
       }
    }

离线借出

  1. 请求地址:POST /sns/checkout

  2. 接口概述:

    使用借出请求串获取借出升级串。

  3. 请求参数:

    请求参数

    参数名 参数类型 参数说明 必需 备注
    scope string 响应体内容设置 否 支持
    - formatted 格式化升级串
  4. 请求体:

    参数名 参数类型 参数说明 必需 备注
    code string 借出请求串 是
  5. 请求示例:

    POST /bitanswer/api/sns/checkout HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    {
       "code":"<borrowRequest>...</borrowRequest>"
    }
  6. 响应示例:

    {
       "status": 0,
       "data": {
           "total": 1,
           "items": [
               {
                   "code": "<borrowResponse>...</borrowResponse>"
               }
           ]
       }
    }

离线归还

  1. 请求地址:POST /sns/checkin

  2. 接口概述:

    使用归还请求串去提前归还借出的授权。

  3. 请求参数:

    请求参数

    参数名 参数类型 参数说明 必需 备注
    scope string 响应体内容设置 否 支持
    - formatted 格式化升级串
  4. 请求体:

    参数名 参数类型 参数说明 必需 备注
    code string 归还请求串 是
  5. 请求示例:

    POST /bitanswer/api/sns/checkin HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    {
       "code":"<borrowRequest>...</borrowRequest>"
    }
  6. 响应示例:

    {
       "status": 0,
       "data": {
           "total": 1,
           "items": [
               {
                   "code": "<borrowResponse>...</borrowResponse>"
               }
           ]
       }
    }

批量离线升级

  1. 请求地址:POST /sns/update_codes

  2. 接口概述:

    批量使用升级请求串获取升级串。

  3. 请求参数:

    请求参数

    参数名 参数类型 参数说明 必需 备注
    scope string 响应体内容设置 否 支持
    - formatted 格式化升级串
  4. 请求体:

    参数名 参数类型 参数说明 必需 备注
    code string 升级请求串 是

    请求体以数组形式输入。

  5. 请求示例:

    批量离线升级

    POST /bitanswer/api/sns/update_codes HTTP/1.1
    Host: back-office-api.bitanswer.cn
    bitkey: ••••••
    Content-Type: application/json
    
    [
     {
       "code": "<requestInfo>...</requestInfo>"
     },
     {
       "code":"<requestInfo>...</requestInfo>"
     }
    ]
  6. 响应示例:

    {
       "status": 1995,
       "data": {
           "total": 2,
           "items": [
               {
                   "0": {
                       "status_code": "0",
                       "code": "<updateInfo>...</updateInfo>",
                       "sn": "0000000000000000"
                   }
               },
               {
                   "1": {
                       "code": "1795",
                       "message": "{\"errorCode\":1795,\"detail\":\"active machine volume: 2 sn volume: 2 \"}"
                   }
               }
           ]
       }
    }

    响应体中status返回0表示离线升级全部成功,返回1995表示批量离线升级中有出错的。

    items中0,1对应请求体传入的数组中下标值,用于匹配输入顺序。

批量离线迁出

  1. 请求地址:POST /sns/update_codes

  2. 接口概述:

    批量使用浮动授权码的迁出请求串进行离线迁出。

  3. 请求参数:

    请求参数

    参数名 参数类型 参数说明 必需 备注
    scope string 响应体内容设置 否 支持
    - formatted 格式化升级串
  4. 请求体:

    参数名 参数类型 参数说明 必需 备注
    code string 升级请求串 是
    disableSn boolean 禁用SN 否 离线迁出的同时禁用当前授权码

    请求体以数组形式输入。

  5. 请求示例:

    POST /bitanswer/api/sns/update_codes HTTP/1.1
    Host: back-office-api.bitanswer.cn
    bitkey: ••••••
    Content-Type: application/json
    
    [
     {
       "code": "<requestInfo>...</requestInfo>",
       "disableSn":true
     }
    ]
  6. 响应示例:

    {
       "status": 0,
       "data": {
           "total": 1,
           "items": [
               {
                   "0": {
                       "status_code": "0",
                       "code": "<updateInfo>...</updateInfo>",
                       "sn": "xxxxxx"
                   }
               }
           ]
       }
    }

    status_code表示请求串的响应状态。

    items中0,1对应请求体传入的数组中下标值,用于匹配输入顺序。

生成升级码

  1. 请求地址:POST /sns/generate_update_code

  2. 接口概述:

    生成SN并产生设备(或mac)的升级串,传入SN则跳过生成SN步骤。

  3. 请求参数:

    请求参数

    参数名 参数类型 参数说明 必需 备注
    scope string 响应体内容设置 否 支持
    - formatted 格式化升级串
  4. 请求体:

    参数名 参数类型 参数说明 必需 备注
    device string 设备码 否 device和mac必须有一个存在
    mac object mac串 否 device和mac必须有一个存在,入参格式为"00-00-00-00-00-00"或数组格式["00-00-00-00-00-00","00-00-00-00-00-01"],使用单个或多个mac进行单向升级
    sn_attribute object 是 结构是授权码


    sn_attribute

    参数名 参数类型 参数说明 必需 备注
    sn string 授权码,用于精确定位 否 传入SN则使用指定SN去生成升级串,否则需要指定产品名、业务名、模板名去产生SN
    startDate string 起始日期 否 yyyy-MM-dd HH:mm:ss
    endDate string 结束日期 否 yyyy-MM-dd HH:mm:ss
    volumeNumber integer 终端限制 否
    expirationDays integer 有效期(天) 否
    usageNumber integer 使用次数 否
    concurrentNumber integer 并发数 否
    usersNumber integer 用户数 否
    maxOfflineMinutes integer 离线时间(分钟) 否 可作为强制认证的时间
    transferVolume integer 转移数 否
    transferNumber integer 转移次数 否
    description string 描述信息 否
    vmDetect boolean 虚拟机检测 否 (选择后不可解除)
    forbidRemoteDesktop boolean 远程桌面检测 否 (选择后不可解除)
    licenseBorrow boolean 授权借出 否 (选择后不可解除)
    accessLog boolean 用量统计 否 仅对集团授权有效(选择后不可解除)
    ignoreUserLimit boolean 忽略用户数 否 仅对集团授权有效(选择后不可解除)
    readonly boolean 授权只读 否 (选择后不可解除)
    distribution boolean 授权分发 否 仅对集团授权有效(选择后不可解除)
    redundant boolean 冗余检查 否 仅对集团授权有效(选择后不可解除)
    namedUser boolean 帐号授权 否 仅对云授权有效(选择后不可解除)
    product object 产品 否 未传SN时需要传产品名,用于产生SN
    business object 业务 否 未传SN时需要传业务名,用于产生SN
    template object 模版 否 未传SN时需要传模板名,用于产生SN
    features array 特征项列表 否 为授权码设置特征项
    data array 配置项列表 否 为授权码设置配置项


    features:用于产生SN

    参数名 参数类型 参数说明 必需 备注
    id long 特征项的uid 否
    guid string 特征项的guid 否
    featureId integer 特征项的fid 否
    name string 特征性的名称 否
    value long 特征性的值 否 特征项的整数值(不含小数点)。当特征项的值为整数时,使用本字段。
    version string 特征性的版本 否 特征项的带小数值(含小数点)。当特征项的值为版本号等带小数的数值时,使用本字段。
    endDate string 结束时间 否
    expirationDays integer 有效期 否
    users integer 用户数 否
    type string 特征项的操作 否 操作类型:OVERRIDE(默认):为授权码勾选并覆盖产品特征项内容,SELECT:为授权码勾选产品的特征项,UNSELECT:为授权码取消勾选模版中的特征项

    确定特征项的方式:

    1、根据特征项的id确定唯一特征项(id存在)

    2、根据特征项的guid确定唯一特征项(guid存在)

    3、根据特征项的名称、特征项版本确定唯一特征项(name存在、version存在)

    4、根据特征项的fid、特征项版本确定唯一特征项(fid存在、version存在)

    5、根据特征项的名称、特征项值确定唯一特征项(name存在、value存在)

    6、根据特征项的名称确定唯一特征项,存在多个则报错(name存在)

    7、根据特征项的fid、特征项值确定唯一特征项,存在多个则报错(fid存在、value存在)

    8、根据特征项的fid确定唯一特征项,存在多个则报错(fid存在)


    data:用于产生SN

    参数名 参数类型 参数说明 必需 备注
    name string 配置项名称 是 存在同名配置项时会覆盖值
    value string 配置项值 否 未传值时表示设置为空
  5. 请求示例:

    产生授权码,使用设备码获取升级码:

    POST /bitanswer/api/sns/generate_update_code HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    {
       "device":"BRW1A7  000000000  000000000  000000000  000000000  000000000  000000000",
       "sn_attribute":{
           "product": {
               "productName": "demo"
           },
           "template": {
               "name": "unitTestTemplate1"
           },
           "business": {
               "name": "business_name"
           }
       }
    }

    产生授权码,使用单个mac获取升级码(也可用多个mac的传参格式):

    POST /bitanswer/api/sns/generate_update_code HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    {
       "mac":"00-00-00-00-00-00",
       "sn_attribute":{
           "product": {
               "productName": "product_name
           },
           "template": {
               "name": "template_name"
           },
           "business": {
               "name": "business_name"
           }
       }
    }

    产生授权码,使用多个mac获取升级码:

    POST /bitanswer/api/sns/generate_update_code HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    {
       "mac":["00-00-00-00-00-00","00-00-00-00-00-01"],
       "sn_attribute":{
           "product": {
               "productName": "product_name"
           },
           "template": {
               "name": "template_name"
           },
           "business": {
               "name": "business_name"
           }
       }
    }

    产生授权码,使用多个设备批量获取升级码:

    POST /bitanswer/api/sns/generate_update_code HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    {
       "devices":[
           {"code":"BRW1A7  000000000  000000000  000000000  000000000  000000000  000000000"},
           {"mac":["11:11:11:11:11:11"]},
           {"mac":["00-00-00-00-00-00","00-00-00-00-00-01"]}
       ],
       "sn_attribute":{
           "product": {
               "productName": "product_name"
           },
           "template": {
               "name": "template_name"
           },
           "business": {
               "name": "business_name"
           }
       }
    }

    指定授权码,使用设备码获取升级码:

    POST /bitanswer/api/sns/generate_update_code HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    {
       "device":"BRW1A7  000000000  000000000  000000000  000000000  000000000  000000000",
       "sn_attribute":{
           "sn": "xxxxxxxxxxxxxxxx"
       }
    }

    指定授权码,使用单个mac获取升级码(也可用多个mac的传参格式):

    POST /bitanswer/api/sns/generate_update_code HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    {
       "mac":"00-00-00-00-00-00",
       "sn_attribute":{
           "sn": "xxxxxxxxxxxxxxxx"
       }
    }

    指定授权码,使用多个mac获取升级码:

    POST /bitanswer/api/sns/generate_update_code HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    {
       "mac":["00-00-00-00-00-00","00-00-00-00-00-01"],
       "sn_attribute":{
           "sn": "xxxxxxxxxxxxxxxx"
       }
    }

    指定授权码,使用多个设备批量获取升级码:

    POST /bitanswer/api/sns/generate_update_code HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    {
       "devices":[
           {"code":"BRW1A7  000000000  000000000  000000000  000000000  000000000  000000000"},
           {"mac":["11:11:11:11:11:11"]},
           {"mac":["00-00-00-00-00-00","00-00-00-00-00-01"]}
       ],
       "sn_attribute":{
           "sn": "xxxxxxxxxxxxxxxx"
       }
    }
  6. 响应示例:

    单个升级串:

    {
       "status": 0,
       "data": {
           "total": 1,
           "items": [
               {
                   "code": "<bitLicense>...</bitLicense>"
               }
           ]
       }
    }

    批量获取多个升级串:

    {
       "status": 0,
       "data": {
           "total": 1,
           "items": [
               {
                   "code": "<bitLicenseList><bitLicense>...</bitLicense><bitLicense>...</bitLicense><bitLicense>...</bitLicense></bitLicenseList>"
               }
           ]
       }
    }

生成Bit-ID升级码

  1. 请求地址:POST /sns/bitid_update_code

  2. 接口概述:

    查询Bit-ID关联的授权码:未绑定则根据请求参数中的产品、模版、业务生成比特ID浮动授权类型的授权码,使用请求体中传入的endSn修改授权码的属性,将授权码绑定浮动的Bit-ID,产生升级串;已绑定授权码则直接产生升级串。

  3. 请求参数:

    参数名 参数类型 参数说明 必需 备注
    productName string 产品名 是
    templateName string 模版名 是
    businessName string 业务名 是 业务必须是比特ID浮动授权类型
    bitIDType integer Bit-ID类型 是 比特ID浮动的类型为6,传固定的值6
    bitIDGuid string Bit-ID 是
    scope string 响应体内容设置 否 支持
    - formatted 格式化升级串
  4. 请求体:

    EndSn(请求体不是必需):

    参数名 参数类型 参数说明 必需 备注
    startDate string 起始日期 否 yyyy-MM-dd HH:mm:ss
    endDate string 结束日期 否 yyyy-MM-dd HH:mm:ss
    volumeNumber integer 终端限制 否
    expirationDays integer 有效期(天) 否
    usageNumber integer 使用次数 否
    concurrentNumber integer 并发数 否
    usersNumber integer 用户数 否
    maxOfflineMinutes integer 离线时间(分钟) 否 可作为强制认证的时间
    transferVolume integer 转移数 否
    transferNumber integer 转移次数 否
    description string 描述信息 否
    accessLog boolean 用量统计 否 仅对集团授权有效(选择后不可解除)
    distribution boolean 授权分发 否 仅对集团授权有效(选择后不可解除)
    ignoreUserLimit boolean 忽略用户数 否 仅对集团授权有效(选择后不可解除)
    redundant boolean 冗余检查 否 仅对集团授权有效(选择后不可解除)
    namedUser boolean 帐号授权 否 仅对云授权有效(选择后不可解除)
    vmDetect boolean 虚拟机检测 否 (选择后不可解除)
    forbidRemoteDesktop boolean 远程桌面检测 否 (选择后不可解除)
    licenseBorrow boolean 授权借出 否 (选择后不可解除)
    readonly boolean 授权只读 否 (选择后不可解除)
  5. 请求示例:

    POST /bitanswer/api/sns/bitid_update_code?product_name={productName}&template_name={templateName}&business_name={businessName}&bitid_type={bitIDType}&bitid_guid={bitIDGuid} HTTP/1.1
    Host: back-office-api.bitanswer.cn
    Content-Type: application/json
    bitkey: ••••••
    
    {
       "startDate":"2024-06-01",
       "endDate":"2024-12-01",
       "expirationDays":30 
    }
  6. 响应示例:

    {
       "status": 0,
       "data": {
           "total": 1,
           "items": [
               {
                   "code": "<bitLicense>...</bitLicense>"
               }
           ]
       }
    }