### Get Enterprise Installed Application List Response Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/app/app-management/list-installed-apps This JSON structure represents a successful response when retrieving the list of installed applications. It includes details about each application, pagination tokens, and total counts. ```json { "data": { "items": [ { "callback_urls": [ "string" ], "description": "string", "i18n": [ { "description": "string", "lang_code": "string", "name": "string" } ], "id": "string", "logo": "string", "name": "string", "online_version_id": "string", "owner": { "owner_id": "string" }, "scopes": [ { "auth_types": [ "string" ], "description": "string", "name": "string" } ], "status": "enable", "type": "isv", "unaudit_version_id": "string" } ], "next_page_token": "string", "page_size": 0, "total": 0 }, "code": 0, "msg": "string" } ``` -------------------------------- ### GET Request Example for Application Availability Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/app/get-visibility This example shows the structure of a GET request to retrieve the application availability scope within an enterprise. It includes common query parameters. ```http [GET] https://openapi.wps.cn/v7/developer/applications/current/subjects?page_size={integer}&page_token={string}&with_total={boolean}&type={string_1}&type={string_2} ``` -------------------------------- ### GET Request URL Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/partners/get-partners This example shows the base URL for making a GET request to retrieve the list of associated organizations. ```http [GET] https://openapi.wps.cn/v7/partners ``` -------------------------------- ### GET Request Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/range/get-range Example of a GET request to retrieve the contacts permission scope. Ensure to replace placeholders with actual values. ```http [GET] https://openapi.wps.cn/v7/contacts/permissions_scope?scopes={string_1}&scopes={string_2} ``` -------------------------------- ### Get Drive List API Request Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/yundoc/drive/get-drive-list This example demonstrates how to call the Get Drive List API. It shows the request URL, HTTP method, and a sample JSON response body. ```json { "data": { "items": [ { "allotee_id": "string", "allotee_type": "user", "company_id": "string", "created_by": { "avatar": "string", "company_id": "string", "id": "string", "name": "string", "type": "user" }, "ctime": 0, "description": "string", "ext_attrs": [ { "name": "string", "value": "string" } ], "id": "string", "mtime": 0, "name": "string", "quota": { "deleted": 0, "remaining": 0, "total": 0, "used": 0 }, "source": "string", "status": "inuse" } ], "next_page_token": "string" }, "code": 0, "msg": "string" } ``` -------------------------------- ### GET Request URL Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/im/message/get-chat-message This example demonstrates how to construct a GET request to retrieve chat message history, including optional query parameters for time range, pagination, and page size. ```http [GET] https://openapi.wps.cn/v7/chats/{chat_id}/messages?start_time=11235666&end_time=145643222&page_token=string&page_size=10 ``` -------------------------------- ### Get Department List Response Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/partners/get-partners-dept-list This example shows the structure of a successful response when retrieving a list of departments. It includes department details and a token for the next page if available. ```json { "data": { "depts": [ { "company_id": "string", "dept_id": "string", "dept_name": "string" } ], "next_page_token": "string" }, "msg": "string", "code": 0 } ``` -------------------------------- ### Java Example for Receiving and Verifying Events Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/event-subscription/security-verification Demonstrates how to simulate receiving an event, verify its signature using the KsoEventUtil, and then decrypt the event data. This is a practical example for integrating with event-driven systems. ```java @Data public class Event { private String topic; private String operation; private Integer time; private String nonce; private String signature; private String encrypted_data; } // public class Main { private static final String ACCESS_KEY = "xxx"; private static final String SECRET_KEY = "xxx"; public static void main(String[] args) { // 模拟接收数据 Event event = new Event(); event.setTopic("kso.test"); event.setOperation("update"); event.setTime(1704074400); event.setNonce("aae******3bb2a6"); event.setSignature("zbwP0rFm7T******CMbNQIHuX-UU"); event.setEncryptedData("79Nsnsdq******fK2lZZFMQ=="); // (1) 验证签名 String content = String.format("%s:%s:%s:%d:%s", ACCESS_KEY, event.getTopic(), event.getNonce(), event.getTime(), event.getEncryptedData()); String signature = ""; try { signature = KsoEventUtil.getSignature(content, SECRET_KEY); } catch (Exception e) { throw new RuntimeException(e); } if (!event.getSignature().equals(signature)) { throw new RuntimeException("signature check failed"); } // (2) 解密数据 String eventData = ""; try { String cipher = KsoEventUtil.md5(SECRET_KEY); eventData = KsoEventUtil.decrypt(event.getEncryptedData(), cipher, event.getNonce()); } catch (Exception e) { throw new RuntimeException(e); } // TODO 处理业务逻辑 System.out.Println(eventData); } } ``` -------------------------------- ### Get Department List Request URL Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/partners/get-partners-dept-list This is an example of the GET request URL to retrieve a list of departments within an associated organization. Replace placeholders with actual IDs. ```http [GET] https://openapi.wps.cn/v7/partners/{partner_id}/depts/{dept_id}/children ``` -------------------------------- ### Batch Get Sessions Request Body Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/im/chat/batch-get-chat An example of the JSON payload to send when requesting multiple sessions. You can specify either `chat_id_list` or `dept_id_list`, or both. ```json { "chat_id_list": ["string"], "dept_id_list": ["string"], "with_ext_attrs": false, "with_group_ext_attrs": false } ``` -------------------------------- ### Response Body Example for Application Availability Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/app/get-visibility This example illustrates the expected JSON response when querying for application availability. It includes details about the application items, total count, and pagination. ```json { "data": { "items": [ { "id": "string", "name": "string", "type": "string[enum]" } ] }, "total": 0, "next_page_token": "string", "msg": "string", "code": 0 } ``` -------------------------------- ### Create User Request Body Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/user/create-user This example demonstrates the structure and fields required for the request body when creating a new user. All fields are optional except for 'user_name' and 'dept_ids'. ```JSON { "city": "string", "country": "string", "dept_ids": ["string"], "email": "string", "employee_id": "string", "employer": "string", "employment_status": "string", "employment_type": "string", "gender": "string[enum]", "leader_id": "string", "phone": "string", "telephone": "string", "title": "string", "user_name": "string", "work_place": "string", "def_dept_id":"string", "ex_user_id": "string" } ``` -------------------------------- ### Get All User API Response Body Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/user/get-all-user This JSON object represents a successful response from the Get All User API, detailing user information, pagination tokens, and status messages. ```json { "data": { "items": [ { "city": "string", "country": "string", "ctime": 0, "depts": [ { "abs_path": "string", "id": "string", "name": "string" } ], "email": "string", "employee_id": "string", "employer": "string", "employment_status": "string", "employment_type": "string", "ex_user_id": "string", "gender": "string[enum]", "id": "string", "leader_id": "string", "phone": "string", "role": "string[enum]", "status": "string[enum]", "telephone": "string", "title": "string", "user_name": "string", "work_place": "string", "def_dept_id": "string" } ], "next_page_token": "string", "total": 0 }, "msg": "string", "code": 0 } ``` -------------------------------- ### Response Body Example for User List Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/partners/get-partners-dept-user-list This example demonstrates the structure of a successful response when retrieving a list of users from a specific department. It includes user details and a token for pagination. ```json { "data": { "users": [ { "company_id": "string", "user_id": "string", "user_name": "string", "user_avatar": "string" } ], "next_page_token": "string" }, "msg": "string", "code": 0 } ``` -------------------------------- ### Get Available Applications for User API Response Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/app/app-management/get-visible-apps This JSON structure represents the response when retrieving a list of applications available for a user or within an enterprise scope. It includes application details, pagination information, and status codes. ```json { "data": { "items": [ { "description": "string", "id": "string", "logo": "string", "name": "string", "status": "enable", "type": "isv" } ], "next_page_token": "string", "total": 0 }, "code": 0, "msg": "string" } ``` -------------------------------- ### Request Body Example for Callback Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/callback-subscription/receive-callback This is an example of the JSON structure for the request body when a callback is received. Ensure the 'callback_name', 'app_id', and 'data' fields are correctly populated. ```json { "callback_name": "string", "app_id": "string", "data": { // Callback Data, which varies callback_name Different It differs } } ``` -------------------------------- ### Response Body Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/yundoc/drive/get-drive This is an example of the JSON response body when successfully retrieving drive disk information. It includes details about storage allocation, file counts, and metadata. ```JSON { "data": { "allotee_id": "string", "allotee_type": "user", "company_id": "string", "created_by": { "avatar": "string", "company_id": "string", "id": "string", "name": "string", "type": "user" }, "ctime": 0, "description": "string", "ext_attrs": [ { "name": "string", "value": "string" } ], "id": "string", "mtime": 0, "name": "string", "quota": { "deleted": 0, "remaining": 0, "total": 0, "used": 0 }, "source": "string", "status": "inuse" }, "code": 0, "msg": "string" } ``` -------------------------------- ### Instant File Transfer Response Body Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/yundoc/file-transfer/rapid-upload This example shows the structure of a successful response when an instant file transfer is initiated. It includes details about the created file and its properties. ```json { "data": { "created_by": { "avatar": "string", "company_id": "string", "id": "string", "name": "string", "type": "user" }, "ctime": 0, "drive": { "allotee_id": "string", "allotee_type": "user", "company_id": "string", "created_by": { "avatar": "string", "company_id": "string", "id": "string", "name": "string", "type": "user" }, "ctime": 0, "description": "string", "ext_attrs": [ { "name": "string", "value": "string" } ], "id": "string", "mtime": 0, "name": "string", "quota": { "deleted": 0, "remaining": 0, "total": 0, "used": 0 }, "source": "string", "status": "inuse" }, "drive_id": "string", "ext_attrs": [ { "name": "string", "value": "string" } ], "id": "string", "link_id": "string", "link_url": "string", "modified_by": { "avatar": "string", "company_id": "string", "id": "string", "name": "string", "type": "user" }, "mtime": 0, "name": "string", "parent_id": "string", "permission": { "comment": true, "copy": true, "copy_content": true, "delete": true, "download": true, "history": true, "list": true, "move": true, "new_empty": true, "perm_ctl": true, "preview": true, "print": true, "rename": true, "saveas": true, "secret": true, "share": true, "update": true, "upload": true }, "shared": true, "size": 0, "type": "folder", "version": 0 }, "code": 0, "msg": "string" } ``` -------------------------------- ### Response Body Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/partners/get-partners This example illustrates the structure of the JSON response when successfully retrieving the list of associated organizations. It includes details about the organizations and a token for pagination. ```json { "data": { "partners": [ { "company_id": "string", "company_logo": "string", "company_name": "string", "id": "string", "company_status": "string" } ], "next_page_token": "string" }, "msg": "string", "code": 0 } ``` -------------------------------- ### Get Enterprise Installed Application List Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/app/app-management/list-installed-apps Obtain the list of applications installed within an enterprise. This API supports filtering by application review status, including pending review, reviewed, rejected, withdrawn, and exempt applications. ```APIDOC ## GET /v7/developer/apps ### Description Get the application list. You can filter by application review status, supporting queries for pending review, reviewed, rejected, withdrawn, and exempt applications. ### Method GET ### Endpoint https://openapi.wps.cn/v7/developer/apps ### Parameters #### Query Parameters - **page_token** (string) - Optional - Page Start token - **page_size** (integer) - Optional - List Page Size - **lang** (string) - Optional - Preferred Language, specifying the information of the application in this language. Optional Value: `zh-CN`, `en-US`, `ja-JP`, `zh-HK`, `th-TH`. Default Value: `zh-CN`. - **status** (string) - Optional - Application Status. Optional Value: `enable`, `disable`, `deleted`. - **type** (string) - Required - Application Type, Currently only self-built enterprise applications are supported on the private network. Optional Value: `isv`, `company_internal`, `official`. - **approval_status** (string) - Optional - Review Status. Optional Value: `reviewing`, `approved`, `rejected`, `withdrawn`, `auto_approved`. ### Response #### Success Response (200) - **data** (object) - - **code** (integer) - - **msg** (string) - Human-readable text information that may return different text information depending on the language or region. #### Response Example ```json { "data": { "items": [ { "callback_urls": [ "string" ], "description": "string", "i18n": [ { "description": "string", "lang_code": "string", "name": "string" } ], "id": "string", "logo": "string", "name": "string", "online_version_id": "string", "owner": { "owner_id": "string" }, "scopes": [ { "auth_types": [ "string" ], "description": "string", "name": "string" } ], "status": "enable", "type": "isv", "unaudit_version_id": "string" } ], "next_page_token": "string", "page_size": 0, "total": 0 }, "code": 0, "msg": "string" } ``` ``` -------------------------------- ### Instant File Transfer Request Body Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/yundoc/file-transfer/rapid-upload This is an example of the JSON payload required to initiate an instant file transfer. Ensure all required fields like 'size' and 'hashes' are correctly populated. ```json { "display_size": 0, "file_id": "string", "hashes": [ { "sum": "string", "type": "sha256" } ], "name": "string", "on_name_conflict": "fail", "parent_path": [ "string" ], "proof": { "code": "string", "token": "string" }, "size": 0 } ``` -------------------------------- ### Root Department Response Body Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/dept/get-root-dept This is an example of the JSON response when successfully retrieving root department information. It includes details like department ID, name, path, and creation time. ```JSON { "data": { "abs_path": "string", "ctime": 0, "ex_dept_id": "string", "id": "string", "leaders": [ { "order": 0, "user_id": "string" } ], "name": "string", "order": 0, "parent_id": "string" }, "msg": "string", "code": 0 } ``` -------------------------------- ### User Logout Request Body Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/certification-authorization/session-management/user-logout Provides an example of the JSON payload for the batch logout API, specifying the user IDs to be logged out. ```json { "user_ids": [ "string" ] } ``` -------------------------------- ### Response Body Example for Callback Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/callback-subscription/receive-callback This is an example of the JSON structure for the response body after processing a callback. A 'code' of 0 indicates success, while non-zero values indicate failure. ```json { "msg": "string", "code": 0 } ``` -------------------------------- ### Response Body Example for Custom User Attributes Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/custom_attr/get-attr This example demonstrates the structure of the response body when fetching custom user attributes. It includes the attribute ID, name, value type, and total count. ```json { "data": { "custom_attrs": [ { "id": "string", "name": "string", "value_type": "string[enum]" } ], "total": 0 }, "msg": "string", "code": 0 } ``` -------------------------------- ### Response Body Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/range/get-range Example JSON response structure for the contacts permission scope query. This shows the format of returned data, including department IDs, permission types, scopes, and user IDs. ```json { "code": 0, "data": { "items": [ { "dept_ids": ["string"], "permission_type": "string[enum]", "scope": "string[enum]", "user_ids": ["string"] } ] }, "msg": "string" } ``` -------------------------------- ### Response Body Example for Current User ID Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/user/get-current-user-id This is an example of the JSON response body when successfully retrieving the current user's ID and company ID. The 'data' object contains 'company_id' and 'user_id'. ```JSON { "data": { "company_id": "string", "user_id": "string" }, "msg": "string", "code": 0 } ``` -------------------------------- ### Go Example for Receiving and Verifying Events Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/event-subscription/security-verification Demonstrates how to receive, verify signatures, and decrypt event data using a Gin web server. Ensure the `accessKey`, `secretKey`, and decryption functions are correctly configured. ```Go package main import ( "encoding/json" "github.com/gin-gonic/gin" "net/http" "strconv" ) const ( accessKey = "xxx" secretKey = "xxx" ) // Event 收到的消息体 type Event struct { Topic string `json:"topic"` Operation string `json:"operation"` Time int64 `json:"time"` Nonce string `json:"nonce"` Signature string `json:"signature"` EncryptedData string `json:"encrypted_data"` } // EventData 解密后的消息体 type EventData struct { AppId string `json:"app_id"` AppTicket string `json:"app_ticket"` } func main() { router := gin.Default() router.POST("/open/receive", func(c *gin.Context) { event := &Event{} if err := c.ShouldBindJSON(event); err != nil { c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) return } // (1) 验证签名 content := fmt.Sprintf("%s:%s:%s:%d:%s", accessKey, event.Topic, event.Nonce, event.Time, event.EncryptedData) signature := HmacSha256(content, secretKey) if signature != event.Signature { c.JSON(http.StatusBadRequest, gin.H{"error": "signature check failed"}) return } // (2) 解密数据 cipher := Md5(secretKey) decryptedData, err := Decrypt(event.EncryptedData, cipher, event.Nonce) if err != nil { c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) return } data := &EventData{} err = json.Unmarshal([]byte(decryptedData), data) if err != nil { c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) return } // TODO 处理业务逻辑 // service.DoSomething(data) c.JSON(http.StatusBadRequest, gin.H{"code": 0}) }) _ = router.Run() } ``` -------------------------------- ### Batch Get Chat Response Body Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/im/chat/batch-get-chat This JSON structure represents the successful response when retrieving multiple chat group details. ```json { "code": 0, "data": { "items": [ { "ctime": 0, "ext_attrs": [ { "name": "string", "value": "string" } ], "group_ext_attrs": { "avatar": { "avatars": ["string"], "type": "default" }, "dept_id": "string", "owner_id": "string", "settings": { "is_disable_all_send": false, "is_disable_part_send": false, "is_enable_nickname": true, "is_external_join_approve": true, "is_join_approve": false, "is_owner_admin_at_all": false, "is_owner_admin_modify": false } }, "id": "string", "name": "string", "status": "active", "type": "group" } ] }, "msg": "success" } ``` -------------------------------- ### Get Historical Messages Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/im/message/get-chat-message Fetches chat history for a given session. Supports filtering by start and end times, and pagination using page_token and page_size. ```APIDOC ## GET /v7/chats/{chat_id}/messages ### Description Retrieves historical messages within a specified session (including single chat and group chat). For group chats, the bot must be in the queried group. ### Method GET ### Endpoint /v7/chats/{chat_id}/messages ### Parameters #### Path Parameters - **chat_id** (string) - Yes - Chats id #### Query Parameters - **start_time** (int) - No - Start Time Of Query History Message (Second-Level Timestamp) - **end_time** (int) - No - End Time Of Query History Message (Second-Level Timestamp) - **page_token** (string) - No - Pagination token - **page_size** (int) - No - Page Size ### Request Example ``` GET https://openapi.wps.cn/v7/chats/{chat_id}/messages?start_time=11235666&end_time=145643222&page_token=string&page_size=10 ``` ### Response #### Success Response (200) - **code** (integer) - Response Code. Non- 0 Indicating Failure, Refer To "Status Code Description" - **msg** (string) - Response Message - **data** (object) - Data Information - **next_page_token** (string) - Pagination Token - **items** (array) - Message Data - **id** (string) - Messages id - **type** (string) - Message Type: `text`: Text; `rich_text`: Rich Text; `image`: Image; `file`: File; `audio`: Audio; `video`: Video; `card`: Card Message - **ctime** (int) - Message Timestamp - **quote_msg_id** (string) - Quoted MessageID - **position** (int) - Session Message Index, Strictly Consecutive Increment - **content** (object) - Message content, according to message type `type` Return Different Message Content, See: Message Content (content Description of Structure - **sender** (object) - Sender - **type** (string) - Sender Type: user-User, sp-Application Service Entity - **id** (string) - Sender's ID. When the sender type is user, return user_id. When the sender type is sp, return spid (With App appid Not the Same - **app_id** (string) - Apply id, Only in type as sp With Value - **company_id** (string) - Sender's Company - **mentions** (array) - Messages @People List - **type** (string) - at Audience Type: `all`: Everyone; `user`: User - **id** (string) - Specify Chat Message In at Entity Index for Operations ID With the corresponding tags in the message body {index} Value Match - **identity** (object) - By at User Information, When at The value is empty for everyone. - **company_id** (string) - By at User's Affiliated Enterprise id - **id** (string) - By at User id - **type** (string) - By at User Type: user-User, sp-Application Service Entity ``` -------------------------------- ### Example Response Body for Get Specified Message Content Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/im/message/get-message This JSON object demonstrates a successful response when retrieving the content of a specified message. It includes message details like ID, type, content, sender, and timestamps. ```json { "code": 0, "data": { "chat_id": "8417257", "content": { "text": { "content": "hel", "type": "plain" } }, "ctime": 1744703111850, "id": "Q3iOi5TYS6tBSgS1", "mentions": [ { "id": "string", "identity": { "company_id": "string", "id": "string", "type":"string" }, "type": "string" } ], "position": 22, "sender": { "app_id": "", "company_id": "648112656", "id": "100002594211", "type": "user" }, "type": "text" }, "msg": "success" } ``` -------------------------------- ### Get Application Members List Response Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/app/app-info/app-member-list This JSON structure represents the successful response when retrieving the list of members for a WPS 365 application. It includes an array of member objects, each with details like company ID, name, partner ID, role, and user ID. ```json { "data": { "items": [ { "company_id": "string", "name": "string", "partner_id": "string", "role": "owner", "user_id": "string" } ] }, "code": 0, "msg": "string" } ``` -------------------------------- ### Batch Get Sessions Request URL Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/im/chat/batch-get-chat The POST request URL for the Batch Get Sessions API. ```http [POST] https://openapi.wps.cn/v7/chats/batch_get ``` -------------------------------- ### Create Department Response Body Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/dept/create-dept Example JSON response body after successfully creating a department, showing details like department ID, name, and creation time. ```JSON { "data": { "abs_path": "string", "ctime": 0, "ex_dept_id": "string", "dept_id": "string", "leaders": [ { "order": 0, "user_id": "string" } ], "name": "string", "order": 0, "parent_id": "string" }, "msg": "string", "code": 0 } ``` -------------------------------- ### GET Request for User Information Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/certification-authorization/user-authorization/user-info This snippet shows the GET request URL to retrieve the current user's information. Ensure you have the necessary permissions. ```http [GET] https://openapi.wps.cn/v7/users/current ``` -------------------------------- ### Get App Version List Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/app/app-info/app-version-list Fetches a list of all available application versions. This includes details about each app's version, its description, and the capabilities it supports. It also outlines any new permission requests associated with a specific version. ```APIDOC ## GET /app-version-list ### Description Retrieves a list of application versions with their details, including capabilities and permissions. ### Method GET ### Endpoint /app-version-list ### Response #### Success Response (200) - **data** (object) - The main data object containing the list of app versions. - **data.items** (array[object]) - A list of application version objects. - **data.items.items.ability** (array[object]) - Capabilities enabled by the specified version. - **data.items.items.ability.items.abi_type** (string) - Capability Type. Possible values: `im_workbench_block`, `im_robot`, `im_mini_app`, `dbsheet_view`, `im_homepage`, `dbsheet_dashboard`, `dbsheet_automatic`, `dbsheet_data_conn`, `dbsheet_field`, `dbsheet_record_card`, `wo_weboffice`, `open_web_component`, `opendocs_chart_collect`. - **data.items.items.ability.items.configs** (array[object]) - Capability Configuration. - **data.items.items.ability.items.configs.items.key** (string) - Configuration Item Key. - **data.items.items.ability.items.configs.items.value** (string) - Configuration Item Value. - **data.items.items.ability.items.name** (string) - Capability Name. - **data.items.items.app_desc** (string) - App Description. - **data.items.items.app_id** (string) - App ID. - **data.items.items.app_name** (string) - App name. - **data.items.items.applicant_id** (string) - Requested by user ID. - **data.items.items.apply_desc** (string) - Application Description. - **data.items.items.apply_permissions** (array[object]) - New application requests for specified version permissions. - **data.items.items.apply_permissions.items.display_name** (string) - Permission Display Name, such as 'View and Manage Files'. - **data.items.items.apply_permissions.items.name** (string) - Permission Name, such as 'kso.file.read'. - **data.items.items.apply_permissions.items.permission_type** (array[string]) - Application Permission Type. Possible values: `delegated`, `app_role`. - **data.items.items.desc** (string) - Version notes. - **data.items.items.i18n** (array[object]) - App Internationalization Information. - **data.items.items.i18n.items.description** (string) - App Description. - **data.items.items.i18n.items.lang_code** (string) - Language Type. - **data.items.items.i18n.items.name** (string) - App name. #### Response Example ```json { "data": { "items": [ { "ability": [ { "abi_type": "im_mini_app", "configs": [ { "key": "test_key", "value": "test_value" } ], "name": "Mini App" } ], "app_desc": "This is a test app.", "app_id": "com.example.testapp", "app_name": "Test App", "applicant_id": "user123", "apply_desc": "Requesting access to test app.", "apply_permissions": [ { "display_name": "View Files", "name": "kso.file.read", "permission_type": ["delegated"] } ], "desc": "Initial release version.", "i18n": [ { "description": "Descripción de la aplicación de prueba.", "lang_code": "es", "name": "Aplicación de Prueba" } ] } ] } } ``` ``` -------------------------------- ### GET Request for Company Information Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/company/get-company-info This snippet shows the GET request to retrieve current enterprise information. Ensure you have the necessary 'kso.contact.read' or 'kso.contact.readwrite' permission. ```http [GET] https://openapi.wps.cn/v7/companies/current ``` -------------------------------- ### Response Body Example for Company Information Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/company/get-company-info This example illustrates the structure of the response body when successfully querying enterprise information. It includes details like enterprise ID, name, creation time, logo, and status. ```json { "data": { "ctime": 0, "id": "string", "logo": "string", "name": "string", "status": "string[enum]" }, "msg": "string", "code": 0 } ``` -------------------------------- ### File Upload Complete Request Body Example Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/yundoc/file-transfer/complete-upload-file This is an example of the JSON request body required to complete a file upload. It includes the upload identifier. ```json { "upload_id": "string" } ``` -------------------------------- ### User Change Event Body Example (Before Decryption) Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/event/user-change This example shows the structure of the user change event data before decryption. It includes the topic, operation type, timestamp, nonce for decryption, signature, and the encrypted data payload. ```json { "topic": "kso.user", "operation": "update", "time": 1704074400, "nonce": "71***********7", "signature": "w6**********6Q", "encrypted_data": "B7**********iA==" } ``` -------------------------------- ### GET Request for Root Department Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/dept/get-root-dept This snippet shows the GET request to retrieve the root department. Ensure you have the necessary app authorization for contact read/write or read permissions. ```HTTP [GET] https://openapi.wps.cn/v7/depts/root ``` -------------------------------- ### GET Request for Custom User Attributes Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/address-book/custom_attr/get-attr This snippet shows the GET request URL to retrieve a list of custom user attributes. Ensure you have the necessary 'kso.user_custom_attr.readwrite' permission. ```http [GET] https://openapi.wps.cn/v7/companies/user_custom_attrs/batch_read ``` -------------------------------- ### Get Drive List Source: https://365.kdocs.cn/3rd/open/documents/app-integration-dev/wps365/server/yundoc/drive/get-drive-list Retrieves a list of drives based on specified criteria. This API can be used to get personal private disks, disks under user groups, or application disks. ```APIDOC ## GET https://openapi.wps.cn/v7/drives ### Description Retrieves a list of drives. This endpoint allows fetching personal private disks, disks under user groups, or application disks. ### Method GET ### Endpoint https://openapi.wps.cn/v7/drives ### Parameters #### Query Parameters - **allotee_type** (string) - Required - Disk Ownership Identity Type. Possible values: `user`, `group`, `app`. - **allotee_id** (string) - Optional - Disk Ownership Identity ID. Depends on `allotee_type`. - **with_ext_attrs** (boolean) - Optional - Whether to get disk extended attributes. - **page_size** (integer) - Required - Page Size. Maximum is 500 for public network. - **page_token** (string) - Optional - Pagination token. - **sources** (array) - Optional - Disk source. For `allotee_type` as `user`, can be multi-selected. Possible values: `special`, `tmp`, `secret`, `feature` (Public Network); `private`, `roaming` (Private Network). ### Response #### Success Response (200) - **data** (object) - File Storage Medium. - **items** (array) - List of drives. - **allotee_id** (string) - Allotee ID. - **allotee_type** (string) - Allotee type. - **company_id** (string) - Company ID. - **created_by** (object) - Information about the creator. - **ctime** (integer) - Creation time. - **description** (string) - Description of the drive. - **ext_attrs** (array) - Extended attributes of the drive. - **id** (string) - Drive ID. - **mtime** (integer) - Modification time. - **name** (string) - Drive name. - **quota** (object) - Disk quota information. - **source** (string) - Disk source. - **status** (string) - Drive status. - **next_page_token** (string) - Token for the next page of results. - **code** (integer) - Response code. - **msg** (string) - Human-readable message. #### Response Example ```json { "data": { "items": [ { "allotee_id": "string", "allotee_type": "user", "company_id": "string", "created_by": { "avatar": "string", "company_id": "string", "id": "string", "name": "string", "type": "user" }, "ctime": 0, "description": "string", "ext_attrs": [ { "name": "string", "value": "string" } ], "id": "string", "mtime": 0, "name": "string", "quota": { "deleted": 0, "remaining": 0, "total": 0, "used": 0 }, "source": "string", "status": "inuse" } ], "next_page_token": "string" }, "code": 0, "msg": "string" } ``` ```