亿方云开放平台是基于亿方云基础业务和功能向开发者提供二次开发的服务平台,为企业提供丰富的云盘文档协同管理解决方案。企业或第三方合作伙伴可以快速低成本地接入亿方云,实现存储、查看、分享、协作等一站式文件管理。激活企业非结构数据资产价值,助你的企业更快一步。
亿方云开放平台提供UI组件、SDK、API等接入方式,10行代码助你构建企业文件统一管理平台。
亿方云的开放平台,是在云计算背景下,将亿方云已有的能力通过多种形式开放给第三方开发者使用,而产生的一种技术能力输出。开放平台所有功能基于亿方云已有功能,并不断迭代,基于安全角度考虑,所有能力输出将严格依照Oauth2协议进行授权和鉴权。
其中核心能力为接入层的代理服务、Oauth鉴权服务、Open API能力输出。代理服务主要提供访问接入底层服务,以WEB方式实现。Oauth鉴权服务通过Oauth协议对接入者进行授权和鉴权,返回相应的access_token信息,该token具备时效性,可有效保障接入安全和数据安全。Open API即为亿方云能力输出相关API,目前已开放近100个API,涉及文件(夹)管理、分享、协作、日志、消息、第三方同步等大量功能,可有效辅助开发者接入开放平台。
在此基础上,为便于开发者接入亿方云开放平台,还提供了WEB、H5的UI组件,涉及文件选择、文件上传、文件预览等基础能力,开发者无需再去构建文件显示、列表等基本架构。
企业依托亿方云强大的开放能力,将亿方云文件存储与共享的能力接入到企业自身的HR、OA、客户管理、业务管理等系统,实现文件的统一存储和协作。
1.access_token是访问亿方云服务端开放接口的全局唯一凭证。
2.正常情况下access_token有效期为6小时。
client_id是企业接入亿方云开放平台的唯一性标识。开发者在申请开放平台应用时,系统会自动生成。
client_secret和client_id在企业申请开放平台时一同生成,使用client_id和client_secret可获取access_token。
企业在申请亿方云开放平台时,可为应用设置一个URL。一些应用相关的重要事件发生时,亿方云向该URL地址发起http请求,此URL称之为回调地址。
“免登”是指用户免除输入亿方云用户名和密码,应用便可获取用户身份,登录亿方云。
员工在使用企业内部应用的过程中,可将从本地上传或者从亿方云选择的文件保存到应用专属账号。企业内部应用将员工所上传的文件存储在应用专属账号中,可以控制用户预览、保存至亿方云、下载等权限,也可以将员工账号添加为文件夹的协作权限来授予员工相应的访问权限。
目前亿方云开放平台需要申请才能开放,具体的申请可直接拨打我司客服热线:400-993-9050。具体步骤开发者需要在企业控制台(只有企业管理员或联合管理员才能进入)里面申请应用,企业控制台-企业设置-开放平台中设置相关信息提交应用,待应用审核通过后即可进入第二步。
当审核通过后,则会分配一个client_id和client_secret应用审核通过后会获得该应用的client_id和client_secret,拿到这两个信息即可进行接口认证,获取相关的接口认证。
接口认证获取授权后,即可调用亿方云提供的API、SDK、UI组件。
只能请求企业级API(路径中含有admin),示例如下:
{
"access_token":"8afa8c99-4490-4f64-a3ce-ebfda52d893a",
"refresh_token":"70903bbd-9825-4ef2-b967-0c6ae0fb0946",
"scope":"admin",
"token_type":"bearer",
"expires_in":21599
}
只能请求用户级API,示例如下:
{
"access_token":"7e40bd40-080f-4131-ba8b-7f6ce5ac0a83",
"refresh_token":"98db229d-1a76-4491-b2c7-37be7f37dcaf",
"scope":"all",
"token_type":"bearer",
"expires_in":21599
}
向云盘工作人员获取企业id,开放平台的client_id和client_secret参数
该接口使用Basic Auth的方式校验client的信息。具体做法是在header中添加类似于"Authorization: Basic xxxxxxxxx"。其中"xxxxxxxxx"是通过client_id和client_secret算出来的,具体算法为Base64Encode(client_id + ":" + client_secret)
组装map集合,map集合参数如下:
参数字段 | 字段类型 | 字段说明 |
---|---|---|
yifangyun_sub_type | string | 授权对象类型,只能是enterprise或者user |
sub | string | 授权对象id。授权对象类型为enterprise,sub为企业id;授权对象类型为user,sub为用户id |
exp | timestamp | 过期时间戳,不能超过iat(若iat不存在则记请求到达服务器时间)60s |
iat | timestamp | jwt生成时的时间戳(单位为秒) |
jti | string | jwt的唯一标识,每个jwt应当都有唯一的jti |
组装完成的map集合示例:
{
"sub": "21791",
"yifangyun_sub_type": "enterprise",
"exp": "1725590139",
"iat": "1725590079",
"jti": "17255900799152711bfbc-435f-45b6-a8d4-6e750e14b005"
}
将组装好的map转成字符串并其进行:Base64Encode,生成assertion参数,转换完成的assertion示例:
ewogICAgInN1YiI6ICIyMTc5MSIsCiAgICAieWlmYW5neXVuX3N1Yl90eXBlIjogImVudGVycHJpc2UiLAogICAgImV4cCI6ICIxNzI1NTkwMTM5IiwKICAgICJpYXQiOiAiMTcyNTU5MDA3OSIsCiAgICAianRpIjogIjE3MjU1OTAwNzk5MTUyNzExYmZiYy00MzVmLTQ1YjYtYThkNC02ZTc1MGUxNGIwMDUiCn0=
HTTP请求方式: POST URL参数:
参数字段 | 字段类型 | 字段说明 |
---|---|---|
grant_type | string | 必须为jwt_simple |
assertion | string | 第三步装好的字符串 |
请求示例:
curl --location --request POST 'https://oauth.fangcloud.net/oauth/token?grant_type=jwt_simple&assertion=ewogICAgInN1YiI6ICIyMTc5MSIsCiAgICAieWlmYW5neXVuX3N1Yl90eXBlIjogImVudGVycHJpc2UiLAogICAgImV4cCI6ICIxNzI1NTkwMTM5IiwKICAgICJpYXQiOiAiMTcyNTU5MDA3OSIsCiAgICAianRpIjogIjE3MjU1OTAwNzk5MTUyNzExYmZiYy00MzVmLTQ1YjYtYThkNC02ZTc1MGUxNGIwMDUiCn0='
--header 'Authorization: Basic M2RjMjcyNjQtMGJhNi00ZjQ3LWI3ZGUtNjhiNWFhNWFiZDQxOjA1MmQ4YjAzLWRiNTEtNDM3Ni04ZTA1LTZhNmU1NWNlNGMzMA=='
curl --location 'https://open.fangcloud.com/api/v2/admin/user/get_user_info?identifier=18888888888@test.com&type=simple_phone_or_email' \
--header 'Authorization: Bearer 021ae7ad-a803-49d8-a070-52b84e6c0705'
package com.example.liangxiaoshengdemo.token.simple_jwt;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import java.util.*;
public class DemoSimple {
static String clientId = "";
static String clientSecret = "";
// jwt密钥文件中的enterprise_id,生成企业token使用
static long enterpriseId = 0L;
// jwt密钥文件中的platform_id
static long platformId = 0L;
// 用户id,通过接口获取,生成个人token使用
static long userId = 0L;
// 开放平台获取token地址(专有云需要修改)
static String oauthHost = "https://oauth.fangcloud.com";
public static void main(String[] args) throws Exception {
// 生成企业token
JSONObject accessTokenAdmin= getAccessToken(oauthHost, clientId, clientSecret, enterpriseId, false);
System.out.println("accessTokenAdmin" + JSON.toJSONString(accessTokenAdmin));
// 生成个人token
JSONObject accessTokenUser = getAccessToken(oauthHost, clientId, clientSecret, userId, true);
System.out.println("accessTokenUser" + JSON.toJSONString(accessTokenUser));
}
public static JSONObject getAccessToken (String oauthUrl, String appKey, String appSecret, Long id, Boolean isUser) {
try{
Map<String, String> dataMap = new HashMap<>();
String yifangyun_sub_type = "";
if (isUser) {
yifangyun_sub_type = "user";
} else {
yifangyun_sub_type = "enterprise";
}
dataMap.put("yifangyun_sub_type", yifangyun_sub_type); //授权对象类型 enterprise为企业 user为用户
dataMap.put("sub", String.valueOf(id)); //如果授权对象类型为企业 这里输入企业id,如果授权对象类型为user这边输入userid
dataMap.put("exp", String.valueOf(getExpirationTimeSecondsInTheFuture(60).getTime()/1000));//过期时间戳,不能超过iat(若iat不存在则记请求到达服务器时间)60s
dataMap.put("iat", String.valueOf(new Date().getTime()/1000));//当前 时间
dataMap.put("jti", System.currentTimeMillis() + UUID.randomUUID().toString());//随机字符串
String dataJson = JSON.toJSONString(dataMap);
String encodeJson = Base64.getEncoder().encodeToString(dataJson.getBytes());
return getToken(encodeJson, oauthUrl, appKey, appSecret);
}catch (Exception e){
e.printStackTrace();
}
return null;
}
/**
* 获取token
* @param compactJwt jwt字符串
* @param oauthUrl 接口地址
* @param appKey client_id
* @param appSecret client_secret
* @return 返回接口token
*/
private static JSONObject getToken(String compactJwt, String oauthUrl, String appKey, String appSecret){
String res = "";
DefaultHttpClient httpclient;
try {
httpclient = new DefaultHttpClient();//https请求 存在证书问题,通过此方式信任所有证书
String url = oauthUrl + "/oauth/token?grant_type=jwt_simple&assertion=" + compactJwt;
System.out.println(url);
HttpPost httppost = new HttpPost(url);
String client = appKey + ":" + appSecret; //组装client_id和client_secret
byte[] bytes = client.getBytes();
String base64Client = Base64.getEncoder().encodeToString(bytes);//base64加密
System.out.println(base64Client);
httppost.addHeader("Authorization","Basic "+base64Client);
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
res = EntityUtils.toString(entity);
return JSONObject.parseObject(res);
}catch (Exception e){
e.printStackTrace();
return null;
}
}
private static Date getExpirationTimeSecondsInTheFuture(int seconds) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(Calendar.SECOND, seconds);
return calendar.getTime();
}
}
import hashlib
import json
import random
import time
import base64
import requests
# jwt密钥文件中的enterprise_id,生成企业token使用
enterprise_id = 123
# 用户id,通过接口获取,生成个人token使用
user_id = 0
# jwt密钥文件中的client_id
client_id = "xxxx"
# jwt密钥文件中的client_secret
client_secret = "xxxx"
# 开放平台获取token地址(专有云需要修改)
oauth_url = 'https://oauth.fangcloud.com'
# 开放平台api地址(专有云需要修改)
open_url = 'https://open.fangcloud.com'
class Test():
def jwt_token(id, type):
jti = "".join(random.sample('abcdefghijklmnopqrstuvwxyz!@#$%^&*1234567890', 16)).replace(' ', '')
m = hashlib.md5()
m.update(jti.encode("utf-8"))
jti_md5 = m.hexdigest()
sub_type = ''
if(type == 'enterprise'):
sub_type = "enterprise"
elif(type == 'user'):
sub_type = "user"
payload = {
"yifangyun_sub_type": sub_type,
"sub": id,
"exp": int(time.time()) + 60,
"iat": int(time.time()),
"jti": jti_md5,
}
headers = {
'Authorization': 'Basic '+ base64.b64encode((client_id + ":" + client_secret).encode('utf-8')).decode('ascii')
}
url = oauth_url + '/oauth/token?grant_type=jwt_simple&assertion=' + base64.b64encode(json.dumps(payload).encode('utf-8')).decode('ascii')
return requests.post(url, headers=headers).text
enterprise_token = jwt_token(enterprise_id, 'enterprise')
print('enterprise_token:' + enterprise_token)
user_token = jwt_token(user_id, 'user')
print('user_token:' + user_token)
所有的接口在访问时需要在HTTP header中带上access_token(通过jwt模式获取的)。对于含有请求参数的接口,通常是一些POST、PUT或者DELETE接口,还需要设置Content-Type来指定参数的格式。如果需要访问不同版本的API,就需要在请求路径上指定具体版本,如果需要返回不同格式的response body,那么还需要设置Accept。所有的参数都应该采用utf-8的编码:
参数字段 | 是否必填 | 字段说明 |
---|---|---|
Share-Link-Token | 否 | 分享链接token |
Share-Link-Verification-Code | 否 | 分享链接码 |
Authorization | 是 | Bearer {access_token} |
Content-Type | 是 | application/json |
curl --location --request GET 'https://open.fangcloud.com/api/v2/admin/user/all?platform_id=1&page_id=0&page_capacity=10' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 76ebc21a-e52e-4800-9ada-a1cdd2f77856'
目前对于开放平台的请求, 我们做了请求的频次限制, 在所有api请求的返回结果中会有三个header表示频次限制相关的信息
返回header | 字段类型 | 字段说明 |
---|---|---|
X-Rate-Limit-Limit | int | 当前接口请求次数的上限, 固定数值 |
X-Rate-Limit-Remaining | int | 当前接口允许请求的剩余次数 |
X-Rate-Limit-Reset | int | 当前接口允许请求的剩余次数恢复到上限所需要的时间(单位为秒) |
当请求超过了频次限制, 返回结果的HTTP Status Code为429, 返回body如下
{
"errors": [
{
"code": "rate_limit",
"msg": "Rate limit exceeded!"
}
],
"request_id": "d3e1088f-28af-495d-b7ee-a9e58e989b76"
}
api接口的异常返回可以分为两类,参数验证错误和业务错误
参数验证错误的返回如又所示:
{
"errors": [
{
"msg": "不能为空",
"code": "request_data_invalid",
"field": "folder_id"
}
],
"request_id": "fdjklsa-asdrwer2312314q-asdfasfav-falsfdjas"
}
参数验证错误有统一的错误码request_data_invalid
,具体错误信息会在msg中提示,field提示错误的字段
常见的错误msg包括:
业务错误的异常格式如下所示:
{
"errors": [
{
"msg": "文件不存在",
"code": "file_not_found"
}
],
"request_id": "fdjklsa-asdrwer2312314q-asdfasfav-falsfdjas"
}
{
"errors": [
{
"msg": "不能为空",
"code": "request_data_invalid",
"field": "folder_id"
}
],
"request_id": "fdjklsa-asdrwer2312314q-asdfasfav-falsfdjas"
}
业务错误通常以不同的code来进行区分
code | message |
---|---|
request_data_invalid | 请求参数存在错误 |
permission_denied | 权限不足 |
file_not_found | 文件不存在 |
folder_not_found | 文件夹不存在 |
file_deleted | 文件已删除 |
folder_deleted | 文件夹已删除 |
file_in_trash_not_found | 文件不在回收站 |
folder_in_trash_not_found | 文件夹不在回收站 |
file_name_conflict | 文件命名冲突 |
folder_name_conflict | 文件夹命名冲突 |
folder_empty_in_trash | 回收站无文件夹 |
folder_parent_deleted | 父文件夹已被删除 |
move_to_itself | 文件夹不能移动到自身 |
move_to_subfolder | 不能移动到子文件夹 |
copy_to_itself | 文件夹不能拷贝到自身 |
copy_to_subfolder | 不能拷贝到子文件夹 |
item_name_invalid | 文件或文件夹名称不合法 |
item_name_size_incorrect | 文件或文件夹名称长度错误 |
empty_trash | 回收站为空 |
request_data_invalid | 请求参数错误 |
exceed_enterprise_space_limit | 超过企业空间限制 |
exceed_user_space_limit | 超过用户空间限制 |
folder_is_descendant | 目标文件夹是移动文件夹的子目录 |
user_not_found | 用户不存在 |
user_profile_pic_not_found | 用户头像不存在 |
user_profile_pic_key_not_found | 用户头像的key未传入 |
user_profile_pic_key_incorrect | 用户头像的key与user_id不匹配 |
share_link_password_not_provided | 没有提供分享链接密码 |
share_link_access_type_invalid | 分享链接的 access 类型无效 |
due_time_passed | 指定的截止时间已过期 |
share_link_not_found_or_deleted | 分享链接找不到或已删除 |
share_link_resource_id_not_provided | 没有提供文件或文件夹id |
share_link_resource_id_ambiguous | 分享链接资源不明确(同时提供了文件和文件夹id) |
share_link_password_not_correct | 分享链接密码不正确 |
share_link_password_size_incorrect | 分享链接密码长度最大33位 |
share_link_password_invalid | 分享链接密码只能使用数字和字母 |
share_link_expired | 分享链接已过期 |
collab_not_found | 协作不存在 |
collab_role_invalid | 协作角色无效 |
collab_user_has_been_invited | 用户已经被邀请 |
collab_user_not_in_same_enterprise | 被邀请用户不在同一企业 |
collab_group_not_supported | 不支持群组协作 |
cannot_invite_item_owner | 无法邀请拥有者 |
comment_not_found | 评论不存在 |
collab_related_folder_deleted | 协作相关的文件夹已经被删除 |
enterprise_is_expired | 企业套餐已经过期 |
department_not_found | 部门不存在 |
department_name_conflict | 部门名冲突 |
user_not_in_enterprise | 用户不在企业中 |
user_already_in_department | 用户已经在该部门中 |
user_exceed_department_limit | 用户所在的部门数超过部门限制(100) |
user_not_in_department | 用户不在该部门中 |
group_name_conflict | 群组名冲突 |
user_already_in_group | 用户已经在该群组中 |
user_not_in_group | 用户不在该群组中 |
user_email_or_phone_invalid | 用户邮箱或手机无效 |
user_already_deleted | 该用户已被删除 |
user_already_invited | 该用户已被邀请 |
user_already_registered | 该用户已被注册 |
user_receive_items_needed | 需要接收文件的用户 |
department_space_total_exceeds_enterprise_limit | 部门分配空间超出企业总可用空间 |
department_having_children_can_not_delete | 无法删除存在子部门的部门 |
user_space_total_exceeds_enterprise_limit | 用户分配空间超出企业总可用空间 |
user_received_items_not_in_same_enterprise | 接收文件的用户不在同一企业中 |
invalid_enterprise_storage | 无效的企业存储 |
department_director_can_not_delete | 无法删除部门管理员 |
user_deleted_is_user_received_items | 接收文件的用户不能是被删除者 |
user_not_active | 用户未激活 |
preview_file_not_generated | 预览文件未生成 |
can_not_download_yiqixie_file | 无法下载一起写文件 |
user_receive_items_need_active | 文件接受者尚未激活 |
timestamp_range_invalid | 非法的时间戳范围 |
enterprise_not_enable_sync_account | 企业未开启账号同步 |
cannot_provide_both_yfy_id_and_custom_id | 不能同时提供亿方云id和自定义id |
yfy_id_and_custom_id_not_null | 亿方云id和自定义id不能同时为空 |
邀请协作所需参数
folder_id required | integer <int64> (协作文件夹id) |
required | object (邀请对象) |
invitation_message | string (邀请信息,长度不能超过140个字符) |
{- "item": {
- "type": "folder",
- "id": 181000005330,
- "name": "xxx"
}, - "id": 412027,
- "accessible_by": {
- "type": "group",
- "id": 94444,
- "name": "xxxzxc"
}, - "accepted": true,
- "role": "viewer"
}
批量邀请协作所需参数
folder_id required | integer <int64> (协作文件夹id) |
required | Array of objects (邀请对象) |
invitation_message | string (邀请信息,长度不能超过140个字符) |
{- "folder_id": 179000000092,
- "accessible_by": [
- {
- "type": "department_list",
- "ids": [
- 596606,
- 596610
], - "role": "viewer"
}
], - "invitation_message": "hello"
}
id required | integer <int64> 协作ID |
新的权限
role required | string (更新角色类型) coowner:共同所有者; editor:编辑者; online_collaborator:在线协作者; viewer_uploader:查看/上传者; viewer:查看者; previewer_uploader:预览+上传者; previewer:预览者; uploader:上传者; reset:禁止访问 |
{- "item": {
- "type": "folder",
- "id": 181000005330,
- "name": "xxx"
}, - "id": 412027,
- "accessible_by": {
- "type": "group",
- "id": 94444,
- "name": "xxxzxc"
}, - "accepted": true,
- "role": "viewer"
}
添加的评论信息
file_id required | integer <int64> (评论文件id) |
content required | string (评论文本,长度不能超过1001个字符@[user_id:评论内容]) |
{- "item": {
- "type": "file",
- "id": 181000113542,
- "name": "风光.docx"
}, - "id": 43156,
- "content": "@[12032111:的]",
- "created_at": 1501148332,
- "user": {
- "id": 881525,
- "name": "xdsfd王",
- "login": "autov2@test.com",
- "enterprise_id": 12401
}
}
{- "director": {
- "id": 881525,
- "name": "xxx",
- "login": "xxx@test.com"
}, - "id": 65820,
- "created_at": 1513102764,
- "children_departments_count": 1,
- "direct_item_count": 1,
- "name": "亿方云测试",
- "user_count": 1,
- "parent_id": 0,
- "order": 1
}
{- "has_children_departments": true,
- "children": [
- {
- "has_children_departments": false,
- "id": 894823,
- "name": "hr",
- "user_count": 2,
- "parent_id": 893694
}, - {
- "has_children_departments": false,
- "id": 894824,
- "name": "Dev",
- "user_count": 4,
- "parent_id": 893694
}
], - "id": 893694,
- "name": "venus金星计划物Train版Swift理环境部署",
- "user_count": 6,
- "parent_id": 0
}
id required | integer <int64> 部门ID |
query_words | string 查询关键字 |
page_id | integer <int32> >= 0 页码 |
{- "users": [
- {
- "user_group": "admin",
- "email": "xxx@test.com",
- "phone": "12312312312",
- "space_total": 2199023255552,
- "space_used": 0,
- "profile_pic_key": "ee1bacaffb0128a26b51afaf17126a8b",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881525,
- "name": "xxx",
- "login": "xxx@test.com",
- "enterprise_id": 12401
}, - {
- "user_group": "user",
- "email": "xxx@test.com",
- "phone": "12312312312",
- "space_total": 5368709120,
- "space_used": 8745602,
- "profile_pic_key": "",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881533,
- "name": "xxx",
- "login": "xxx@test.com",
- "enterprise_id": 12401
}, - {
- "user_group": "user",
- "email": "xxx@test.com",
- "phone": "",
- "space_total": 2199023255552,
- "space_used": 0,
- "profile_pic_key": "",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881572,
- "name": "xxx",
- "login": "xxx@test.com",
- "enterprise_id": 12401
}, - {
- "user_group": "user",
- "email": "xxx@test.com",
- "phone": "12312312312",
- "space_total": 2199023255552,
- "space_used": 2869229,
- "profile_pic_key": "0cb601c50ed619267bb791cfe2a60ade",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881526,
- "name": "xxx",
- "login": "autov22@test.com",
- "enterprise_id": 12401
}
], - "total_count": 4,
- "page_id": 0,
- "page_capacity": 500,
- "page_count": 1
}
{- "synced_folders": [
- {
- "sync_root": {
- "type": "department",
- "id": 1,
- "name": "xxx"
}, - "id": 181000010188,
- "name": "aaa"
}
], - "synced_department_spaces": [
- {
- "type": "department",
- "id": 2,
- "name": "xxx2"
}
], - "is_synced_personal_space": false,
- "is_synced_collab_space": false
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/file/75003907526/copy' \
--header 'Authorization: Bearer 583fad43-3265-45df-9e13-91fa5a22a2ca' \
--header 'Content-Type: application/json' \
--data '{
"target_folder_id": 75000441887
}'
id required | integer <int64> 文件的ID |
拷贝文件的请求
target_folder_id required | integer <int64> (目标文件夹id) |
{- "space": {
- "type": "personal"
}, - "sha1": "dc5d8f86d8d33eac2145eddaf1ff85dd38dcca5f",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 75003903445,
- "name": "0EB21E7F3E887DAEADC3E1B047BCA6AC (1).docx",
- "size": 21087,
- "created_at": 1624330900,
- "modified_at": 1624330900,
- "modified_by": {
- "id": 13117471,
- "name": "yfytest01",
- "login": "admin@mars.fangcloud.com",
- "enterprise_id": 426870
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 13117471,
- "name": "yfytest01",
- "login": "admin@mars.fangcloud.com",
- "enterprise_id": 426870
}, - "parent": {
- "type": "folder",
- "id": 0
}, - "sequence_id": 8,
- "in_trash": false,
- "is_deleted": false,
- "is_frequently_used": false
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/file/75003907526/copy_by_path' \
--header 'Authorization: Bearer 583fad43-3265-45df-9e13-91fa5a22a2ca' \
--header 'Content-Type: application/json' \
--data '{
"target_folder_path": "75000441887"
}'
id required | integer <int64> 文件的ID |
拷贝文件的请求
target_folder_path required | string (路径名,以/划分文件夹,根目录在个人文件下,文件夹名称必须是1到222个字符,并且不能含有/ ? : * " > < |且末尾不能为“.”) |
{- "space": {
- "type": "personal"
}, - "sha1": "dc5d8f86d8d33eac2145eddaf1ff85dd38dcca5f",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 75003903445,
- "name": "0EB21E7F3E887DAEADC3E1B047BCA6AC (1).docx",
- "size": 21087,
- "created_at": 1624330900,
- "modified_at": 1624330900,
- "modified_by": {
- "id": 13117471,
- "name": "yfytest01",
- "login": "admin@mars.fangcloud.com",
- "enterprise_id": 426870
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 13117471,
- "name": "yfytest01",
- "login": "admin@mars.fangcloud.com",
- "enterprise_id": 426870
}, - "parent": {
- "type": "folder",
- "id": 0
}, - "sequence_id": 8,
- "in_trash": false,
- "is_deleted": false,
- "is_frequently_used": false
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/file/create_blank_file' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer a2a192ea-cb37-4c0c-b8d5-574232fa853b' \
--header 'Cookie: lang=zh-CN' \
--data-raw '{
"departmentId":0,
"name":"111",
"parentEnterpriseId":21791,
"nameConflictResolveStrategy":"2",
"parentFolderId":0,
"type":"1"
}'
文件信息
name required | string (新文件文件名) |
type required | string (文件类型) 1:doc类型; 2:ppt类型; 3:xls类型 |
parentFolderId required | integer <int64> (父文件夹Id) |
parentEnterpriseId required | integer <int64> (企业id,若为外协文件夹需要填写对应企业id) |
departmentId required | integer <int64> (部门id) |
nameConflictResolveStrategy required | string (命名冲突解决策略(固定传2)) 2:系统自动重命名(当前仅支持这种) |
{- "space": {
- "type": "personal"
}, - "sha1": "dc5d8f86d8d33eac2145eddaf1ff85dd38dcca5f",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 75003903445,
- "name": "0EB21E7F3E887DAEADC3E1B047BCA6AC (1).docx",
- "size": 21087,
- "created_at": 1624330900,
- "modified_at": 1624330900,
- "modified_by": {
- "id": 13117471,
- "name": "yfytest01",
- "login": "admin@mars.fangcloud.com",
- "enterprise_id": 426870
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 13117471,
- "name": "yfytest01",
- "login": "admin@mars.fangcloud.com",
- "enterprise_id": 426870
}, - "parent": {
- "type": "folder",
- "id": 0
}, - "sequence_id": 8,
- "in_trash": false,
- "is_deleted": false,
- "is_frequently_used": false
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/folder/179000000087/delete' \
--header 'Authorization: Bearer bdd88b1c-aa8a-4126-b380-a1e64f9348a5'
id required | integer <int64> 删除文件的ID |
{- "success": true
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/folder/179000000087/delete_from_trash' \
--header 'Authorization: Bearer bdd88b1c-aa8a-4126-b380-a1e64f9348a5'
id required | integer <int64> 从回收站删除文件的ID |
{- "success": true
}
请求示例(使用用户token):
curl --location --request GET 'https://open.fangcloud.com/api/v2/file/75003903551/download?version=0&valid_period=100' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
id required | integer <int64> 文件的ID |
version | integer <int64> Default: 0 文件的版本信息 |
external_enterprise_id | integer <int64> 外协文件的企业ID |
请求示例(使用用户token):
curl --location --request GET 'https://open.fangcloud.com/api/v2/file/75003907526/version/75000911769/info' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
id required | integer <int64> 文件id |
version_id required | integer <int64> 文件版本id |
{- "success": true,
- "id": 0,
- "file_id": 0,
- "sha1": "string",
- "name": "string",
- "size": 0,
- "modified_at": 0,
- "modified_by": {
- "id": 0,
- "name": "string",
- "login": "string",
- "enterprise_id": 0,
- "miniDepartmentList": [
- {
- "id": 0,
- "name": "string",
- "director": { },
- "user_count": 0,
- "children_departments_count": 0,
- "direct_item_count": 0,
- "order": 0,
- "level": 0,
- "parentDepartments": [
- { }
]
}
]
}, - "current": true,
- "remark": "string",
- "description": "string"
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/file/75003907526/version/75000911810/delete' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
id required | integer <int64> 文件id |
version_id required | integer <int64> 文件版本id |
{- "success": true
}
请求示例(使用用户token):
curl --location --request GET 'https://open.fangcloud.com/api/v2/file/75003907526/versions' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
id required | integer <int64> 文件id |
{- "success": true,
- "file_versions": [
- {
- "success": true,
- "id": 0,
- "file_id": 0,
- "sha1": "string",
- "name": "string",
- "size": 0,
- "modified_at": 0,
- "modified_by": {
- "id": 0,
- "name": "string",
- "login": "string",
- "enterprise_id": 0,
- "miniDepartmentList": [
- {
- "id": 0,
- "name": "string",
- "director": { },
- "user_count": 0,
- "children_departments_count": 0,
- "direct_item_count": 0,
- "order": 0,
- "level": 0,
- "parentDepartments": [
- { }
]
}
]
}, - "current": true,
- "remark": "string",
- "description": "string"
}
]
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/file/75003907526/version/75000911769/promote' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
id required | integer <int64> 文件id |
version_id required | integer <int64> 文件版本id |
{- "space": {
- "type": "personal"
}, - "sha1": "dc5d8f86d8d33eac2145eddaf1ff85dd38dcca5f",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 75003903445,
- "name": "0EB21E7F3E887DAEADC3E1B047BCA6AC (1).docx",
- "size": 21087,
- "created_at": 1624330900,
- "modified_at": 1624330900,
- "modified_by": {
- "id": 13117471,
- "name": "yfytest01",
- "login": "admin@mars.fangcloud.com",
- "enterprise_id": 426870
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 13117471,
- "name": "yfytest01",
- "login": "admin@mars.fangcloud.com",
- "enterprise_id": 426870
}, - "parent": {
- "type": "folder",
- "id": 0
}, - "sequence_id": 8,
- "in_trash": false,
- "is_deleted": false,
- "is_frequently_used": false
}
请求示例(使用用户token):
curl --location 'https://open.fangcloud.com/api/v2/file/75003624924/trash' \
--header 'Authorization: Bearer bdd88b1c-aa8a-4126-b380-a1e64f9348a5'
id required | integer <int64> 文件id |
{- "deleted_at": 1624869434,
- "deleted_by": {
- "id": 13117471,
- "name": "yfytest01",
- "login": "admin@mars.fangcloud.com",
- "enterprise_id": 426870
}, - "sha1": "dc5d8f86d8d33eac2145eddaf1ff85dd38dcca5f",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 75003624924,
- "name": "11111.docx",
- "size": 21087,
- "created_at": 1622001702,
- "modified_at": 1624354160,
- "modified_by": {
- "id": 13117471,
- "name": "yfytest01",
- "login": "admin@mars.fangcloud.com",
- "enterprise_id": 426870
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 13117471,
- "name": "yfytest01",
- "login": "admin@mars.fangcloud.com",
- "enterprise_id": 426870
}, - "parent": {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}, - "sequence_id": 9,
- "in_trash": false,
- "is_deleted": false,
- "is_frequently_used": false
}
请求示例(使用用户token):
curl --location 'https://open.fangcloud.com/api/v2/file/75003903445/info_v2' \
--header 'Authorization: Bearer bc326c4a-6eb0-4790-8cf3-3d19232af711'
id required | integer <int64> 文件id |
external_enterprise_id | integer <int64> 外协企业id,文件为外协企业文件时必填 |
{- "space": {
- "type": "personal"
}, - "sha1": "dc5d8f86d8d33eac2145eddaf1ff85dd38dcca5f",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 75003903445,
- "name": "0EB21E7F3E887DAEADC3E1B047BCA6AC (1).docx",
- "size": 21087,
- "created_at": 1624330900,
- "modified_at": 1624330900,
- "modified_by": {
- "id": 13117471,
- "name": "yfytest01",
- "login": "admin@mars.fangcloud.com",
- "enterprise_id": 426870
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 13117471,
- "name": "yfytest01",
- "login": "admin@mars.fangcloud.com",
- "enterprise_id": 426870
}, - "parent": {
- "type": "folder",
- "id": 0
}, - "sequence_id": 8,
- "in_trash": false,
- "is_deleted": false,
- "is_frequently_used": false
}
请求示例(使用用户token):
curl --location --request GET 'https://open.fangcloud.com/api/v2/file/recent_items?limit=1' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
limit required | integer <int32> >= 0 获取的条数 |
{- "files": [
- {
- "sha1": "1f5243f2ba7872206aef7197ea92762eddf47555",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 3990312,
- "name": "新建 Microsoft Word 文档.doc",
- "size": 26112,
- "created_at": 1461919867,
- "modified_at": 1461919868,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "sequence_id": 0
}, - {
- "sha1": "8cfed9a789a37cc8f195510ca34bd1c2800ea2a6",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 3990314,
- "name": "12.xls",
- "size": 23040,
- "created_at": 1461919873,
- "modified_at": 1462783210,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "sequence_id": 3
}
], - "folders": [ ],
- "total_count": 2,
- "page_id": 0,
- "page_capacity": 20,
- "page_count": 1
}
请求示例(使用用户token):
curl --location --request GET 'https://open.fangcloud.com/api/v2/file/75003907071/comments' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
id required | integer <int64> 文件id |
{- "success": true,
- "comments": [
- {
- "success": true,
- "id": 0,
- "content": "string",
- "created_at": 0,
- "user": {
- "id": 0,
- "name": "string",
- "login": "string",
- "enterprise_id": 0,
- "miniDepartmentList": [
- {
- "id": 0,
- "name": "string",
- "director": { },
- "user_count": 0,
- "children_departments_count": 0,
- "direct_item_count": 0,
- "order": 0,
- "level": 0,
- "parentDepartments": [
- { }
]
}
]
}
}
]
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/file/126000100472/mark_as_used' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
item_id required | integer <int64> 文件id |
{- "success": true
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/folder/179000000087/move' \
--header 'Authorization: Bearer d8ec3bc7-c7f2-40b6-a591-7b03c134478f' \
--header 'Content-Type: application/json' \
--data-raw '{
"target_folder_id": 179000000178,
"target_space": {
"type": "department",
"id": 179000000178
}
}'
id required | integer <int64> 移动文件的ID |
目标位置
target_folder_id required | integer <int64> (目标文件夹id) |
{- "success": true
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/file/75003685568/new_version_v2' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 1cd9081c-aa2c-4f30-a619-f32663dc57cc' \
--data '{
"name": "报表v1.0.pdf",
"upload_type": "api",
"remark": "新版本",
}'
该接口会返回上传地址,获取到上传地址后,上传文件示例:
curl --location 'https://upload01.fangcloud.com/upload/d125644c2e43449a8becbcf9217c5dcf/ae03113d47ed2732cc40480906705861869c2e7f7687528e29feee5c3ae1793c' \
--header 'Cookie: lang=zh-CN' \
--form 'file=@"/Users/liangxiaosheng/FangcloudV2/personal_space.localized/个人工作文件/个人/开放平台/开放平台使用文档/token介绍.jpg"' ```
id required | integer <int64> 文件id |
上传新版本详细信息
name required | string (文件名称,文件名称必须是1到222个字符,并且不能含有/ ? : * " > < \) |
remark | string (上传新版本时对新版本的备注) |
upload_type required | string (上传类型) 固定传api |
sha1 | string (文件sha1) |
external_enterprise_id | integer <int64> (v2版本支持该属性,用于处理获取外协文件预签名时,找不到该外协文件夹的企业ID问题) |
file_size | integer <int64> (文件大小) |
skip_logUser_activity | string (是否跳过记录行为) |
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/file/pack_download' \
--header 'Authorization: Bearer 583fad43-3265-45df-9e13-91fa5a22a2ca' \
--header 'Content-Type: application/json' \
--data '{
"item_typed_ids": [
"file_203003511640",
"folder_203000428376"
]
}'
文件/文件夹例表
item_typed_ids required | Array of strings (文件id或文件夹id) |
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/folder/179000000087/restore_from_trash' \
--header 'Authorization: Bearer bdd88b1c-aa8a-4126-b380-a1e64f9348a5'
id required | integer <int64> 从回收站回复的文件的ID |
{- "success": true
}
请求示例(使用用户token):
curl --location 'https://open.fangcloud.com/api/v2/folder/179000000087/update' \
--header 'Authorization: Bearer 583fad43-3265-45df-9e13-91fa5a22a2ca' \
--header 'Content-Type: application/json' \
--data '{
"name": "new name"
}'
id required | integer <int64> 更新文件的ID |
文件的详细信息
name | string (文件名,文件名称必须是1到222个字符,并且不能含有/ ? : * " > < \) |
description | string (文件描述,长度必须小于等于140个字符) |
{- "space": {
- "type": "personal"
}, - "sha1": "dc5d8f86d8d33eac2145eddaf1ff85dd38dcca5f",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 75003903445,
- "name": "0EB21E7F3E887DAEADC3E1B047BCA6AC (1).docx",
- "size": 21087,
- "created_at": 1624330900,
- "modified_at": 1624330900,
- "modified_by": {
- "id": 13117471,
- "name": "yfytest01",
- "login": "admin@mars.fangcloud.com",
- "enterprise_id": 426870
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 13117471,
- "name": "yfytest01",
- "login": "admin@mars.fangcloud.com",
- "enterprise_id": 426870
}, - "parent": {
- "type": "folder",
- "id": 0
}, - "sequence_id": 8,
- "in_trash": false,
- "is_deleted": false,
- "is_frequently_used": false
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/file/upload_by_path' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 003504d9-9a1e-4fc5-8b3e-188ee866b557' \
--header 'Cookie: lang=zh-CN' \
--data '{
"target_folder_path": "123/123",
"name": "text.tar",
"upload_type": "api"
}'
该接口会返回上传地址,获取到上传地址后,上传文件示例:
curl --location 'https://upload01.fangcloud.com/upload/d125644c2e43449a8becbcf9217c5dcf/ae03113d47ed2732cc40480906705861869c2e7f7687528e29feee5c3ae1793c' \
--header 'Cookie: lang=zh-CN' \
--form 'file=@"/Users/liangxiaosheng/FangcloudV2/personal_space.localized/个人工作文件/个人/开放平台/开放平台使用文档/token介绍.jpg"' ```
上传文件详细信息
target_folder_path required | string (路径名,以/划分文件夹,根目录在个人文件下,文件夹名称必须是1到222个字符,并且不能含有/ ? : * " > < |且末尾不能为“.”) |
name required | string (文件名称,文件名称必须是1到222个字符,并且不能含有/ ? : * " > < \) |
upload_type required | string (上传类型) 固定传api |
is_covered | boolean (为true时重名情况下直接返回上传新版本的预签名链接,默认为false) |
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/file/upload_v2' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 1cd9081c-aa2c-4f30-a619-f32663dc57cc' \
--data '{
"parent_id": "501002634212",
"name": "报表v1.0.pdf",
"upload_type": "api"
}'
该接口会返回上传地址,获取到上传地址后,上传文件示例:
curl --location 'https://upload01.fangcloud.com/upload/d125644c2e43449a8becbcf9217c5dcf/ae03113d47ed2732cc40480906705861869c2e7f7687528e29feee5c3ae1793c' \
--header 'Cookie: lang=zh-CN' \
--form 'file=@"/Users/liangxiaosheng/FangcloudV2/personal_space.localized/个人工作文件/个人/开放平台/开放平台使用文档/token介绍.jpg"' ```
上传文件详细信息
parent_id required | integer <int64> (上传至的文件夹id) |
name required | string (准备上传的文件的名称,文件名称必须是1到222个字符,并且不能含有/ ? : * " > < \) |
upload_type required | string (上传类型) 固定传api |
is_covered | boolean (为true时重名情况下直接返回上传新版本的预签名链接,默认为false) |
file_size | integer <int64> (文件的大小) |
external_enterprise_id | integer <int64> (v2接口支持该属性,用于处理获取外协文件预签名时,找不到该外协文件夹的企业ID问题) |
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/folder/179000000087/copy' \
--header 'Authorization: Bearer 583fad43-3265-45df-9e13-91fa5a22a2ca' \
--header 'Content-Type: application/json' \
--data '{
"target_folder_id": 179000000178
}'
id required | integer <int64> 文件夹id |
拷贝目标文件夹信息
target_folder_id required | integer <int64> (目标文件夹id) |
department_id | integer <int64> (部门id) >= 0 target_folder_id传0时有效,不填则放在个人空间根目录,填写则放在部门空间根目录 |
{- "space": {
- "type": "personal"
}, - "item_count": 0,
- "type": "folder",
- "id": 203000426996,
- "name": "new folders",
- "size": 0,
- "created_at": 1625039303,
- "modified_at": 1625039303,
- "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 13214349,
- "name": "yfytest01",
- "login": "venus@venus.fangcloud.com",
- "enterprise_id": 431512
}, - "parent": {
- "type": "folder",
- "id": 0
}, - "sequence_id": 0,
- "in_trash": false,
- "is_deleted": false,
- "is_frequently_used": false
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/folder/create' \
--header 'Authorization: Bearer 583fad43-3265-45df-9e13-91fa5a22a2ca' \
--header 'Content-Type: application/json' \
--data '{
"name": "new folders"
"parent_id": 75000441887
}'
文件夹的相信信息
name required | string (文件夹名,文件夹名称必须是1到222个字符,并且不能含有/ ? : * " > < \) |
parent_id required | integer <int64> (父文件夹id) |
department_id | integer <int64> (部门id) >= 0 parent_id传0时有效,不填则在个人空间根目录创建,填写则在部门空间根目录创建 |
{- "space": {
- "type": "personal"
}, - "item_count": 0,
- "type": "folder",
- "id": 203000426996,
- "name": "new folders",
- "size": 0,
- "created_at": 1625039303,
- "modified_at": 1625039303,
- "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 13214349,
- "name": "yfytest01",
- "login": "venus@venus.fangcloud.com",
- "enterprise_id": 431512
}, - "parent": {
- "type": "folder",
- "id": 0
}, - "sequence_id": 0,
- "in_trash": false,
- "is_deleted": false,
- "is_frequently_used": false
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/folder/create_by_path' \
--header 'Authorization: Bearer 583fad43-3265-45df-9e13-91fa5a22a2ca' \
--header 'Content-Type: application/json' \
--data '{
"target_folder_path": "会议测试/9.25/研发"
"department_id": 894823
}'
文件夹的相信信息
target_folder_path required | string (路径名,以/划分文件夹,根目录在个人文件下,文件夹名称必须是1到222个字符,并且不能含有/ ? : * " > < |且末尾不能为“.”) |
department_id | integer <int64> (不填则默认在个人文件下) >= 0 |
{- "space": {
- "type": "personal"
}, - "item_count": 0,
- "type": "folder",
- "id": 203000426996,
- "name": "new folders",
- "size": 0,
- "created_at": 1625039303,
- "modified_at": 1625039303,
- "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 13214349,
- "name": "yfytest01",
- "login": "venus@venus.fangcloud.com",
- "enterprise_id": 431512
}, - "parent": {
- "type": "folder",
- "id": 0
}, - "sequence_id": 0,
- "in_trash": false,
- "is_deleted": false,
- "is_frequently_used": false
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/folder/179000000087/delete_from_trash' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
id required | integer <int64> 文件夹id |
{- "success": true
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/folder/179000000087/delete' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
id required | integer <int64> 文件夹id |
{- "success": true
}
请求示例(使用用户token):
curl --location --request GET 'https://open.fangcloud.com/api/v2/folder/179000000087/trash' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
id required | integer <int64> 文件夹id |
{- "deleted_at": 1497513743,
- "deleted_by": {
- "id": 468,
- "name": "tt",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "folder_type": "normal",
- "id": 501000307503,
- "path": [
- {
- "name": "全部文件",
- "type": "folder",
- "id": 0
}
], - "sequence_id": 0,
- "name": "unittest_folder",
- "owned_by": {
- "name": "tt",
- "login": "tt@t.com",
- "id": 468,
- "enterprise_id": 1
}, - "type": "folder",
- "created_at": 1489053096,
- "size": 0,
- "description": "",
- "parent": {
- "name": "全部文件",
- "type": "folder",
- "id": 0
}, - "modified_at": 1489053096,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "item_count": 0
}
请求示例(使用用户token):
curl --location --request GET 'https://open.fangcloud.com/api/v2/folder/293001037960/children?folder_id=293001037960&type=all&page_capacity=100&page_id=1' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
id required | integer <int64> 文件夹id |
page_id | integer <int32> >= 0 页号(默认0) |
page_capacity | integer <int32> >= 1 Default: 20 页容量(默认20) |
type | string 分为file,folder,all三种,默认为all |
department_id | integer <int64> >= 0 部门id |
sort_by | string 分为name,date,size三种,默认为date |
sort_direction | string 分为desc,asc两种,默认为desc |
{- "files": [
- {
- "sha1": "1f5243f2ba7872206aef7197ea92762eddf47555",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 3990312,
- "name": "新建 Microsoft Word 文档.doc",
- "size": 26112,
- "created_at": 1461919867,
- "modified_at": 1461919868,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "sequence_id": 0
}, - {
- "sha1": "8cfed9a789a37cc8f195510ca34bd1c2800ea2a6",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 3990314,
- "name": "12.xls",
- "size": 23040,
- "created_at": 1461919873,
- "modified_at": 1462783210,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "sequence_id": 3
}
], - "folders": [ ],
- "total_count": 2,
- "page_id": 0,
- "page_capacity": 20,
- "page_count": 1
}
请求示例(使用用户token):
curl --location --request GET 'https://open.fangcloud.com/api/v2/folder/collab_folders?page_id=0&page_capacity=10&sort_by=name&sort_direction=desc' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
page_id | integer <int32> >= 0 页号(默认0) |
page_capacity | integer <int32> >= 1 Default: 20 页容量(默认20) |
sort_by | string 排序方式(‘name’, ‘date’, ‘size’) |
sort_direction | string 排序顺序(‘desc’, ‘asc’ |
{- "files": [
- {
- "sha1": "1f5243f2ba7872206aef7197ea92762eddf47555",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 3990312,
- "name": "新建 Microsoft Word 文档.doc",
- "size": 26112,
- "created_at": 1461919867,
- "modified_at": 1461919868,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "sequence_id": 0
}, - {
- "sha1": "8cfed9a789a37cc8f195510ca34bd1c2800ea2a6",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 3990314,
- "name": "12.xls",
- "size": 23040,
- "created_at": 1461919873,
- "modified_at": 1462783210,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "sequence_id": 3
}
], - "folders": [ ],
- "total_count": 2,
- "page_id": 0,
- "page_capacity": 20,
- "page_count": 1
}
请求示例(使用用户token):
curl --location --request GET 'https://open.fangcloud.com/api/v2/folder/department_folders?department_id=596371' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
page_id | integer <int32> >= 0 页码 |
page_capacity | integer <int32> >= 1 Default: 20 每页容量 |
department_id required | integer <int64> >= 0 部门ID |
sort_by | string 排序方式,分为name,date,size三种,默认为date |
sort_direction | string 排序顺序,分为desc,asc两种,默认为desc |
{- "files": [
- {
- "sha1": "1f5243f2ba7872206aef7197ea92762eddf47555",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 3990312,
- "name": "新建 Microsoft Word 文档.doc",
- "size": 26112,
- "created_at": 1461919867,
- "modified_at": 1461919868,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "sequence_id": 0
}, - {
- "sha1": "8cfed9a789a37cc8f195510ca34bd1c2800ea2a6",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 3990314,
- "name": "12.xls",
- "size": 23040,
- "created_at": 1461919873,
- "modified_at": 1462783210,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "sequence_id": 3
}
], - "folders": [ ],
- "total_count": 2,
- "page_id": 0,
- "page_capacity": 20,
- "page_count": 1
}
请求示例(使用用户token):
curl --location --request GET 'https://open.fangcloud.com/api/v2/folder/293001037960/info' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
id required | integer <int64> 文件夹id |
{- "space": {
- "type": "personal"
}, - "item_count": 0,
- "type": "folder",
- "id": 203000426996,
- "name": "new folders",
- "size": 0,
- "created_at": 1625039303,
- "modified_at": 1625039303,
- "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 13214349,
- "name": "yfytest01",
- "login": "venus@venus.fangcloud.com",
- "enterprise_id": 431512
}, - "parent": {
- "type": "folder",
- "id": 0
}, - "sequence_id": 0,
- "in_trash": false,
- "is_deleted": false,
- "is_frequently_used": false
}
请求示例(使用用户token):
curl --location --request GET 'https://open.fangcloud.com/api/v2/folder/personal_items?page_id=1&page_capacity=2&sort_by=name&sort_direction=asc' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
page_id | integer <int32> >= 0 页码 |
page_capacity | integer <int32> >= 1 Default: 20 每页容量 |
type | string 类型 |
sort_by | string Example: sort_by=['name', 'date', 'size'] 排序方式 |
sort_direction | string Example: sort_direction=['desc', 'asc'] 排序顺序 |
{- "files": [
- {
- "sha1": "1f5243f2ba7872206aef7197ea92762eddf47555",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 3990312,
- "name": "新建 Microsoft Word 文档.doc",
- "size": 26112,
- "created_at": 1461919867,
- "modified_at": 1461919868,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "sequence_id": 0
}, - {
- "sha1": "8cfed9a789a37cc8f195510ca34bd1c2800ea2a6",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 3990314,
- "name": "12.xls",
- "size": 23040,
- "created_at": 1461919873,
- "modified_at": 1462783210,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "sequence_id": 3
}
], - "folders": [ ],
- "total_count": 2,
- "page_id": 0,
- "page_capacity": 20,
- "page_count": 1
}
请求示例(使用用户token):
curl --location --request GET 'https://open.fangcloud.com/api/v2/folder/203000425147/collabs' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
id required | integer <int64> 文件夹id |
{- "final_role": "owner",
- "collabs": [
- {
- "accessible_by": {
- "type": "user",
- "id": 881525,
- "name": "隔壁老王"
}, - "accepted": true,
- "role": "owner"
}, - {
- "id": 407030,
- "accessible_by": {
- "type": "department",
- "id": 78385,
- "name": "222"
}, - "accepted": true,
- "role": "editor"
}, - {
- "id": 407033,
- "accessible_by": {
- "type": "group",
- "id": 94444,
- "name": "假发的就是"
}, - "accepted": true,
- "role": "editor"
}, - {
- "id": 403889,
- "accessible_by": {
- "type": "user",
- "id": 881526,
- "name": "小二上菜"
}, - "accepted": true,
- "role": "editor"
}
]
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/folder/179000000087/move' \
--header 'Authorization: Bearer 583fad43-3265-45df-9e13-91fa5a22a2ca' \
--header 'Content-Type: application/json' \
--data '{
"target_folder_id": 179000000178
}'
id required | integer <int64> 文件夹id |
移动目标文件夹信息
target_folder_id required | integer <int64> (目标文件夹id) |
department_id | integer <int64> (部门id) >= 0 target_folder_id传0时有效,不填则放在个人空间根目录,填写则放在部门空间根目录 |
{- "success": true
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/folder/179000000087/restore_from_trash' \
--header 'Authorization: Bearer 775eb65c-8545-419d-823c-ffb5d42d75c0'
id required | integer <int64> 文件夹id |
{- "success": true
}
请求示例(使用用户token):
curl --location --request POST 'https://open.fangcloud.com/api/v2/folder/179000000087/update' \
--header 'Authorization: Bearer 583fad43-3265-45df-9e13-91fa5a22a2ca' \
--header 'Content-Type: application/json' \
--data '{
"name": "ew name"
}'
id required | integer <int64> 文件夹id |
文件夹的详细信息
name | string (文件夹名,文件夹名称必须是1到222个字符,并且不能含有/ ? : * " > < \) |
description | string (备注) |
{- "space": {
- "type": "personal"
}, - "item_count": 0,
- "type": "folder",
- "id": 203000426996,
- "name": "new folders",
- "size": 0,
- "created_at": 1625039303,
- "modified_at": 1625039303,
- "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 13214349,
- "name": "yfytest01",
- "login": "venus@venus.fangcloud.com",
- "enterprise_id": 431512
}, - "parent": {
- "type": "folder",
- "id": 0
}, - "sequence_id": 0,
- "in_trash": false,
- "is_deleted": false,
- "is_frequently_used": false
}
{- "frequent_items": [
- {
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 203003489684,
- "name": "测试文档xxxqqq (2).docx",
- "size": 19236,
- "created_at": 1625133897,
- "modified_at": 1625133897,
- "modified_by": {
- "id": 13214349,
- "name": "yfytest01",
- "login": "venus@venus.fangcloud.com",
- "enterprise_id": 431512
}, - "description": "",
- "path": [ ],
- "owned_by": {
- "id": 13214349,
- "name": "yfytest01",
- "login": "venus@venus.fangcloud.com",
- "enterprise_id": 431512
}, - "sequence_id": 0,
- "file_version_key": "0b2ddce24b1e50daef05b21243be9b04",
- "permissions": [
- "item_upload",
- "item_download",
- "item_create_comment",
- "item_own",
- "item_preview",
- "item_view",
- "item_share",
- "edit_properties",
- "item_create_collab",
- "item_restore",
- "permanent_delete",
- "item_edit_collab",
- "item_delete"
], - "in_trash": false,
- "is_deleted": false,
- "is_frequently_used": true
}, - {
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 203003487135,
- "name": "360萌新的Q&A.docx",
- "size": 18376,
- "created_at": 1624955256,
- "modified_at": 1624955256,
- "modified_by": {
- "id": 13214349,
- "name": "yfytest01",
- "login": "venus@venus.fangcloud.com",
- "enterprise_id": 431512
}, - "description": "",
- "path": [ ],
- "owned_by": {
- "id": 13214349,
- "name": "yfytest01",
- "login": "venus@venus.fangcloud.com",
- "enterprise_id": 431512
}, - "sequence_id": 0,
- "file_version_key": "5020b40d88f733a976478a4d9e2f914f",
- "permissions": [
- "item_upload",
- "item_download",
- "item_create_comment",
- "item_own",
- "item_preview",
- "item_view",
- "item_share",
- "edit_properties",
- "item_create_collab",
- "item_restore",
- "permanent_delete",
- "item_edit_collab",
- "item_delete"
], - "in_trash": false,
- "is_deleted": false,
- "is_frequently_used": true
}
], - "total_count": 2
}
{- "created_at": 1496992074,
- "children_departments_count": 1,
- "director": {
- "id": 881525,
- "name": "xxx",
- "login": "autov2@test.com",
- "enterprise_id": 12401
}, - "direct_item_count": 1,
- "id": 65820,
- "name": "xxx",
- "user_count": 4,
- "parent_id": 0,
- "order": 1
}
id required | integer <int64> 群组id |
query_words | string 查询关键字 |
page_id | integer <int32> >= 0 页码 |
{- "users": [
- {
- "user_group": "admin",
- "email": "xxx@test.com",
- "phone": "12312312312",
- "space_total": 2199023255552,
- "space_used": 0,
- "profile_pic_key": "ee1bacaffb0128a26b51afaf17126a8b",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881525,
- "name": "xxx",
- "login": "xxx@test.com",
- "enterprise_id": 12401
}, - {
- "user_group": "user",
- "email": "xxx@test.com",
- "phone": "12312312312",
- "space_total": 5368709120,
- "space_used": 8745602,
- "profile_pic_key": "",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881533,
- "name": "xxx",
- "login": "xxx@test.com",
- "enterprise_id": 12401
}, - {
- "user_group": "user",
- "email": "xxx@test.com",
- "phone": "",
- "space_total": 2199023255552,
- "space_used": 0,
- "profile_pic_key": "",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881572,
- "name": "xxx",
- "login": "xxx@test.com",
- "enterprise_id": 12401
}, - {
- "user_group": "user",
- "email": "xxx@test.com",
- "phone": "12312312312",
- "space_total": 2199023255552,
- "space_used": 2869229,
- "profile_pic_key": "0cb601c50ed619267bb791cfe2a60ade",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881526,
- "name": "xxx",
- "login": "autov22@test.com",
- "enterprise_id": 12401
}
], - "total_count": 4,
- "page_id": 0,
- "page_capacity": 500,
- "page_count": 1
}
query_words required | string 搜索关键词,不能为空 |
type | string 搜索类型,分为file,folder,all三种,默认为all |
sort_by | string 排序方式,分为’name’, ‘date’, ‘size’, ‘score’ |
sort_direction | string 排序顺序,分为’desc’, ‘asc’ |
page_id | integer <int32> 第几页,每页默认20,默认为第0页 |
search_in_folder | integer <int64> 指定父文件夹,匹配的结果都是该文件夹的子文件或子文件夹 |
fields | integer <int64> 是否展示文件权限,需要展示填写perssion,不需要则不填写 |
query_filter | string 搜索过滤类型,分为file_name,content,creator, tag, all五种,默认为all |
updated_time_range | string 指定更新时间范围搜索,格式为开始和结束时间戳,并以逗号分隔(如:‘1509954358,1509954360’),两个时间戳均可以不传,为空就表示不对开始或结束时间进行限制,但是逗号必须传(如:’,1509954360’ 或 ‘1509954358,’ 或 ‘,’) |
department_id | string 根据存储空间 0 人个空间, -1 与我协作 111 部门id 搜索 |
precise_search | boolean 是否精确搜索 |
{- "files": [
- {
- "sha1": "1f5243f2ba7872206aef7197ea92762eddf47555",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 3990312,
- "name": "新建 Microsoft Word 文档.doc",
- "size": 26112,
- "created_at": 1461919867,
- "modified_at": 1461919868,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "sequence_id": 0
}, - {
- "sha1": "8cfed9a789a37cc8f195510ca34bd1c2800ea2a6",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 3990314,
- "name": "12.xls",
- "size": 23040,
- "created_at": 1461919873,
- "modified_at": 1462783210,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "sequence_id": 3
}
], - "folders": [ ],
- "total_count": 2,
- "page_id": 0,
- "page_capacity": 20,
- "page_count": 1
}
数据集添加训练任务信息
data_id required | integer <int64> (数据集id) |
analysis_method required | string (解析类型) direct_segment(通用文本类型,支持云盘文件或者文件夹,支持文件类型:docx、txt、pdf、md)qa(问答,只支持云盘文件,支持文件类型:csv、xlsx)table(表格类型,只支持云盘文件,支持文件类型:xlsx) |
file_type required | string (文件类型) file(文件)folder(文件夹) |
file_id required | integer <int64> (文件夹或文件夹id) |
object (训练参数(类型为direct_segment时候需要传)) |
{- "success": true
}
ai对话接口参数
question required | string (问题) |
gpt_type required | string (模型类型,可选值:360GPT(智脑)、 Doubao(豆包)) |
{- "result": "对不起,我无法实时获取当前的天气信息。如果你需要了解今天的天气情况,可以使用手机上的天气应用程序、访问气象网站或者收听当地的天气预报频道。这样你可以得到最准确和最新的天气信息。",
- "success": true
}
请求参数说明
参数字段 | 字段类型 | 是否必须 | 字段说明 |
---|---|---|---|
messages | List[Dict] | 是 | 包含迄今为止对话消息列表,这是一个结构体的列表,每个元素类似如下:{"role": "user", "content": "你好"} role 只支持 user , assistant 其一,content 不得为空,user 为用户角色,assistant 为知识号角色 |
knowledgeGptId | string | 否 | 知识员工id,chatType为ZSH_CHAT时必填,ASSISTANT_CHAT类型不需要传 |
sessionId | string | 是 | 对话标识,调用方随机生成,同一对话需要保持一致 |
chatType | string | 是 | 固定为:ZSH_CHAT(知识号对话,需传知识员工id),ASSISTANT_CHAT(AI助手对话) |
请求示例
{
"messages": [
{"role": "user", "content": "如何调用开放平台?"}
],
"knowledgeGptId": "291",
"sessionId": "1721706231962_7248294",
"chatType":"KNOWLEDGE_GPT"
}
返回字段说明
stream 格式返回:
content字段是AI回答的文本内容
返回示例
data:{"choices":[{"delta":{"content":" // 包含了JWT令牌","role":"assistant"},"finishReason":"null","index":0,"message":{"content":" // 包含了JWT令牌","role":"assistant"}}],"created":0,"object":""}
data:{"choices":[{"delta":{"content":"的构建逻辑和网络请求实现\n","role":"assistant"},"finishReason":"null","index":0,"message":{"content":"的构建逻辑和网络请求实现\n","role":"assistant"}}],"created":0,"object":""}
完整示例
知识号对话:
curl --location 'https://open.fangcloud.com/api/v2/knowledge/chatStream' \
--header 'Authorization: Bearer cb806f3c-8d68-49ab-9925-4eefe3c8ec96' \
--header 'Content-Type: application/json' \
--data '{
"messages": [
{"role": "user", "content": "如何调用开放平台?"}
],
"knowledgeGptId": "321",
"sessionId": "1721706231962_7248294",
"chatType":"ZSH_CHAT"
}'
数据集匹配测试信息
data_id required | integer <int64> (数据集id) >= 1 |
question required | string (问题) |
{- "match_result_list": [
- {
- "answer": "万亿大模型 VS PB级/亿级知识文档\n文档大模型能力3:Grounding(对话能力增强)\n助力大模型落地接入业务语境\n[\n]\nAI文件助手\nAI云文档\nAI知识问答\n文档大模型\n文档大模型能力3:Grounding对话能力增强\n精确定位答案来源,提升可信度\n[\n]\nAI文件助手\nAI云文档\nAI知识问答\n文档大模型\n文档云大模型和文心一言在文档处理场景的关键能力对比\n大模型技能\n测试问题\n文档云大模型\n文心一言模型\n回答包含图片\n非遗保护的基本原则有哪些?\n拒答能力\n爱奇艺是什么?\n相似问题生成\n非遗保护的工作目标(根据答案生成问题\n的相关性)\n关键词提取\n实能科技企业期化器,众创空向奖励政策。对新认定的\n国家级和省纽科技企业斯化器分别给予 200 万元、100 \n万元的奖励,对年度绩败评价优秀的国家报和省纽科技\n企业化带分别给予 100 万元,50 万元的奖励,对年居\n绩效评价结果排多前 20 位的省级以上众创空向给予 50 \n万元的奖励。",
- "file_id": 1421,
- "file_name": "360智能文档云【v1.0】产品介绍.pdf",
- "id": 171508340014212,
- "score": 1.7348562,
- "task_type": "direct_segment",
- "vector_text": "万亿大模型 VS PB级/亿级知识文档\n文档大模型能力3:Grounding(对话能力增强)\n助力大模型落地接入业务语境\n[\n]\nAI文件助手\nAI云文档\nAI知识问答\n文档大模型\n文档大模型能力3:Grounding对话能力增强\n精确定位答案来源,提升可信度\n[\n]\nAI文件助手\nAI云文档\nAI知识问答\n文档大模型\n文档云大模型和文心一言在文档处理场景的关键能力对比\n大模型技能\n测试问题\n文档云大模型\n文心一言模型\n回答包含图片\n非遗保护的基本原则有哪些?\n拒答能力\n爱奇艺是什么?\n相似问题生成\n非遗保护的工作目标(根据答案生成问题\n的相关性)\n关键词提取\n实能科技企业期化器,众创空向奖励政策。对新认定的\n国家级和省纽科技企业斯化器分别给予 200 万元、100 \n万元的奖励,对年度绩败评价优秀的国家报和省纽科技\n企业化带分别给予 100 万元,50 万元的奖励,对年居\n绩效评价结果排多前 20 位的省级以上众创空向给予 50 \n万元的奖励。"
}, - {
- "answer": "召回\n2、关联文件查看(可控制是否显示)\nAI知识问答(2)\n基于现有FAQ生成答案,优于传统FAQ客服\n[\n]\nAI文件助手\nAI云文档\nAI知识问答\n文档大模型\n识别上下文\n自动内容更新(更新附件内容即可)\n易于理解的总结性回答\n传统FAQ客服\n智能FAQ客服\nAI知识问答(3)\n[ 问答机器人支持多渠道发布,站内直接访问、站外H5/API对接\n]\nAI文件助手\nAI云文档\nAI知识问答\n文档大模型\n通过URL的方式接入到第三方应用官网\n微信公众号嵌入&朋友圈分享\n钉钉等IM集成\n官网等应用嵌入浏览器\n通过URL的方式接入到微信公众号\n通过URL的方式接入到钉钉等IM应用\nAI知识问答配置平台(1)\n满足个人和专业场景的知识问答配置\n[\n]\nAI文件助手\nAI云文档\nAI知识问答\n文档大模型\n知识号创建\n问答配置\n知识训练\n数据集管理\n匹配测试\n多渠道发布\nAI知识问答配置平台(2)\n提供极简模式,零门槛快速创建\n[\n]\nAI文件助手\nAI云文档\nAI知识问答\n文档大模型\n零学习成本\n帮助个人用户快速创\n建自己的知识问答号\n1.设置名称\n \n2.选择需要训练的文档 \n3.设置开场白及默认问题\n4.提交并完成训练\nAI知识问答配置平台(3)\n提供专业知识训练,提升回答准确度\n[\n]\nAI文件助手\nAI云文档\nAI知识问答\n文档大模型\n面向企业场景的专\n业知识训练模式,\n提升真实&复杂场\n景下的回答准确性\n提供三种文档导入及知识训练方式:\n• 文本分段:基于语境的分片方法解决传统分片引起的语义断裂问题\n• AI生成问答对:通过大模型分析文本内容,智能化生成问答对\n• 导入问答对:基于用户现有FAQ文档,快速导入训练\n通过大模型生成相似问题,提升AI回答的命中率\n问答匹配测试,持续训练调优\n",
- "file_id": 1421,
- "file_name": "360智能文档云【v1.0】产品介绍.pdf",
- "id": 171508340014217,
- "score": 1.7303435,
- "task_type": "direct_segment",
- "vector_text": "召回\n2、关联文件查看(可控制是否显示)\nAI知识问答(2)\n基于现有FAQ生成答案,优于传统FAQ客服\n[\n]\nAI文件助手\nAI云文档\nAI知识问答\n文档大模型\n识别上下文\n自动内容更新(更新附件内容即可)\n易于理解的总结性回答\n传统FAQ客服\n智能FAQ客服\nAI知识问答(3)\n[ 问答机器人支持多渠道发布,站内直接访问、站外H5/API对接\n]\nAI文件助手\nAI云文档\nAI知识问答\n文档大模型\n通过URL的方式接入到第三方应用官网\n微信公众号嵌入&朋友圈分享\n钉钉等IM集成\n官网等应用嵌入浏览器\n通过URL的方式接入到微信公众号\n通过URL的方式接入到钉钉等IM应用\nAI知识问答配置平台(1)\n满足个人和专业场景的知识问答配置\n[\n]\nAI文件助手\nAI云文档\nAI知识问答\n文档大模型\n知识号创建\n问答配置\n知识训练\n数据集管理\n匹配测试\n多渠道发布\nAI知识问答配置平台(2)\n提供极简模式,零门槛快速创建\n[\n]\nAI文件助手\nAI云文档\nAI知识问答\n文档大模型\n零学习成本\n帮助个人用户快速创\n建自己的知识问答号\n1.设置名称\n \n2.选择需要训练的文档 \n3.设置开场白及默认问题\n4.提交并完成训练\nAI知识问答配置平台(3)\n提供专业知识训练,提升回答准确度\n[\n]\nAI文件助手\nAI云文档\nAI知识问答\n文档大模型\n面向企业场景的专\n业知识训练模式,\n提升真实&复杂场\n景下的回答准确性\n提供三种文档导入及知识训练方式:\n• 文本分段:基于语境的分片方法解决传统分片引起的语义断裂问题\n• AI生成问答对:通过大模型分析文本内容,智能化生成问答对\n• 导入问答对:基于用户现有FAQ文档,快速导入训练\n通过大模型生成相似问题,提升AI回答的命中率\n问答匹配测试,持续训练调优\n"
}
], - "success": true
}
创建知识员工信息
name required | string (知识员工名称) |
intro | string (知识员工介绍) |
system_prompt | string (知识员工设定(知识员工设定和数据集两项最少填一项)) |
chat_intro | string (开场白) |
data_ids | Array of integers <int64> (数据集id列表(知识员工设定和数据集两项最少填一项)) [ items <int64 > ] |
no_recall_replay | string (超纲回答(数据集列表不为空有效)) |
show_preview | boolean (不传为false(数据集列表不为空有效)) |
show_doc_source | boolean (不传为false(数据集列表不为空有效)) |
Array of objects (默认问题) | |
temperature | number <double> (回答风格,默认:0.6) 可选值:0.3、0.4、0.5、0.6、0.7、0.8、0.9 |
{- "id": 123
}
获取Ai文件详情信息
ai_file_id required | integer <int64> (ai文件训练得到的数据集id) |
{- "success": true,
- "suggestion_list": [
- "今晚杭州的强对流天气具体有哪些特点?",
- "在雨天驾车出行时,有哪些安全措施需要特别注意?",
- "未来一周杭州的天气趋势是怎样的?"
], - "summary_mind_map": "由于我无法创建视觉图像,我将以Markdown格式提供文本形式的思维导图。以下是根据您提供的内容创建的思维导图:\n\n\n# 杭州交警提醒\n\n## 天气预警\n- 今晚强对流天气\n - 局部大暴雨\n - 雷雨大风\n- 白天多云到阴\n - 对出行影响不大\n- 后半夜到明天上午最强时段\n\n## 防范措施\n- 注意强对流天气防范\n- 15日天气恢复平静\n- 16日起雨水再次出现\n- 17-19日阵雨或雷雨增多\n\n## 驾车出行注意事项\n- 保证良好视线\n - 检查雨刷器\n - 除雾模式\n- 控制车速\n - 避免急刹\n- 转弯要慢\n - 避免急打方向\n- 减少超车、并线\n- 加大前后车距\n- 正确使用灯光\n- 积水路段要小心\n\n## 温馨提示\n1. 防范局地强降雨、雷雨大风\n2. 15日早晨能见度较低\n\n## 天气趋势预报\n- 14日(周日)\n - 上午阴有阵雨或雷雨\n - 下午到前半夜阴有时有阵雨或雷雨\n - 后半夜转阴到多云\n- 15日(周一)\n - 多云\n- 16日(周二)\n - 多云到阴,局部有阵雨或雷雨\n- 17日(周三)\n - 多云转阴有阵雨或雷雨\n- 18日(周四)\n - 阴有阵雨或雷雨\n- 19日(周五)\n - 阴有时有阵雨或雷雨\n\n## 发布信息\n- 杭州市气象台\n- 4月13日11时发布\n\n\n请注意,Markdown格式的思维导图在视觉上可能不如专业的思维导图软件直观,但它提供了一种结构化的方式来呈现信息。"
}
查询知识员工详情信息
knowledge_gpt_id required | integer <int64> (知识员工id) |
{- "knowledge_gpt_id": 310,
- "base_info": {
- "name": "开放平台测试",
- "intro": "开放平台测试",
- "system_prompt": "测试",
- "chat_intro": "你好,我是开放平台使用小助手,使用开放平台的问题可以直接问题。",
- "data_ids": [
- 112
], - "no_recall_replay": "请参考开放平台在线文档地址,这里能找到你的答案:https://open.fangcloud.com",
- "show_preview": true,
- "show_doc_source": true,
- "suggested_question_complex": [
- {
- "label": "默认",
- "question": [
- "开放平台上是什么?",
- "如何使用使用开放平台?",
- "如何获取开放平台token?",
- "如何调用开放平台接口?",
- "如何上传文件?",
- "企业级token和个人级token的区别什么?",
- "如何获取用户信息?",
- "什么情况下需要使用企业级、什么情况下需要使用个人级?以及如何",
- "有没有demo/有没有XX语言的demo?"
]
}, - {
- "label": "标签1",
- "question": [
- "12",
- "222"
]
}
], - "temperature": 0.3
}, - "share_info": {
- "status": true,
- "expiration": "2024-08-29T15:59:59.000+0000",
- "show_scope": "enterprise",
- "token": "a7xxxf3c-724e-4684-b87f-54d1cbf791cc"
}, - "square_info": {
- "publish_square_enabled": true,
- "user_ids": [ ],
- "view_scope": "selected"
}
}
{- "Knowledge_gpt_list": [
- {
- "id": 321,
- "name": "123",
- "system_prompt": "123",
- "intro": "123",
- "chat_intro": "123",
- "suggested_question": [
- "今天天气怎么样!"
]
}
], - "success": true
}
查询数据集问答对列表信息
data_id required | integer <int64> (数据集id) >= 1 |
page_size required | integer <int64> (页容量) >= 1 |
page_no required | integer <int64> (页码) >= 1 |
{- "qa_list": [
- {
- "answer": "##亿方云开放平台是基于亿方云基础业务和功能向开发者提供二次开发的服务平台,为企业提供丰富的云盘文档协同管理解决方案。企业或第三方合作伙伴可以快速低成本地接入亿方云,实现存储、查看、分享、协作等一站式文件管理。激活企业非结构数据资产价值,助你的企业更快一步。\n\n##亿方云开放平台提供UI组件、SDK、API等接入方式,10行代码助你构建企业文件统一管理平台。",
- "question": "亿方云开放平台是什么?",
- "file_id": "3264",
- "file_name": "副本知识号模版 (1) (2).csv",
- "id": "173027927232640"
}, - {
- "answer": "通过开放平台接口,可以实现用调用接口的方式实现云盘内的操作,使业务场景和云盘紧密结合,提升工作效率。",
- "question": "开放平台有什么功能?",
- "file_id": "3264",
- "file_name": "副本知识号模版 (1) (2).csv",
- "id": "173027927232641"
}
], - "total": 2,
- "success": true
}
查询数据集知识片段列表信息
data_id required | integer <int64> (数据集id) >= 1 |
page_size required | integer <int64> (页容量) >= 1 |
page_no required | integer <int64> (页码) >= 1 |
{- "segment_list": [
- {
- "content": "高血压防治知识\n自测血压\n方法\n使用经过国际标准方案认证的上臂式家用自动电子血压计,不推荐腕式血压计、手指血压计、水银柱血压计进行家庭血压监测。",
- "extension": "docx",
- "file_content_size": 452,
- "file_id": "2773",
- "file_name": "附件3高血压防治核心信息.docx",
- "id": "172553105827730"
}
], - "total": 1,
- "success": true
}
查询训练任务详情列表信息
data_id required | integer <int64> (数据集id) >= 1 |
task_type required | string (类型) direct_segment(文件,直接分段)csv_qa_import(CSV问答导入) |
page_size | integer <int64> (页容量,不传默认为10) >= 1 |
page_num | integer <int64> (页码,从1开始,不传默认为1) >= 1 |
{- "train_file_info": [
- {
- "id": 1,
- "file_name": "测试1",
- "file_id": 501007356821,
- "file_type": "folder",
- "status": 1,
- "analysis_method": "direct_segment"
}, - {
- "id": 2,
- "file_name": "测试2",
- "file_id": 501007356821111,
- "file_type": "folder",
- "status": 1,
- "analysis_method": "direct_segment"
}
], - "total": 2,
- "page_size": 10,
- "page_num": 1
}
添加的审阅信息
file_ids | Array of integers <int64> (审阅的文件id列表) [ items <int64 > ] |
title | string (审阅标题) |
due_time | string (过期时间(xxxx-xx-xx,例如2021-10-09)) |
description | string (审阅描述) |
invited_user_ids | Array of integers <int64> (被邀请审阅的人的用户id列表) [ items <int64 > ] |
{- "id": 123,
- "name": "abc"
}
id required | integer <int64> 审阅id |
修改的审阅信息
deleted_reviewers | Array of integers <int64> (删除审阅者) [ items <int64 > ] |
added_reviewers | Array of integers <int64> (添加审阅者) [ items <int64 > ] |
due_time | string (过期时间(xxxx-xx-xx,例如2021-10-09)) |
{- "id": 576197,
- "inviter": {
- "id": 13214349,
- "name": "yfytest01",
- "login": "venus@venus.fangcloud.com",
- "enterprise_id": 431512
}, - "name": "123",
- "description": "123",
- "created_at": 1625564498,
- "modified_at": 1625564500,
- "due_time": 0,
- "reviewers": [ ],
- "items": [
- {
- "extension": "docx",
- "created_at": 1625564498,
- "modified_at": 1625564498,
- "id": 203003491974,
- "name": "测试文档xxxqqq (5).docx",
- "typed_id": "file_203003491974",
- "user_id": 0,
- "size": 19111,
- "parent_folder_id": 0,
- "in_trash": false,
- "is_deleted": false
}
], - "is_complete": true,
- "need_sign": false,
- "is_expired": true
}
id required | integer <int64> 审阅id |
page_id required | integer <int32> 页码 |
page_capacity required | integer <int32> 每页容量 |
{- "review": {
- "id": 576197,
- "name": "123"
}, - "review_comments": [
- {
- "id": 308712,
- "user": {
- "id": 13214349,
- "name": "xxx",
- "login": "xxxxxxx",
- "enterprise_id": 431512
}, - "content": "435345",
- "created_at": 1626078407,
- "is_voice": false,
- "voice_length": 0,
- "voice_storage_path_mp3": "",
- "voice_storage_path_ogg": ""
}
], - "review_comment_count": 1,
- "total_count": 4,
- "page_id": 0,
- "page_capacity": 1,
- "page_count": 4
}
{- "id": 576197,
- "inviter": {
- "id": 13214349,
- "name": "yfytest01",
- "login": "venus@venus.fangcloud.com",
- "enterprise_id": 431512
}, - "name": "123",
- "description": "123",
- "created_at": 1625564498,
- "modified_at": 1625564500,
- "due_time": 0,
- "reviewers": [ ],
- "items": [
- {
- "extension": "docx",
- "created_at": 1625564498,
- "modified_at": 1625564498,
- "id": 203003491974,
- "name": "测试文档xxxqqq (5).docx",
- "typed_id": "file_203003491974",
- "user_id": 0,
- "size": 19111,
- "parent_folder_id": 0,
- "in_trash": false,
- "is_deleted": false
}
], - "is_complete": true,
- "need_sign": false,
- "is_expired": true
}
添加的审阅评论信息
content required | string (审阅评论内容) |
review_id | integer <int64> (审阅id) |
{- "success": true,
- "id": 0,
- "content": "string",
- "review": {
- "id": 0,
- "name": "string"
}, - "created_at": 0,
- "is_voice": true,
- "voice_length": 0,
- "voice_storage_path_mp3": "string",
- "password_protected": "string",
- "user": {
- "id": 0,
- "name": "string",
- "login": "string",
- "enterprise_id": 0,
- "miniDepartmentList": [
- {
- "id": 0,
- "name": "string",
- "director": { },
- "user_count": 0,
- "children_departments_count": 0,
- "direct_item_count": 0,
- "order": 0,
- "level": 0,
- "parentDepartments": [
- { }
]
}
]
}
}
tag_name required | string 标签名称 |
sort_by required | string Example: sort_by=name, date, size 排序方式 |
sort_direction required | string Example: sort_direction=desc, asc 排序顺序 |
page_id required | integer <int32> 页码,从1开始 |
{- "files": [
- {
- "sha1": "1f5243f2ba7872206aef7197ea92762eddf47555",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 3990312,
- "name": "新建 Microsoft Word 文档.doc",
- "size": 26112,
- "created_at": 1461919867,
- "modified_at": 1461919868,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "sequence_id": 0
}, - {
- "sha1": "8cfed9a789a37cc8f195510ca34bd1c2800ea2a6",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 3990314,
- "name": "12.xls",
- "size": 23040,
- "created_at": 1461919873,
- "modified_at": 1462783210,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "sequence_id": 3
}
], - "folders": [ ],
- "total_count": 2,
- "page_id": 0,
- "page_capacity": 20,
- "page_count": 1
}
type | string 搜索类型,可选值: file, folder, all |
sort_by | string 排序方式,可选值: name, date, size, score |
sort_direction | string 排序顺序,可选值: desc, asc |
page_id | integer <int32> >= 0 页码 |
page_capacity | integer <int32> >= 1 Default: 20 每页容量 |
{- "files": [
- {
- "sha1": "1f5243f2ba7872206aef7197ea92762eddf47555",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 3990312,
- "name": "新建 Microsoft Word 文档.doc",
- "size": 26112,
- "created_at": 1461919867,
- "modified_at": 1461919868,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "sequence_id": 0
}, - {
- "sha1": "8cfed9a789a37cc8f195510ca34bd1c2800ea2a6",
- "comments_count": 0,
- "extension_category": "document",
- "type": "file",
- "id": 3990314,
- "name": "12.xls",
- "size": 23040,
- "created_at": 1461919873,
- "modified_at": 1462783210,
- "modified_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "description": "",
- "path": [
- {
- "type": "folder",
- "id": 0,
- "name": "全部文件"
}
], - "owned_by": {
- "id": 468,
- "name": "tt2",
- "login": "tt@t.com",
- "enterprise_id": 1
}, - "sequence_id": 3
}
], - "folders": [ ],
- "total_count": 2,
- "page_id": 0,
- "page_capacity": 20,
- "page_count": 1
}
{- "id": 449,
- "enterprise": {
- "id": 1,
- "name": "测试企业",
- "admin_user_id": 111
}, - "name": "qyang1",
- "phone": "15088679770",
- "email": "qyang1@admin.com",
- "login": "qyang1@admin.com",
- "profile_pic_key": "f2b7154b8fa0500004fa0cde46e5e214",
- "active": true,
- "full_name_pinyin": "qyang1",
- "pinyin_first_letters": "qyang1"
}
{- "departments": [
- {
- "id": 70419,
- "name": "222",
- "director": {
- "id": 881525,
- "name": "隔壁老王",
- "login": "autov2@test.com",
- "enterprise_id": 12401
}, - "user_count": 3,
- "children_departments_count": 0,
- "direct_item_count": 6
}, - {
- "id": 69938,
- "name": "autotest_Dvk_1516903746",
- "director": {
- "id": 881525,
- "name": "隔壁老王",
- "login": "autov2@test.com",
- "enterprise_id": 12401
}, - "user_count": 4,
- "children_departments_count": 2,
- "direct_item_count": 23
}
]
}
{- "id": 449,
- "enterprise": {
- "id": 1,
- "name": "测试企业",
- "admin_user_id": 111
}, - "name": "qyang1",
- "phone": "15088679770",
- "email": "qyang1@admin.com",
- "login": "qyang1@admin.com",
- "profile_pic_key": "f2b7154b8fa0500004fa0cde46e5e214",
- "active": true,
- "full_name_pinyin": "qyang1",
- "pinyin_first_letters": "qyang1"
}
query_words | string 搜索关键字,默认企业所有用户 |
page_id | integer <int32> >= 0 页码,默认为0 |
{- "users": [
- {
- "user_group": "admin",
- "email": "xxx@test.com",
- "phone": "12312312312",
- "space_total": 2199023255552,
- "space_used": 0,
- "profile_pic_key": "ee1bacaffb0128a26b51afaf17126a8b",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881525,
- "name": "xxx",
- "login": "xxx@test.com",
- "enterprise_id": 12401
}, - {
- "user_group": "user",
- "email": "xxx@test.com",
- "phone": "12312312312",
- "space_total": 5368709120,
- "space_used": 8745602,
- "profile_pic_key": "",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881533,
- "name": "xxx",
- "login": "xxx@test.com",
- "enterprise_id": 12401
}, - {
- "user_group": "user",
- "email": "xxx@test.com",
- "phone": "",
- "space_total": 2199023255552,
- "space_used": 0,
- "profile_pic_key": "",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881572,
- "name": "xxx",
- "login": "xxx@test.com",
- "enterprise_id": 12401
}, - {
- "user_group": "user",
- "email": "xxx@test.com",
- "phone": "12312312312",
- "space_total": 2199023255552,
- "space_used": 2869229,
- "profile_pic_key": "0cb601c50ed619267bb791cfe2a60ade",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881526,
- "name": "xxx",
- "login": "autov22@test.com",
- "enterprise_id": 12401
}
], - "total_count": 4,
- "page_id": 0,
- "page_capacity": 500,
- "page_count": 1
}
{- "id": 449,
- "enterprise": {
- "id": 1,
- "name": "测试企业",
- "admin_user_id": 111
}, - "name": "qyang1",
- "phone": "15088679770",
- "email": "qyang1@admin.com",
- "login": "qyang1@admin.com",
- "profile_pic_key": "f2b7154b8fa0500004fa0cde46e5e214",
- "active": true,
- "full_name_pinyin": "qyang1",
- "pinyin_first_letters": "qyang1"
}
新部门的相关信息
name required | string (部门名称,长度不能超过30个字符) |
parent_id required | integer <int64> (父部门id) |
director_id | integer <int64> (部门管理员id) >= 1 |
Array of objects (特殊成员信息) | |
space_total | integer <int64> (总共空间,单位为GB,默认为20) >= 1 |
hide_phone | boolean (是否隐藏部门成员手机号,默认和上级部门保持一致) |
disable_share | boolean (是否禁用分享,默认和上级部门保持一致) |
enable_watermark | boolean (是否开启水印预览,默认和上级部门保持一致) |
create_common_folder | boolean (是否建立公共资料库,默认false) |
collab_auto_accepted | boolean (是否自动接受协作邀请,默认false) |
{- "director": {
- "id": 881525,
- "name": "xxx",
- "login": "xxx@test.com"
}, - "space_used": 79152336,
- "space_total": 21474836480,
- "special_users": [ ],
- "hide_phone": false,
- "disable_share": false,
- "enable_watermark": false,
- "collab_auto_accepted": false,
- "id": 65820,
- "name": "亿方云测试",
- "parent_id": 0,
- "order": 1
}
platform_id required | integer <int64> 平台id,私有部署一般默认为:2 |
客户部门id列表
{- "department_file_manager_info_list": [
- {
- "department_id": 123,
- "custom_department_id": 123,
- "customUser_list": [
- {
- "id": 123,
- "name": "xxx",
- "custom_id": "123",
- "email": "123@abc.cn",
- "phone": "",
- "department_ids": [
- {
- "department_id": 123,
- "custom_department_id": "123",
- "name": "xxx"
}
]
}
]
}
]
}
{- "director": {
- "id": 881525,
- "name": "xxx",
- "login": "xxx@test.com"
}, - "space_used": 79152336,
- "space_total": 21474836480,
- "special_users": [ ],
- "hide_phone": false,
- "disable_share": false,
- "enable_watermark": false,
- "collab_auto_accepted": false,
- "id": 65820,
- "name": "亿方云测试",
- "parent_id": 0,
- "order": 1
}
id required | integer <int64> 部门id |
部门的相关信息
name required | string (部门名称,长度不能超过30个字符) |
parent_id | integer <int64> (父部门id) >= 0 |
director_id | integer <int64> (部门管理员id) >= -1 |
Array of objects (特殊成员信息) | |
space_total | integer <int64> (总共空间,单位为GB,默认为20) >= 1 |
hide_phone | boolean (是否隐藏部门成员手机号,默认和上级部门保持一致) |
disable_share | boolean (是否禁用分享,默认和上级部门保持一致) |
enable_watermark | boolean (是否开启水印预览,默认和上级部门保持一致) |
collab_auto_accepted | boolean (是否自动接受协作邀请,默认false) |
file_managers | Array of integers <int64> (文件管理员id列表) [ items <int64 > ] |
permission_type | string (部门权限) |
{- "director": {
- "id": 881525,
- "name": "xxx",
- "login": "xxx@test.com"
}, - "space_used": 79152336,
- "space_total": 21474836480,
- "special_users": [ ],
- "hide_phone": false,
- "disable_share": false,
- "enable_watermark": false,
- "collab_auto_accepted": false,
- "id": 65820,
- "name": "亿方云测试",
- "parent_id": 0,
- "order": 1
}
id required | integer <int64> 部门ID |
query_words | string 查询关键字 |
page_id | integer <int32> >= 0 页码 |
{- "users": [
- {
- "user_group": "admin",
- "email": "xxx@test.com",
- "phone": "12312312312",
- "space_total": 2199023255552,
- "space_used": 0,
- "profile_pic_key": "ee1bacaffb0128a26b51afaf17126a8b",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881525,
- "name": "xxx",
- "login": "xxx@test.com",
- "enterprise_id": 12401
}, - {
- "user_group": "user",
- "email": "xxx@test.com",
- "phone": "12312312312",
- "space_total": 5368709120,
- "space_used": 8745602,
- "profile_pic_key": "",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881533,
- "name": "xxx",
- "login": "xxx@test.com",
- "enterprise_id": 12401
}, - {
- "user_group": "user",
- "email": "xxx@test.com",
- "phone": "",
- "space_total": 2199023255552,
- "space_used": 0,
- "profile_pic_key": "",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881572,
- "name": "xxx",
- "login": "xxx@test.com",
- "enterprise_id": 12401
}, - {
- "user_group": "user",
- "email": "xxx@test.com",
- "phone": "12312312312",
- "space_total": 2199023255552,
- "space_used": 2869229,
- "profile_pic_key": "0cb601c50ed619267bb791cfe2a60ade",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881526,
- "name": "xxx",
- "login": "autov22@test.com",
- "enterprise_id": 12401
}
], - "total_count": 4,
- "page_id": 0,
- "page_capacity": 500,
- "page_count": 1
}
新群组的相关信息
name required | string (群组名称,长度不能超过30个字符) |
admin_user_id | integer <int64> (群组管理员id,默认没有) >= 1 |
description | string (群组描述) |
visible | boolean (是否可见,默认false) |
collab_auto_accepted | boolean (是否自动接受协作邀请,默认false,当群组管理员为空时默认为true) |
{- "is_visible": true,
- "collab_auto_accepted": true,
- "id": 123,
- "name": "autotest_Ldm_123",
- "description": "",
- "created_at": 1513102764,
- "user_count": 0
}
获取该公司的可见的群组列表
query_words | string 查询关键字 |
page_id | integer <int32> >= 0 页码 |
{- "created_at": 1496992074,
- "children_departments_count": 1,
- "director": {
- "id": 881525,
- "name": "xxx",
- "login": "autov2@test.com",
- "enterprise_id": 12401
}, - "direct_item_count": 1,
- "id": 65820,
- "name": "xxx",
- "user_count": 4,
- "parent_id": 0,
- "order": 1
}
id required | integer <int64> 群组id |
群组的相关信息
name | string (群组名称,长度不能超过30个字符) |
admin_user_id | integer <int64> (群组管理员id,默认没有) >= -1 |
description | string (群组描述) |
visible | boolean (是否可见,默认false) |
collab_auto_accepted | boolean (是否自动接受协作邀请,默认false,当群组管理员为空时默认为true) |
{- "is_visible": true,
- "collab_auto_accepted": true,
- "id": 123,
- "name": "autotest_Ldm_123",
- "description": "",
- "created_at": 1513102764,
- "user_count": 0
}
id required | integer <int64> 群组id |
query_words | string 查询关键字 |
page_id | integer <int32> >= 0 页码 |
{- "users": [
- {
- "user_group": "admin",
- "email": "xxx@test.com",
- "phone": "12312312312",
- "space_total": 2199023255552,
- "space_used": 0,
- "profile_pic_key": "ee1bacaffb0128a26b51afaf17126a8b",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881525,
- "name": "xxx",
- "login": "xxx@test.com",
- "enterprise_id": 12401
}, - {
- "user_group": "user",
- "email": "xxx@test.com",
- "phone": "12312312312",
- "space_total": 5368709120,
- "space_used": 8745602,
- "profile_pic_key": "",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881533,
- "name": "xxx",
- "login": "xxx@test.com",
- "enterprise_id": 12401
}, - {
- "user_group": "user",
- "email": "xxx@test.com",
- "phone": "",
- "space_total": 2199023255552,
- "space_used": 0,
- "profile_pic_key": "",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881572,
- "name": "xxx",
- "login": "xxx@test.com",
- "enterprise_id": 12401
}, - {
- "user_group": "user",
- "email": "xxx@test.com",
- "phone": "12312312312",
- "space_total": 2199023255552,
- "space_used": 2869229,
- "profile_pic_key": "0cb601c50ed619267bb791cfe2a60ade",
- "is_active": true,
- "is_phone_public": true,
- "full_name_pinyin": "xxx",
- "id": 881526,
- "name": "xxx",
- "login": "autov22@test.com",
- "enterprise_id": 12401
}
], - "total_count": 4,
- "page_id": 0,
- "page_capacity": 500,
- "page_count": 1
}
操作类型信息
action_types | Array of integers <int64> (日志操作类型) [ items <int64 > ] |
is_all | boolean |
{- "action_types": {
- "1": "登录成功",
- "2": "登出",
- "3": "登录失败",
- "4": "修改密码",
- "5": "发起重置密码",
- "6": "重置密码",
- "7": "使用新设备登录",
- "8": "使用被删除过的设备登录",
- "9": "使用6个月没有访问记录的设备登录",
- "10": "邀请成员",
- "11": "删除成员",
- "12": "设置员工存储空间",
- "13": "用户注册",
- "14": "用户激活",
- "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": "关闭邮箱隐藏",
- "100": "复制",
- "101": "移动",
- "102": "新建文件夹",
- "103": "从回收站删除",
- "104": "删除",
- "105": "从回收站恢复",
- "106": "搜索",
- "107": "下载",
- "108": "上传文件",
- "109": "重命名",
- "110": "删除历史版本",
- "111": "新建文件",
- "112": "设置当前版本",
- "113": "上传新版本",
- "114": "下载历史版本",
- "115": "添加常用",
- "116": "移出常用",
- "117": "添加标签",
- "118": "删除标签",
- "119": "修改说明",
- "120": "保存(分享转存)",
- "121": "锁定文件",
- "122": "解锁文件",
- "123": "新建部门文件夹",
- "124": "重命名部门文件夹",
- "125": "取消部门文件夹属性",
- "126": "移动到部门文件夹",
- "127": "转交文件夹所有者权限",
- "128": "开启禁用分享",
- "129": "关闭禁用分享",
- "130": "开启水印预览",
- "131": "关闭水印预览",
- "132": "订阅",
- "133": "取消订阅",
- "138": "移到隔离区",
- "139": "从隔离区恢复",
- "140": "从隔离区删除",
- "141": "从回收站部分还原",
- "142": "在线编辑文件",
- "200": "添加评论",
- "201": "删除评论",
- "202": "编辑评论",
- "300": "发起审阅",
- "301": "编辑审阅",
- "302": "结束了审阅",
- "303": "发表评论",
- "305": "创建签字审阅",
- "306": "导出了审阅",
- "307": "发起审阅",
- "308": "重新提交",
- "309": "关闭审阅",
- "310": "同意",
- "311": "拒绝",
- "312": "退回",
- "313": "编辑抄送人",
- "400": "发起分享",
- "401": "删除分享链接",
- "402": "设置分享权限",
- "403": "分享文件(夹)到",
- "405": "编辑分享设置",
- "406": "编辑分享留言",
- "407": "编辑分享版本",
- "408": "关闭分享",
- "409": "打开分享",
- "410": "添加成员",
- "411": "删除成员",
- "500": "邀请协作者",
- "501": "移出协作者",
- "502": "修改协作权限",
- "503": "公司成员加入协作",
- "504": "邀请外部协作者",
- "505": "创建协作链接",
- "506": "修改协作链接",
- "507": "删除协作链接",
- "508": "外部协作者加入协作",
- "509": "外部协作者加入协作",
- "510": "公司成员加入协作(自动接受)",
- "511": "添加协作者(系统逻辑)",
- "512": "同意部门加入协作",
- "513": "同意群组加入协作",
- "514": "同意群组加入协作(自动接受)",
- "515": "移出协作者(系统逻辑)",
- "516": "群组加入协作",
- "517": "部门加入协作",
- "518": "群组加入协作(自动接受)",
- "519": "部门加入协作(自动接受)",
- "520": "外部协作者加入协作",
- "521": "邀请外部协作者",
- "522": "外部协作者加入协作",
- "600": "预览",
- "601": "预览历史版本",
- "700": "接受群组邀请",
- "701": "拒绝群组邀请",
- "702": "新建群组",
- "703": "解散群组",
- "704": "编辑群组信息",
- "705": "添加群组成员",
- "706": "移出群组成员",
- "709": "退出群组",
- "710": "设置群组管理员",
- "711": "设置群组属性",
- "712": "自动接受群组邀请",
- "713": "取消群组管理员",
- "805": "同步文件夹",
- "806": "取消同步文件夹",
- "900": "编辑企业信息",
- "901": "设置密码安全等级",
- "902": "设置回收站保留天数",
- "903": "更换Logo",
- "904": "冻结企业",
- "905": "关闭亿方云推广Banner",
- "906": "开启亿方云推广Banner",
- "907": "设置分享页标题",
- "908": "开启企业成员二次验证",
- "909": "关闭企业成员二次验证",
- "910": "开启所有分享链接均不允许下载",
- "911": "关闭所有分享链接均不允许下载",
- "912": "开启所有分享链接均仅限公司成员访问",
- "913": "关闭所有分享链接均仅限公司成员访问",
- "914": "开启禁止下载",
- "915": "关闭禁止下载",
- "916": "开启企业成员个人存储空间",
- "917": "关闭企业成员个人存储空间",
- "918": "开启个人文件内不允许邀请协作",
- "919": "关闭个人文件内不允许邀请协作",
- "920": "开启不允许编辑者邀请协作",
- "921": "关闭不允许编辑者邀请协作",
- "922": "开启不允许共同所有者邀请协作",
- "923": "关闭不允许共同所有者邀请协作",
- "924": "设置文件页显示组织架构层数",
- "925": "选择文案模板",
- "926": "开启禁用分享",
- "927": "关闭禁用分享",
- "928": "开启水印预览",
- "929": "关闭水印预览",
- "930": "显示参与协作的部门文件夹的路径信息",
- "931": "关闭参与协作的部门文件夹的路径信息",
- "1000": "新建部门",
- "1001": "编辑部门信息",
- "1002": "新增部门主管",
- "1003": "更换部门主管",
- "1004": "删除部门",
- "1005": "移除部门成员",
- "1006": "新增部门成员",
- "1007": "新增部门成员(系统逻辑)",
- "1008": "编辑部门存储空间",
- "1009": "删除部门主管",
- "1010": "新增部门特殊成员",
- "1011": "取消部门特殊成员",
- "1012": "编辑部门所属存储",
- "1013": "移动部门",
- "1014": "新增文件管理员",
- "1015": "删除文件管理员",
- "1016": "设置根目录权限",
- "1100": "新建文件夹收集任务",
- "1101": "编辑文件夹收集任务",
- "1102": "结束文件夹收集任务",
- "1103": "贡献了子文件夹",
- "1200": "参与收集",
- "1201": "发起收集",
- "1202": "截止收集",
- "1203": "开启收集",
- "1204": "编辑收集",
- "1205": "添加成员",
- "1206": "删除成员",
- "1300": "发起全盘查毒",
- "1301": "全盘查毒完成",
- "1302": "开启自动查毒",
- "1303": "关闭自动查毒",
- "1400": "使用白名单程序打开文件",
- "1401": "使用非白名单程序打开文件被阻止",
- "1402": "阻止移动操作",
- "1403": "阻止复制操作",
- "1404": "开启文件防泄露系统",
- "1405": "关闭文件防泄露系统",
- "1406": "编辑文件防泄露系统",
- "1407": "解密文件",
- "1408": "开启文件管控",
- "1409": "关闭文件管控",
- "1410": "修改审批人",
- "1411": "设置白名单用户",
- "1412": "修改文件安全管控策略",
- "1420": "开启/关闭安全外发包",
- "1422": "编辑安全外发包默认权限",
- "1423": "创建安全外发包",
- "1500": "发起行为审批",
- "1501": "同意",
- "1502": "拒绝",
- "1503": "发表评论",
- "1504": "关闭行为审批",
- "1600": "新增文件管理员",
- "1601": "删除文件管理员",
- "1700": "开启",
- "1701": "关闭",
- "1702": "开启",
- "1703": "关闭",
- "1704": "添加",
- "1705": "编辑",
- "1706": "删除",
- "1707": "添加",
- "1708": "删除",
- "1710": "开启",
- "1711": "关闭",
- "1712": "开启",
- "1713": "关闭",
- "1714": "开启",
- "1715": "关闭",
- "1716": "开启",
- "1717": "关闭",
- "1718": "开启",
- "1719": "关闭",
- "1720": "添加",
- "1721": "编辑",
- "1722": "删除",
- "1800": "发起文件摆渡",
- "1801": "接收摆渡文件",
- "1802": "摆渡基础设置",
- "1803": "摆渡发起设置",
- "1804": "摆渡接收设置"
}
}
日志信息
start_date required | string (起始时间,格式为:yyyy-MM-dd, 不得早于今日前90天) |
end_date required | string (截止时间,格式为:yyyy-MM-dd, 不得迟于今日) |
page_number | integer <int64> (页数) |
page_size | integer <int64> (页容量) |
action_types | Array of integers <int64> (日志类型) [ items <int64 > ] |
file_ids | Array of integers <int64> (文件id列表) [ items <int64 > ] |
folder_ids | Array of integers <int64> (文件夹id列表) [ items <int64 > ] |
review_ids | Array of integers <int64> (审阅id列表) [ items <int64 > ] |
emails | Array of strings (邮箱列表) |
folder_collection_ids | Array of integers <int64> (文件夹手机手机列表) [ items <int64 > ] |
department_ids | Array of integers <int64> (部门id列表) [ items <int64 > ] |
user_ids | Array of integers <int64> (用户id列表) [ items <int64 > ] |
{- "total_count": 2,
- "user_activities": [
- {
- "created": 1541405251,
- "action_type": {
- "name": "预览",
- "id": "600"
}, - "operator": {
- "user_name": "test",
- "login": "t@test.com",
- "id": "881525"
}, - "target": {
- "target_file_name": "图片.jpeg",
- "size": "69.88KB",
- "id": "181000464235"
}, - "additional_info": {
- "preview_user": {
- "id": "1118256",
- "name": "test2",
- "login": "t2@test.com"
}
}, - "platform": {
- "service_name": "客户端: WEB",
- "ip_address": "IP:115.123.61.114(浙江 杭州)"
}
}, - {
- "created": 1541402802,
- "action_type": {
- "name": "预览",
- "id": "600"
}, - "operator": {
- "user_name": "test",
- "login": "t@test.com",
- "id": "881525"
}, - "target": {
- "target_file_name": "文档.pdf",
- "size": "43.97KB",
- "id": "181000464239"
}, - "additional_info": {
- "info": {
- "path": "个人文件/预览文件夹/"
}
}, - "platform": {
- "service_name": "客户端: WEB",
- "ip_address": "IP:115.123.61.114(浙江 杭州)"
}
}
], - "success": true
}
日志信息
start_date required | string (起始时间,格式为:yyyy-MM-dd, 不得早于今日前90天) |
end_date required | string (截止时间,格式为:yyyy-MM-dd, 不得迟于今日) |
page_id | integer <int64> (页码,默认为1) |
page_capacity | integer <int64> (页容量,默认为25,不超过500) |
{- "user_activities": [
- {
- "created": 1541405251,
- "action_type": {
- "name": "预览",
- "id": "600"
}, - "operator": {
- "user_name": "test",
- "login": "t@test.com",
- "id": "881525"
}, - "target": {
- "target_file_name": "图片.jpeg",
- "size": "69.88KB",
- "id": "181000464235"
}, - "additional_info": {
- "preview_user": {
- "id": "1118256",
- "name": "test2",
- "login": "t2@test.com"
}
}, - "platform": {
- "service_name": "客户端: WEB",
- "ip_address": "IP:115.236.61.114(浙江 杭州)"
}
}, - {
- "created": 1541402802,
- "action_type": {
- "name": "预览",
- "id": "600"
}, - "operator": {
- "user_name": "test",
- "login": "t@test.com",
- "id": "881525"
}, - "target": {
- "target_file_name": "文档.pdf",
- "size": "43.97KB",
- "id": "181000464239"
}, - "additional_info": {
- "info": {
- "path": "个人文件/预览文件夹/"
}
}, - "platform": {
- "service_name": "客户端: WEB",
- "ip_address": "IP:115.236.61.114(浙江 杭州)"
}
}
], - "success": true
}
日志信息
date required | string (日期,格式为:yyyy-MM-dd) |
pagination | integer <int64> (页容量) |
page_capacity | integer <int64> (页码数) |
{- "pagination": 1,
- "user_activities": [
- {
- "created": 1541405251,
- "action_type": {
- "name": "预览",
- "id": "600"
}, - "operator": {
- "user_name": "test",
- "login": "t@test.com",
- "id": "881525"
}, - "target": {
- "target_file_name": "图片.jpeg",
- "size": "69.88KB",
- "id": "181000464235"
}, - "additional_info": {
- "preview_user": {
- "id": "1118256",
- "name": "test2",
- "login": "t2@test.com"
}
}, - "platform": {
- "service_name": "客户端: WEB",
- "ip_address": "IP:115.236.61.114(浙江 杭州)"
}
}, - {
- "created": 1541402802,
- "action_type": {
- "name": "预览",
- "id": "600"
}, - "operator": {
- "user_name": "test",
- "login": "t@test.com",
- "id": "881525"
}, - "target": {
- "target_file_name": "文档.pdf",
- "size": "43.97KB",
- "id": "181000464239"
}, - "additional_info": {
- "info": {
- "path": "个人文件/预览文件夹/"
}
}, - "platform": {
- "service_name": "客户端: WEB",
- "ip_address": "IP:115.236.61.114(浙江 杭州)"
}
}
], - "success": true
}
id required | integer <int64> 平台id,私有部署一般默认为:2 |
department_id required | string 部门个性化id |
yfy_department_id required | integer <int64> 亿方云平台上的部门id |
{- "custom_id": "xxx",
- "director": {
- "id": 881525,
- "name": "xxx",
- "login": "xxx@test.com"
}, - "space_used": 79152336,
- "space_total": 21474836480,
- "special_users": [ ],
- "hide_phone": false,
- "disable_share": false,
- "enable_watermark": false,
- "collab_auto_accepted": false,
- "id": 65820,
- "name": "亿方云测试",
- "parent_id": 0,
- "order": 1
}
id required | integer <int64> 平台id,私有部署一般默认为:2 |
group_id required | string 群组个性化id |
yfy_group_id required | integer <int64> 亿方云平台上的群组id |
{- "custom_id": "xxx",
- "is_visible": true,
- "collab_auto_accepted": true,
- "id": 157290,
- "name": "autotest_Ldm_1513102763",
- "description": "",
- "created_at": 1513102764,
- "user_count": 0
}
user_id和yfy_user_id两个参数二选一,若都传则使用user_id
id required | integer <int64> 平台id,私有部署一般默认为:2 |
user_id required | string 用户个性化id |
yfy_user_id required | integer <int64> 亿方云平台上的用户id |
{- "custom_id": "xxx",
- "hide_phone": false,
- "disable_download": false,
- "space_used": 14481,
- "space_total": 21474836480,
- "id": 881525,
- "name": "xxx",
- "login": "xxx@xxx.com",
- "phone": "11111111111",
- "email": "xxx@xxx.com",
- "profile_pic_key": "ee1bacaffb0128a26b51afaf17126a8b",
- "active": true,
- "full_name_pinyin": "xxx",
- "pinyin_first_letters": "xxx"
}
id required | integer <int64> 平台id,私有部署一般默认为:2 |
用户的同步信息
required | Array of objects (同步的用户信息) |
default_department_id | string (默认加入的部门id) |
default_group_id | string (默认加入的群组id) |
custom_password | string (同步用户登录account密码) |
{- "success_items_count": 1,
- "request_id": "sadasdsd-fgewrsecd-sdfsdwer-sddsf"
}
新用户的相关信息
phone | string (用户手机) |
string (用户邮箱) | |
storage_id | integer <int64> (用户存储id,非多存储不需要关心) |
space_total | integer <int64> (用户空间大小,-1为无限,单位为GB) |
hide_phone | boolean (是否隐藏手机号,默认为false) |
disable_download | boolean (是否禁用下载,默认为false) |
force_active | boolean (是否强制激活,默认为false) |
password | string (当force_active为true时,必须提供并且长度在6-32位之间,false时忽略该参数) |
{- "hide_phone": false,
- "disable_download": false,
- "space_used": 14481,
- "space_total": 21474836480,
- "id": 881525,
- "name": "xxx",
- "login": "xxx@xxx.com",
- "phone": "11111111111",
- "email": "xxx@xxx.com",
- "profile_pic_key": "ee1bacaffb0128a26b51afaf17126a8b",
- "active": true,
- "full_name_pinyin": "xxx",
- "pinyin_first_letters": "xxx"
}
identifier required | string 用户标识 |
type required | string Example: type=simple_phone_or_email(手机号或者邮箱), user_ticket(个性化用户id) 用户标识类型 |
platform_id required | integer <int64> >= 1 平台id,私有部署一般默认为:2 |
{- "auth_key": "ejqeobGoeT",
- "client_id": "e885b1d0-39e4-49eb-be06-16078cf3f613",
- "expires_in": 300
}
identifier required | string 用户标识 |
type required | string Example: type=simple_phone_or_email(手机号或者邮箱), user_ticket(个性化用户id) 用户标识类型 |
platform_id required | integer <int64> >= 1 平台id,私有部署一般默认为:2 |
{- "id": 449,
- "enterprise": {
- "id": 1,
- "name": "测试企业",
- "admin_user_id": 111
}, - "name": "qyang1",
- "phone": "15088679770",
- "email": "qyang1@admin.com",
- "login": "qyang1@admin.com",
- "profile_pic_key": "f2b7154b8fa0500004fa0cde46e5e214",
- "active": true,
- "full_name_pinyin": "qyang1",
- "pinyin_first_letters": "qyang1"
}
id required | integer <int64> 用户id |
last_login_flag | boolean 是否查询用户最后登录时间 |
{- "hide_phone": false,
- "disable_download": false,
- "space_used": 14481,
- "space_total": 21474836480,
- "id": 881525,
- "name": "xxx",
- "login": "xxx@xxx.com",
- "phone": "11111111111",
- "email": "xxx@xxx.com",
- "profile_pic_key": "ee1bacaffb0128a26b51afaf17126a8b",
- "active": true,
- "full_name_pinyin": "xxx",
- "pinyin_first_letters": "xxx"
}
id required | integer <int64> 用户ID |
用户的相关信息
name | string (用户名称,长度不能超过30个字符) |
storage_id | integer <int64> (用户存储id,非多存储不需要关心) |
space_total | integer <int64> (用户空间大小,-1为无限,单位为GB) |
hide_phone | boolean (是否隐藏手机号,默认为false) |
disable_download | boolean (是否禁用下载,默认为false) |
{- "hide_phone": false,
- "disable_download": false,
- "space_used": 14481,
- "space_total": 21474836480,
- "id": 881525,
- "name": "xxx",
- "login": "xxx@xxx.com",
- "phone": "11111111111",
- "email": "xxx@xxx.com",
- "profile_pic_key": "ee1bacaffb0128a26b51afaf17126a8b",
- "active": true,
- "full_name_pinyin": "xxx",
- "pinyin_first_letters": "xxx"
}