会员中心服务 API

会员中心服务API围绕企业员工管理和员工产品权限分配提供服务,请先创建应用申请 auth_me(授权会员中心模块)scope并获取审批后再使用。

1、添加员工

请求

POST https://apigate.glodon.com/me/api/v1/enterprise/{enterpriseGlobalId}/member?g_nonce=xxx

说明

在指定企业账号下批量添加员工,一次性添加不能超过100个。

header 参数

参数名 必选 类型 描述
Authorization String Bearer clientToken.
clientToken String 根据appkey和appsecret获取的accessToken,参考用户中心获取AccessToken,grant_type取值为client_credentials
userToken String 用户登录获取的accessToken,参考用户中心获取AccessToken,grant_type取值为password
Content-Type String application/json

path 参数

参数名 必选 类型 描述
enterpriseGlobalId String 企业主账号GlobalId

query 参数

参数名 必选 类型 描述
g_nonce String 防重放随机串

body 参数

参数名 必选 类型 描述
userList 对象数组 企业子账号列表
userName String 账号名称(只允许字母和数字),注册时系统会自动在后面拼接企业代码(账号名与企业代码加起来字符数必须小于63)
password String 初始密码
departmentId Long 归属部门id
name String 用户姓名 (最长30位)
remark String 备注 (最长200)
passwordMobile String 密保手机,用户找回密码,不能用于登录

示例

{
    "userList": [{
        "userName": "xxx",
        "password": "xxx",
        "departmentId": 1,
        "name": "xxx",
        "remark": "xxx",
        "passwordMobile": "xxx"
    },
    {
        "userName": "xxx",
        "password": "xxx",
        "departmentId": 1,
        "name": "xxx",
        "remark": "xxx",
        "passwordMobile": "xxx"
    }]
}

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "body 参数");
Request request = new Request.Builder()
  .url("https://apigate.glodon.com/me/api/v1/enterprise/{enterpriseGlobalId}/member?g_nonce=xxx")
  .post(body)
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("clientToken", "XXXXXXXX")
  .addHeader("userToken", "XXXXXXXX")
  .addHeader("content-type", "application/json")
  .build();

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

成功返回结果

{
    "code": 0,
    "message": "success",
    "data": {
        "succeeded": [
            {
                "id": 1260628957136352,
                "userId": 6357051057240272929,
                "globalId": "6357051057240272929",
                "enterpriseId": 6339382805877858516,
                "departmentId": null,
                "departmentName": null,
                "userName": "测试账号@liuyjTest",
                "name": "测试姓名",
                "remark": null,
                "deleted": false,
                "updateTime": 1515639113000,
                "createTime": 1515639113000
            }
        ],
        "failed": [
            {
                "userName": "测试账号",
                "message": "错误原因"
            }
        ]
    }
}

异常返回结果

{"code":"60000","message":"应用Token校验不正确,请检查token是否失效或者对应的资源操作权限后,再重试","cause":"xxxx"}
{"code":"60005","message":"无效的用户登录token,请检查token是否失效后,再重试","cause":"xxxx"}
{"code":"40000","message":"参数不能为空","cause":"xxxx"}
{"code":"40021","message":"员工列表不能为空","cause":"xxxx"}
{"code":"60013","message":"上传的数量超过最大限制数100","cause":"xxxx"}
{"code":"40008","message":"账号不能为空","cause":"xxxx"}
{"code":"40001","message":"密码不能为空","cause":"xxxx"}
{"code":"40009","message":"分组id不能为空","cause":"xxxx"}
{"code":"40022","message":"姓名不能为空","cause":"xxxx"}
{"code":"50003","message":"密码长度介于{0}-{1}位","cause":"xxxx"}
{"code":"30002","message":"姓名超长","cause":"xxxx"}
{"code":"30003","message":"备注超长","cause":"xxxx"}
{"code":"10003","message":"账号只能包含字母数字","cause":"xxxx"}
{"code":"10004","message":"请输入正确的手机号","cause":"xxxx"}
{"code":"40006","message":"企业后缀不能为空","cause":"xxxx"}
{"code":"60009","message":"当前企业账户最多只允许新建{0}个试用成员账户","cause":"xxxx"}
{"code":"60027","message":"部分员工添加失败(该响应下,会将成功用户和失败用户都在数据体中返回)
","cause":"xxxx"}
{"code":"80001","message":"用户中心异常信息","cause":"xxxx"}
{"code":"70001","message":"安全校验不通过","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

2、编辑员工

请求

PUT https://apigate.glodon.com/me/api/v1/enterprise/{enterpriseGlobalId}/member/{memberGlobalId}?g_nonce=xxx

说明

修改指定企业账号下指定员工的信息,包括:姓名,归属部门ID,备注,密保手机。

header 参数

参数名 必选 类型 描述
Authorization String Bearer clientToken.
clientToken String 根据appkey和appsecret获取的accessToken,参考用户中心获取AccessToken,grant_type取值为client_credentials
userToken String 用户登录获取的accessToken,参考用户中心获取AccessToken,grant_type取值为password
Content-Type String application/json

path 参数

参数名 必选 类型 描述
enterpriseGlobalId String 企业主账号GlobalId
memberGlobalId String 员工globalID

query 参数

参数名 必选 类型 描述
g_nonce String 防重放随机串

body 参数

参数名 必选 类型 描述
userName String 账号名称(只允许字母和数字),注册时系统会自动在后面拼接企业代码(账号名与企业代码加起来字符数必须小于63)
departmentId Long 归属部门id
name String 用户姓名 (最长30位)
remark String 备注 (最长200)
passwordMobile String 密保手机,用户找回密码,不能用于登录

示例

{
    "userName": "xxx",
    "departmentId": 1,
    "name": "xxx",
    "remark": "xxx",
    "passwordMobile": "xxx"
}

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "body 参数");
Request request = new Request.Builder()
  .url("https://apigate.glodon.com/me/api/v1/enterprise/{enterpriseGlobalId}/member/{memberGlobalId}?g_nonce=xxx")
  .put(body)
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("clientToken", "XXXXXXXX")
  .addHeader("userToken", "XXXXXXXX")
  .addHeader("content-type", "application/json")
  .build();

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

成功返回结果

{
    "code": 0,
    "message": "success",    
    "data": null
}

异常返回结果

{"code":"60000","message":"应用Token校验不正确,请检查token是否失效或者对应的资源操作权限后,再重试","cause":"xxxx"}
{"code":"60005","message":"无效的用户登录token,请检查token是否失效后,再重试","cause":"xxxx"}
{"code":"60002","message":"未找到该用户","cause":"xxxx"}
{"code":"40000","message":"参数不能为空","cause":"xxxx"}
{"code":"30002","message":"姓名超长","cause":"xxxx"}
{"code":"30003","message":"备注超长","cause":"xxxx"}
{"code":"80001","message":"用户中心异常信息","cause":"xxxx"}
{"code":"70001","message":"安全校验不通过","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

3、重置密码

请求

PUT https://apigate.glodon.com/me/api/v1/enterprise/{enterpriseGlobalId}/member/{memberGlobalId}/resetPassword?g_nonce=xxx

说明

重置指定企业账号下指定员工的密码。

header 参数

参数名 必选 类型 描述
Authorization String Bearer clientToken.
clientToken String 根据appkey和appsecret获取的accessToken,参考用户中心获取AccessToken,grant_type取值为client_credentials
userToken String 用户登录获取的accessToken,参考用户中心获取AccessToken,grant_type取值为password
Content-Type String application/json

path 参数

参数名 必选 类型 描述
enterpriseGlobalId String 企业主账号GlobalId
memberGlobalId String 员工globalID

query 参数

参数名 必选 类型 描述
g_nonce String 防重放随机串

body 参数

参数名 必选 类型 描述
password String 新密码

示例

{
    "password": "xxx"
}

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "body 参数");
Request request = new Request.Builder()
  .url("https://apigate.glodon.com/me/api/v1/enterprise/{enterpriseGlobalId}/member/{memberGlobalId}/resetPassword?g_nonce=xxx")
  .put(body)
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("clientToken", "XXXXXXXX")
  .addHeader("userToken", "XXXXXXXX")
  .addHeader("content-type", "application/json")
  .build();

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

成功返回结果

{
    "code": 0,
    "message": "success",    
    "data": null
}

异常返回结果

{"code":"60000","message":"应用Token校验不正确,请检查token是否失效或者对应的资源操作权限后,再重试","cause":"xxxx"}
{"code":"60005","message":"无效的用户登录token,请检查token是否失效后,再重试","cause":"xxxx"}
{"code":"60002","message":"未找到该用户","cause":"xxxx"}
{"code":"40000","message":"参数不能为空","cause":"xxxx"}
{"code":"40001","message":"密码不能为空","cause":"xxxx"}
{"code":"50003","message":"密码长度介于{0}-{1}位","cause":"xxxx"}
{"code":"80001","message":"用户中心异常信息","cause":"xxxx"}
{"code":"70001","message":"安全校验不通过","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

4、删除员工

请求

DELETE https://apigate.glodon.com/me/api/v1/enterprise/{enterpriseGlobalId}/member/{memberGlobalId}?g_nonce=xxx

说明

删除指定企业账号下指定员工。

header 参数

参数名 必选 类型 描述
Authorization String Bearer clientToken.
clientToken String 根据appkey和appsecret获取的accessToken,参考用户中心获取AccessToken,grant_type取值为client_credentials
userToken String 用户登录获取的accessToken,参考用户中心获取AccessToken,grant_type取值为password

path 参数

参数名 必选 类型 描述
enterpriseGlobalId String 企业主账号GlobalId
memberGlobalId String 员工globalID

query 参数

参数名 必选 类型 描述
g_nonce String 防重放随机串

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://apigate.glodon.com/me/api/v1/enterprise/{enterpriseGlobalId}/member/{memberGlobalId}?g_nonce=xxx")
  .delete()
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("clientToken", "XXXXXXXX")
  .addHeader("userToken", "XXXXXXXX")
  .build();

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

成功返回结果

{
    "code": 0,
    "message": "success",    
    "data": null
}

异常返回结果

{"code":"60000","message":"应用Token校验不正确,请检查token是否失效或者对应的资源操作权限后,再重试","cause":"xxxx"}
{"code":"60005","message":"无效的用户登录token,请检查token是否失效后,再重试","cause":"xxxx"}
{"code":"60002","message":"未找到该用户","cause":"xxxx"}
{"code":"80001","message":"用户中心异常信息","cause":"xxxx"}
{"code":"70001","message":"安全校验不通过","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

5、查询员工列表

请求

GET https://apigate.glodon.com/me/api/v1/enterprise/{enterpriseGlobalId}/members?g_nonce=xxx&pageNum=xxx&pageSize=xxx

说明

分页查询指定企业账号下的员工信息。

header 参数

参数名 必选 类型 描述
Authorization String Bearer clientToken.
clientToken String 根据appkey和appsecret获取的accessToken,参考用户中心获取AccessToken,grant_type取值为client_credentials
userToken String 用户登录获取的accessToken,参考用户中心获取AccessToken,grant_type取值为password

path 参数

参数名 必选 类型 描述
enterpriseGlobalId String 企业主账号GlobalId

query 参数

参数名 必选 类型 描述
g_nonce String 防重放随机串
departmentId Long 归属部门id
keyword String 员工姓名或者账号
pageNum Integer 页码
pageSize Integer 每页数据量

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://apigate.glodon.com/me/api/v1/enterprise/{enterpriseGlobalId}/members?g_nonce=xxx&pageNum=1&pageSize=20")
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("clientToken", "XXXXXXXX")
  .addHeader("userToken", "XXXXXXXX")
  .build();

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

成功返回结果

{
    "code": 0,
    "message": "success",
    "data": {
        "pageNum": "int,页码",
        "pageSize": "int,每页数量",
        "size": "int,本页数据数量",
        "orderBy": null,
        "startRow": "int,数据起始行",
        "endRow": "int,数据结束行",
        "total": "int,总数量",
        "pages": "int,总页数",
        "list": [
            {
                "id": "string,员工ID",
                "userId": "6658973520209625969",
                "globalId": "string,员工globalId",
                "enterpriseId": "string,企业主账号id",
                "departmentId": "long,归属部门id",
                "departmentName": "string,归属部门名称",
                "userName": "string,账号名称",
                "passwordMobile": "string,密保手机",
                "name": "string,用户姓名",
                "assetNums": ["string,资产编号"],
                "borrowNum": "string,借出锁", 
                "onlineFlag": "boolean,是否联网使用状态", 
                "remark": "string,备注",
                "deleted": "boolean,是否删除",
                "updateTime": "long,更新时间",
                "createTime": "long,更新时间",
                "boundUserInfo": null
            }
        ],
        "firstPage": "int,首页页码",
        "prePage": "int,前一页页码",
        "nextPage": "int,后一页页码",
        "lastPage": "int,尾页页码",
        "isFirstPage": "boolean,是否第一页",
        "isLastPage": "boolean,是否最后一页",
        "hasPreviousPage": "boolean,是否有前一页",
        "hasNextPage": "boolean,是否有下一页",
        "navigatePages": 8,
        "navigatepageNums": [
            1
        ]
    }
} 

异常返回结果

{"code":"60000","message":"应用Token校验不正确,请检查token是否失效或者对应的资源操作权限后,再重试","cause":"xxxx"}
{"code":"60005","message":"无效的用户登录token,请检查token是否失效后,再重试","cause":"xxxx"}
{"code":"40000","message":"参数不能为空","cause":"xxxx"}
{"code":"80001","message":"用户中心异常信息","cause":"xxxx"}
{"code":"70001","message":"安全校验不通过","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

6、查询企业资产编号

请求

GET https://apigate.glodon.com/me/api/v1/enterprise/{enterpriseGlobalId}/asset/assetNums?g_nonce=xxx

说明

查询指定企业账号下的所有资产编号信息。

header 参数

参数名 必选 类型 描述
Authorization String Bearer clientToken.
clientToken String 根据appkey和appsecret获取的accessToken,参考用户中心获取AccessToken,grant_type取值为client_credentials
userToken String 用户登录获取的accessToken,参考用户中心获取AccessToken,grant_type取值为password

path 参数

参数名 必选 类型 描述
enterpriseGlobalId String 企业主账号GlobalId

query 参数

参数名 必选 类型 描述
g_nonce String 防重放随机串

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://apigate.glodon.com/me/api/v1/enterprise/{enterpriseGlobalId}/asset/assetNums?g_nonce=xxx")
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("clientToken", "XXXXXXXX")
  .addHeader("userToken", "XXXXXXXX")
  .build();

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

成功返回结果

{
    "code": 0,
    "message": "success",
    "data": [
        {
            "assetNum": "string,资产编号",
            "assetId": "string,资产ID",
            "cloudAccountGlobalId": "string,员工globalID",
            "borrowedFlag": "boolean,借出标识,true标识已借出,false标识未借出",
            "onlineFlag": "boolean,联网标识,true标识已联网使用,false标识未联网使用"
        },
        {
            "assetNum": "YSA8000005022",
            "assetId": "11c069bafc774be4bbde25782750a3ee",
            "cloudAccountGlobalId": null,
            "borrowedFlag": true,
            "onlineFlag": true
        }
    ]
}

异常返回结果

{"code":"60000","message":"应用Token校验不正确,请检查token是否失效或者对应的资源操作权限后,再重试","cause":"xxxx"}
{"code":"60005","message":"无效的用户登录token,请检查token是否失效后,再重试","cause":"xxxx"}
{"code":"60017","message":"当前账号未绑定授权客户","cause":"xxxx"}
{"code":"70001","message":"安全校验不通过","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

7、查询资产编号下的产品

请求

GET https://apigate.glodon.com/me/api/v1/enterprise/asset/{assetId}/merchandiseProducts?g_nonce=xxx

说明

查询归属于指定资产编号下的所有产品与商品信息。

header 参数

参数名 必选 类型 描述
Authorization String Bearer clientToken.
clientToken String 根据appkey和appsecret获取的accessToken,参考用户中心获取AccessToken,grant_type取值为client_credentials
userToken String 用户登录获取的accessToken,参考用户中心获取AccessToken,grant_type取值为password

path 参数

参数名 必选 类型 描述
assetId String 资产编号id

query 参数

参数名 必选 类型 描述
g_nonce String 防重放随机串

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://apigate.glodon.com/me/api/v1/enterprise/asset/{assetId}/merchandiseProducts?g_nonce=xxx")
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("clientToken", "XXXXXXXX")
  .addHeader("userToken", "XXXXXXXX")
  .build();

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

成功返回结果

{
    "code": 0,
    "message": "success",
    "data": {
        "productInstanceList": [
            {
                "id": "string,产品id",
                "licenseType": "string,授权类型",
                "customerId": "string,客户id",
                "assetId": "string,资产id",
                "assetInsId": "string,资产实例id",
                "merchandiseInsId": "string,商品实例id",
                "assetNum": "string,资产编号",
                "productUri": "string,产品全局唯一标识",
                "gmsPid": "string,兼容工具类产品id",
                "appKey": "string,兼容webApp的appkey",
                "productName": "string,产品名称",
                "channelCode": "string,渠道编码",
                "licenseOrderId": "string,授权订单ID",
                "channelOrderId": "string,渠道订单ID",
                "limitStartTime": "long,有效期开始时间",
                "limitEndTime": "long,有效期结束时间",
                "limitAmount": "int,消费额",
                "limitConcurrent": "int,并发节点数",
                "limitTimeDuration": "long,累计使用时长",
                "trial": "short,1:试用 0:非试用",
                "trialEndDate": "long,试用结束时间",
                "limitType": "string,限制类型:basic(基本限制),feature(扩展授权点限制)",
                "prodDefExtend": "boolean,是否具有产品的扩展定义 0=没有 1=有",
                "timeDurationExpression": "string,时间表达式",
                "srcLicenseOrderId": "string,源授权订单ID",
                "createTime": "long,创建时间",
                "updateTime": "long,更新时间",
                "activateFlag": "boolean,激活标识 0:未激活 1:已激活",
                "crmProductId": "string,crm产品唯一标识",
                "productExtendInstanceList": []
            },
            {
                "id": 451007192965836810,
                "licenseType": "cloud_customer",
                "customerId": "4b4717fee1214a97b55b6fc42fa24ecb",
                "assetId": null,
                "assetInsId": null,
                "merchandiseInsId": null,
                "assetNum": null,
                "productUri": "42430",
                "gmsPid": "42430",
                "appKey": "",
                "productName": "广联达造价云管理平台名3",
                "channelCode": "auth.glodon.com",
                "licenseOrderId": "bb363b2f0e0d420e96d9eedc5545abdb",
                "channelOrderId": "1-20200424001",
                "limitStartTime": 1556380800000,
                "limitEndTime": 1588003200000,
                "limitAmount": 0,
                "limitConcurrent": 1,
                "limitTimeDuration": 0,
                "trial": 0,
                "trialEndDate": null,
                "limitType": "basic",
                "prodDefExtend": false,
                "timeDurationExpression": null,
                "srcLicenseOrderId": null,
                "createTime": 1587694961000,
                "updateTime": null,
                "activateFlag": true,
                "crmProductId": "1-5YQ0SU",
                "productExtendInstanceList": []
            }
        ],
        "children": [
            {
                "id": 451007192965836800,
                "licenseType": "cloud_customer",
                "merchandiseNum": "12321985950",
                "merchandiseName": "北京:云计价5.0(全专业)+图形算量+钢筋算量",
                "parentId": null,
                "parentMerchandiseNum": "12321985950",
                "customerId": "4b4717fee1214a97b55b6fc42fa24ecb",
                "licenseOrderId": "bb363b2f0e0d420e96d9eedc5545abdb",
                "channelOrderId": "1-20200424001",
                "createTime": 1587694961000,
                "updateTime": null,
                "channelCode": "auth.glodon.com",
                "timeDurationExpression": null,
                "srcLicenseOrderId": null,
                "children": [
                    {
                        "id": 451007192965836801,
                        "licenseType": "cloud_customer",
                        "merchandiseNum": "12321159723",
                        "merchandiseName": "北京:云计价(全专业)-含5.0全模块",
                        "parentId": 451007192965836800,
                        "parentMerchandiseNum": "12321159723",
                        "customerId": "4b4717fee1214a97b55b6fc42fa24ecb",
                        "licenseOrderId": "bb363b2f0e0d420e96d9eedc5545abdb",
                        "channelOrderId": "1-20200424001",
                        "createTime": 1587694961000,
                        "updateTime": null,
                        "channelCode": "auth.glodon.com",
                        "timeDurationExpression": null,
                        "srcLicenseOrderId": null,
                        "children": null,
                        "productInstanceList": [
                            {
                                "id": 451007192965836803,
                                "licenseType": "cloud_customer",
                                "customerId": "4b4717fee1214a97b55b6fc42fa24ecb",
                                "assetId": null,
                                "assetInsId": null,
                                "merchandiseInsId": 451007192965836801,
                                "assetNum": null,
                                "productUri": "11364",
                                "gmsPid": "11364",
                                "appKey": "",
                                "productName": "广联达云计价平台概算模块5.0",
                                "channelCode": "auth.glodon.com",
                                "licenseOrderId": "bb363b2f0e0d420e96d9eedc5545abdb",
                                "channelOrderId": "1-20200424001",
                                "limitStartTime": 1556380800000,
                                "limitEndTime": 1588003200000,
                                "limitAmount": 0,
                                "limitConcurrent": 1,
                                "limitTimeDuration": 0,
                                "trial": 0,
                                "trialEndDate": null,
                                "limitType": "basic",
                                "prodDefExtend": false,
                                "timeDurationExpression": null,
                                "srcLicenseOrderId": null,
                                "createTime": 1587694961000,
                                "updateTime": null,
                                "activateFlag": true,
                                "crmProductId": "1-WKMAT3",
                                "productExtendInstanceList": []
                            },
                            {
                                "id": 451007192965836804,
                                "licenseType": "cloud_customer",
                                "customerId": "4b4717fee1214a97b55b6fc42fa24ecb",
                                "assetId": null,
                                "assetInsId": null,
                                "merchandiseInsId": 451007192965836801,
                                "assetNum": null,
                                "productUri": "11365",
                                "gmsPid": "11365",
                                "appKey": "",
                                "productName": "广联达云计价平台结算模块5.0",
                                "channelCode": "auth.glodon.com",
                                "licenseOrderId": "bb363b2f0e0d420e96d9eedc5545abdb",
                                "channelOrderId": "1-20200424001",
                                "limitStartTime": 1556380800000,
                                "limitEndTime": 1588003200000,
                                "limitAmount": 0,
                                "limitConcurrent": 1,
                                "limitTimeDuration": 0,
                                "trial": 0,
                                "trialEndDate": null,
                                "limitType": "basic",
                                "prodDefExtend": false,
                                "timeDurationExpression": null,
                                "srcLicenseOrderId": null,
                                "createTime": 1587694961000,
                                "updateTime": null,
                                "activateFlag": true,
                                "crmProductId": "1-WKMFUU",
                                "productExtendInstanceList": []
                            }
                        ]
                    },
                    {
                        "id": 451007192965836805,
                        "licenseType": "cloud_customer",
                        "merchandiseNum": "09101110008",
                        "merchandiseName": "北京:图形算量(含2010规则)",
                        "parentId": 451007192965836800,
                        "parentMerchandiseNum": "09101110008",
                        "customerId": "4b4717fee1214a97b55b6fc42fa24ecb",
                        "licenseOrderId": "bb363b2f0e0d420e96d9eedc5545abdb",
                        "channelOrderId": "1-20200424001",
                        "createTime": 1587694961000,
                        "updateTime": null,
                        "channelCode": "auth.glodon.com",
                        "timeDurationExpression": null,
                        "srcLicenseOrderId": null,
                        "children": null,
                        "productInstanceList": [
                            {
                                "id": 451007192965836807,
                                "licenseType": "cloud_customer",
                                "customerId": "4b4717fee1214a97b55b6fc42fa24ecb",
                                "assetId": null,
                                "assetInsId": null,
                                "merchandiseInsId": 451007192965836805,
                                "assetNum": null,
                                "productUri": "11364",
                                "gmsPid": "11364",
                                "appKey": "",
                                "productName": "北京市建设工程概算定额计算规则(1996)",
                                "channelCode": "auth.glodon.com",
                                "licenseOrderId": "bb363b2f0e0d420e96d9eedc5545abdb",
                                "channelOrderId": "1-20200424001",
                                "limitStartTime": 1556380800000,
                                "limitEndTime": 1588003200000,
                                "limitAmount": 0,
                                "limitConcurrent": 1,
                                "limitTimeDuration": 0,
                                "trial": 0,
                                "trialEndDate": null,
                                "limitType": "basic",
                                "prodDefExtend": false,
                                "timeDurationExpression": null,
                                "srcLicenseOrderId": null,
                                "createTime": 1587694961000,
                                "updateTime": null,
                                "activateFlag": true,
                                "crmProductId": "1-59-2173",
                                "productExtendInstanceList": []
                            },
                            {
                                "id": 451007192965836806,
                                "licenseType": "cloud_customer",
                                "customerId": "4b4717fee1214a97b55b6fc42fa24ecb",
                                "assetId": null,
                                "assetInsId": null,
                                "merchandiseInsId": 451007192965836805,
                                "assetNum": null,
                                "productUri": "1218",
                                "gmsPid": "1218",
                                "appKey": "",
                                "productName": "广联达图形算量软件GCL2008",
                                "channelCode": "auth.glodon.com",
                                "licenseOrderId": "bb363b2f0e0d420e96d9eedc5545abdb",
                                "channelOrderId": "1-20200424001",
                                "limitStartTime": 1556380800000,
                                "limitEndTime": 1588003200000,
                                "limitAmount": 0,
                                "limitConcurrent": 1,
                                "limitTimeDuration": 0,
                                "trial": 0,
                                "trialEndDate": null,
                                "limitType": "basic",
                                "prodDefExtend": false,
                                "timeDurationExpression": null,
                                "srcLicenseOrderId": null,
                                "createTime": 1587694961000,
                                "updateTime": null,
                                "activateFlag": true,
                                "crmProductId": "1-59-493",
                                "productExtendInstanceList": []
                            }
                        ]
                    }
                ],
                "productInstanceList": null
            }
        ]
    }
}

异常返回结果

{"code":"60000","message":"应用Token校验不正确,请检查token是否失效或者对应的资源操作权限后,再重试","cause":"xxxx"}
{"code":"60005","message":"无效的用户登录token,请检查token是否失效后,再重试","cause":"xxxx"}
{"code":"60017","message":"当前账号未绑定授权客户","cause":"xxxx"}
{"code":"60024","message":"未找到资产编号","cause":"xxxx"}
{"code":"70001","message":"安全校验不通过","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

8、查询企业借出锁

请求

GET https://apigate.glodon.com/me/api/v1/enterprise/{enterpriseGlobalId}/asset/borrowUsbKeys?g_nonce=xxx

说明

查询指定企业账号下的所有借出锁信息。

header 参数

参数名 必选 类型 描述
Authorization String Bearer clientToken.
clientToken String 根据appkey和appsecret获取的accessToken,参考用户中心获取AccessToken,grant_type取值为client_credentials
userToken String 用户登录获取的accessToken,参考用户中心获取AccessToken,grant_type取值为password

path 参数

参数名 必选 类型 描述
enterpriseGlobalId String 企业主账号GlobalId

query 参数

参数名 必选 类型 描述
g_nonce String 防重放随机串

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://apigate.glodon.com/me/api/v1/enterprise/{enterpriseGlobalId}/asset/borrowUsbKeys?g_nonce=xxx")
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("clientToken", "XXXXXXXX")
  .addHeader("userToken", "XXXXXXXX")
  .build();

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

成功返回结果

{
    "code": 0,
    "message": "success",
    "data": [
        {
            "assetId": "string,资产id-实体锁",
            "assetNum": "string,借出锁号",
            "borrowedFlag": "boolean,是否已借出",
            "cloudAccountGlobalId": "string,借出的员工globalID"
        },
        {
            "assetId": "string,资产id-实体锁",
            "assetNum": "string,借出锁号",
            "borrowedFlag": "boolean,是否已借出",
            "cloudAccountGlobalId": "string,借出的员工globalID"
         }
    ]
}

异常返回结果

{"code":"60000","message":"应用Token校验不正确,请检查token是否失效或者对应的资源操作权限后,再重试","cause":"xxxx"}
{"code":"60005","message":"无效的用户登录token,请检查token是否失效后,再重试","cause":"xxxx"}
{"code":"60017","message":"当前账号未绑定授权客户","cause":"xxxx"}
{"code":"70001","message":"安全校验不通过","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

9、配置资产

请求

POST https://apigate.glodon.com/me/api/v1/enterprise/member/{memberGlobalId}/privileges?g_nonce=xxx

说明

给指定企业成员配置资产,包含收回已配置的资产编号和分配新的资产编号。

header 参数

参数名 必选 类型 描述
Authorization String Bearer clientToken.
clientToken String 根据appkey和appsecret获取的accessToken,参考用户中心获取AccessToken,grant_type取值为client_credentials
userToken String 用户登录获取的accessToken,参考用户中心获取AccessToken,grant_type取值为password
Content-Type String application/json

path 参数

参数名 必选 类型 描述
memberGlobalId String 企业员工globalId

query 参数

参数名 必选 类型 描述
g_nonce String 防重放随机串

body 参数

参数名 必选 类型 描述
deleteAssets String 数组 取消的资产编号集合
addAssets String 数组 配置的资产编号集合

示例

{
    "deleteAssets": [
       "YSA8000005011", 
       "YSA8000005022"  
    ],
    "addAssets": [
       "YSA8000005011"
    ]
}

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "body 参数");
Request request = new Request.Builder()
  .url("https://apigate.glodon.com/me/api/v1/enterprise/member/{memberGlobalId}/privileges?g_nonce=xxx")
  .post(body)
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("clientToken", "XXXXXXXX")
  .addHeader("userToken", "XXXXXXXX")
  .addHeader("content-type", "application/json")
  .build();

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

成功返回结果

{
    "code": 0,
    "message": "success",
    "data": null
} 

异常返回结果

{"code":"60000","message":"应用Token校验不正确,请检查token是否失效或者对应的资源操作权限后,再重试","cause":"xxxx"}
{"code":"60005","message":"无效的用户登录token,请检查token是否失效后,再重试","cause":"xxxx"}
{"code":"60023","message":"当前企业子账号匹配了多个员工","cause":"xxxx"}
{"code":"60024","message":"未找到资产编号","cause":"xxxx"}
{"code":"60025","message":"资产编号归属客户不正确","cause":"xxxx"}
{"code":"60026","message":"企业子账号未成功匹配员工","cause":"xxxx"}
{"code":"60028","message":"资产编号重复配置","cause":"xxxx"}
{"code":"70001","message":"安全校验不通过","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}

10、借出资产

请求

POST https://apigate.glodon.com/me/api/v1/enterprise/member/{memberGlobalId}/borrow?g_nonce=xxx

说明

将指定企业成员拥有的资产编号所包含的产品权益转移到借出锁中。

header 参数

参数名 必选 类型 描述
Authorization String Bearer clientToken.
clientToken String 根据appkey和appsecret获取的accessToken,参考用户中心获取AccessToken,grant_type取值为client_credentials
userToken String 用户登录获取的accessToken,参考用户中心获取AccessToken,grant_type取值为password
Content-Type String application/json

path 参数

参数名 必选 类型 描述
memberGlobalId String 企业员工globalId

query 参数

参数名 必选 类型 描述
g_nonce String 防重放随机串

body 参数

参数名 必选 类型 描述
borrowedUsbKey String 借出锁号
assetIDs String 数组 借出的资产ID集合

示例

{
    "borrowedUsbKey": "BP320276380",
    "assetIDs": [
        "xxx","xxx"
    ]
}

响应

HTTP 代码 说明 类型
200 ok 请求成功,根据业务 code 解析实际结果
299 业务异常 业务异常

HTTP 请求示例

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "body 参数");
Request request = new Request.Builder()
  .url("https://apigate.glodon.com/me/api/v1/enterprise/member/{memberGlobalId}/borrow?g_nonce=xxx")
  .post(body)
  .addHeader("authorization", "XXXXXXXX")
  .addHeader("clientToken", "XXXXXXXX")
  .addHeader("userToken", "XXXXXXXX")
  .addHeader("content-type", "application/json")
  .build();

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

成功返回结果

{
    "code": 0,
    "message": "success",
    "data": null
} 

异常返回结果

{"code":"60000","message":"应用Token校验不正确,请检查token是否失效或者对应的资源操作权限后,再重试","cause":"xxxx"}
{"code":"60005","message":"无效的用户登录token,请检查token是否失效后,再重试","cause":"xxxx"}
{"code":"60026","message":"企业子账号未成功匹配员工","cause":"xxxx"}
{"code":"40000","message":"参数不能为空","cause":"xxxx"}
{"code":"33006","message":"节点不足","cause":"xxxx"}
{"code":"33003","message":"员工权限不足","cause":"xxxx"}
{"code":"33007","message":"已经借出到其他借出锁","cause":"xxxx"}
{"code":"33008","message":"借出锁状态异常","cause":"xxxx"}
{"code":"33018","message":"借出锁已借出到其他员工","cause":"xxxx"}
{"code":"33009","message":"借出请求失败","cause":"xxxx"}
{"code":"70001","message":"安全校验不通过","cause":"xxxx"}
{"code":"500","message":"网络异常,请重试","cause":"xxxx"}