Development API Overview
BabelBird develops APIs to connect the authentication, file, sharing, organization, messaging and login capabilities of enterprise network disks to third-party business systems. The left column is grouped by interface function, and the callable endpoints are listed directly in the group.
Call overview
- The enterprise administrator creates a developer account in the private cloud enterprise management background and obtains
client_id,client_secretand JWT related keys. - In the OAuth callback method, use
/api/authorize.doto obtain the authorization code, and then use/api/token.doto obtainaccess_token. - JWT login-free method uses
/api/authorizeByJWT.door/account/tokenLogin.do, and private deployment needs to enable the corresponding configuration. - File access API requests need to carry
Authorization: Bearer <access_token>in the HTTP Header. - POST, PUT, DELETE requests usually use
Content-Type: application/json.
Java JWT Integration Example
The following example is adapted from the BabelBird API integration sample. It demonstrates how to generate a JWT string. In a real project, replace the secret, enterprise domain, user email, phone number, employee ID and client_id with values provided by the enterprise admin console or implementation team. Do not expose the JWT secret in frontend pages, client packages or public repositories.
The JWT payload contains three core fields:
| Field | Description |
|---|---|
time |
Token generation timestamp in milliseconds |
duration |
Token validity duration in seconds |
payload |
Business payload. For user login-free access, use email, phone or babelId; for /api/authorizeByJWT.do, use client_id |
Common usage:
- User login-free access: generate
userToken, then open/account/tokenLogin.do?userToken=<JWT_TOKEN>. - OAuth/JWT authorization: generate
jwt_token, then open/api/authorizeByJWT.do?response_type=code&client_id=<CLIENT_ID>&jwt_token=<JWT_TOKEN>&email=<USER_EMAIL>, and exchange the returnedcodeforaccess_token. - File API calls: after obtaining
access_token, includeAuthorization: Bearer <access_token>in subsequent file, sharing and enterprise API requests.
Minimal implementation outline: first build payload, for example {email: "user@example.com"} for user login-free access or {client_id: "<CLIENT_ID>"} for developer authorization; then build JWT claims as {time: current Unix timestamp in milliseconds, duration: 60, payload: payload}; sign the claims with the enterprise JWT secret using HS256 / HmacSHA256; finally pass the signed JWT string as userToken or jwt_token in the corresponding URL.
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import javax.crypto.SecretKey;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.security.Keys;
public final class BabelJwtExample {
public static String createToken(Map<String, Object> payload) {
String secret = System.getenv("BABEL_JWT_SECRET");
if (secret == null || secret.isEmpty()) {
throw new IllegalStateException("BABEL_JWT_SECRET is required");
}
SecretKey key = Keys.hmacShaKeyFor(secret.getBytes(StandardCharsets.UTF_8));
Map<String, Object> claims = new HashMap<>();
claims.put("time", System.currentTimeMillis());
claims.put("duration", 60);
claims.put("payload", payload);
return Jwts.builder().claims(claims).signWith(key, Jwts.SIG.HS256).compact();
}
}
This sample uses JJWT 0.12.x. Use matching versions of jjwt-api, jjwt-impl, and jjwt-jackson; see the official JJWT documentation. The BabelBird example uses the secret's UTF-8 bytes. Confirm any different encoding with the implementation team instead of truncating, padding, or transforming the key. HS256 requires a key of at least 256 bits; request a suitable key if the library rejects it.
This function signs a token; it is not a login service or complete JWT validator. BabelBird's time and duration are custom fields, not the standard exp claim. Resolve the user identity from an authenticated server-side session, never log generated tokens, and validate authorization and expiry behavior against the target deployment.
API Grouping
| Grouping | Main purpose | Typical entrance |
|---|---|---|
| Authentication API | Developer account, OAuth callback, JWT login-free, Token acquisition and refresh | Get token |
| File API | File list, file information, upload and download, version, move copy, recycle bin, material library classification | Get file list |
| Sharing API | Sharing link, sharing permissions, participants, attention reminders | Get file sharing url |
| Enterprise API | Enterprise information, departments, members, enterprise logs | Get current enterprise information |
| Message and login API | Announcements, department discussions, JWT token login, common status codes | JWT token login |
Single interface page
Each API entry has an independent page, allowing developers to check paths, methods, parameters and return information by interface.
- GET authentication interface one (login callback method):
/api/authorize.do - GET authentication interface two (login-free JWT token method):
/api/authorizeByJWT.do - POST Get token:
/api/token.do - POST refresh token:
/api/refreshToken.do - GET Get file list:
/nd/api/file/list_dir - GET Get file information:
/nd/api/file/fileinfo - POST create folder:
/nd/api/file/create_folder - GET preupload file:
/api/file/preUploadFile.do - GET Get download file address:
/api/file/getFileDownloadUrl.do - GET Get download multi-file address:
/api/file/downloadMultiFiles.do - GET Get download file thumbnail address:
/api/file/downloadThumbnail.do - POST modify file information:
/nd/api/file/update_file - POST modify file name:
/nd/api/file/rename - POST delete file (to recycle bin):
/nd/api/file/remove_file - POST remove file (from trash):
/nd/api/file/remove_from_trash - POST Empty Trash:
/nd/api/file/empty_trash - POST restore file (from recycle bin):
/nd/api/file/restore_file - GET Get all version information of the file:
/nd/api/file/versions - POST setting file current version:
/nd/api/file/version - POST move file:
/nd/api/file/move - POST copy file:
/nd/api/file/copy - POST copy file progress:
/nd/api/file/copy_progress - GET file log:
/nd/api/file/file_logs - POST sets whether the user has permission to access the material library:
/nd/api/file/set_user_access_material_library - POST Create Material Library Classification:
/nd/api/file/create_material_class - POST create sub-material library:
/nd/api/file/create_material_folder - GET Get the share url of the file:
/nd/api/share/shareurl - GET Get the shared permission list:
/nd/api/share/share_roles - GET Get the sharing role that the user has permission to set for a single file:
/nd/api/share/share_role_forfile - POST Create Link Share:
/nd/api/share/open_link_share - POST close link sharing:
/nd/api/share/close_link_share - POST set link sharing password:
/nd/api/share/set_share_password - POST invite people to participate in sharing:
/nd/api/share/invite_share - GET Get all sharing participants:
/nd/api/share/share_participants - POST set permission roles of sharing participants:
/nd/api/share/set_participant_role - POST delete sharing participant:
/nd/api/file/remove_share_participant - POST reminder:
/nd/api/file/focus_file - POST remove someone's attention:
/nd/api/file/unfocus_file - GET Get the list of users focusing on the file:
/nd/api/file/user_focusfile - GET Get the list of users who can focus on the file and mark the users who have focused on the file:
/nd/api/file/user_can_focusfile - GET Get current enterprise information:
/nd/api/enterprise/current - GET Get information about all departments of the enterprise:
/nd/api/enterprise/departments - POST Create Enterprise Department:
/nd/api/enterprise/create_department - GET Get department role list:
/nd/api/enterprise/dep_role - POST add department personnel:
/nd/api/enterprise/add_dep_mem - POST delete department personnel:
/nd/api/enterprise/remove_dep_mem - GET to obtain information about your own department:
/nd/api/enterprise/mydeparments - GET Get Department Members:
/nd/api/enterprise/departmentmembers - POST add enterprise members:
/nd/api/enterprise/add_ent_mem - POST update member information:
/api/updateUserInfo.do - GET Get enterprise member information:
/api/getEnterpriseMember.do - POST Get all members of the enterprise:
/nd/api/enterprise/enterprise_members - POST Get Enterprise Logs:
/nd/api/enterprise/enterprise_logs - POST Release Announcement:
/nd/api/enterprise/broadcast - GET Get published announcements:
/nd/api/enterprise/broadcast - POST Send Department Discussion:
/nd/api/file/send_dep_discussion - POST Get department discussion:
/nd/api/file/dep_discussion - GET Get Enterprise Logs:
/nd/api/enterprise/enterprise_logs - GET JWT token login:
/account/tokenLogin.do
JWT Identity and Confidentiality
Explicitly pass the intended user's email, phone or babelId to /api/authorizeByJWT.do. The source permits an administrator identity when omitted. Do not omit identity or trust an unverified caller-supplied identity. Signing does not encrypt a JWT payload; avoid sensitive cleartext and do not log production tokens.