### Workwx Access Token and Ticket APIs Source: https://github.com/xen0n/go-workwx/blob/v2/docs/apis.md Provides API endpoints for obtaining access tokens, JSAPI tickets, and user information. Includes methods for getting access tokens, JSAPI tickets for applications, and converting temporary login credentials to session information. ```APIDOC execGetAccessToken: URL: GET /cgi-bin/gettoken Description: Retrieves an access token. Requires Access Token: No Response Type: respAccessToken execGetJSAPITicket: URL: GET /cgi-bin/get_jsapi_ticket Description: Retrieves a JSAPI ticket for the enterprise. Requires Access Token: Yes Response Type: respJSAPITicket execGetJSAPITicketAgentConfig: URL: GET /cgi-bin/ticket/get Description: Retrieves a JSAPI ticket for an application. Requires Access Token: Yes Response Type: respJSAPITicket execJSCode2Session: URL: GET /cgi-bin/miniprogram/jscode2session Description: Validates temporary login credentials (code) and obtains session information. Requires Access Token: Yes Response Type: respJSCode2Session execAuthCode2UserInfo: URL: GET /cgi-bin/auth/getuserinfo Description: Retrieves user information based on authorization code. Requires Access Token: Yes Response Type: respAuthCode2UserInfo ``` -------------------------------- ### Workwx Media Management API Calls Source: https://github.com/xen0n/go-workwx/blob/v2/docs/apis.md Covers API endpoints for managing media assets in Workwx, including uploading temporary media, uploading images, and retrieving media content. These operations use POST or GET requests and may have specific URL parameters. ```APIDOC execMediaUpload: Request Type: reqMediaUpload Response Type: respMediaUpload Access Token: + URL: POST(media) /cgi-bin/media/upload Doc: 上传临时素材 execMediaUploadImg: Request Type: reqMediaUploadImg Response Type: respMediaUploadImg Access Token: + URL: POST(media) /cgi-bin/media/uploadimg Doc: 上传永久图片 execMediaGet: Request Type: TODO Response Type: TODO Access Token: + URL: GET /cgi-bin/media/get Doc: 获取临时素材 execMediaGetJSSDK: Request Type: TODO Response Type: TODO Access Token: + URL: GET /cgi-bin/media/get/jssdk Doc: 获取高清语音素材 ``` -------------------------------- ### Workwx Chat Management API Calls Source: https://github.com/xen0n/go-workwx/blob/v2/docs/apis.md Provides API endpoints for creating, updating, and retrieving chat sessions within Workwx. These calls typically involve POST or GET requests to specific URLs and require an access token. ```APIDOC execAppchatCreate: Request Type: reqAppchatCreate Response Type: respAppchatCreate Access Token: + URL: POST /cgi-bin/appchat/create Doc: 创建群聊会话 execAppchatUpdate: Request Type: reqAppchatUpdate Response Type: respAppchatUpdate Access Token: + URL: POST /cgi-bin/appchat/update Doc: 修改群聊会话 execAppchatGet: Request Type: reqAppchatGet Response Type: respAppchatGet Access Token: + URL: GET /cgi-bin/appchat/get Doc: 获取群聊会话 ``` -------------------------------- ### OAContentVacationAttendanceSliceInfoDayItem Structure Source: https://github.com/xen0n/go-workwx/blob/v2/docs/oa.md Defines the structure for day-specific slice information within the attendance component, including the timestamp for the start of the day and the duration for that day. ```go type OAContentVacationAttendanceSliceInfoDayItem struct { Daytime uint64 `json:"daytime"` // 日期的00:00:00时间戳,Unix时间 Duration uint64 `json:"duration"` // 分隔当前日期的时长秒数 } ``` -------------------------------- ### Application Management API Calls Source: https://github.com/xen0n/go-workwx/blob/v2/docs/apis.md APIs for managing applications, including fetching application details, listing applications, and setting application configurations. ```APIDOC execAgentGet: Request Type: TODO Response Type: TODO Access Token: + URL: GET /cgi-bin/agent/get Doc: 获取指定的应用详情 execAgentList: Request Type: TODO Response Type: TODO Access Token: + URL: GET /cgi-bin/agent/list Doc: 获取access_token对应的应用列表 execAgentSet: Request Type: TODO Response Type: TODO Access Token: + URL: POST /cgi-bin/agent/set Doc: 设置应用 ``` -------------------------------- ### OAContentDateRange Structure Source: https://github.com/xen0n/go-workwx/blob/v2/docs/oa.md Defines the structure for date range content, specifying the time display type, start and end times, duration, and timezone information. ```go type OAContentDateRange struct { Type string `json:"type"` // 时间展示类型:halfday-日期;hour-日期+时间 NewBegin int `json:"new_begin"` // 开始时间,unix时间戳 NewEnd int `json:"new_end"` // 结束时间,unix时间戳 NewDuration int `json:"new_duration"` // 时长范围,单位秒 PerdayDuration int `json:"perday_duration"` // 每天的工作时长 TimezoneInfo *OAContentDateRangeTimezoneInfo `json:"timezone_info"` // 时区信息,只有在非UTC+8的情况下会返回 } ``` -------------------------------- ### Import Work Weixin SDK Source: https://github.com/xen0n/go-workwx/blob/v2/README.md Demonstrates how to import the go-workwx v2 package for use in a Golang project. ```go import ( "github.com/xen0n/go-workwx/v2" // package workwx ) ``` -------------------------------- ### Application Management API Documentation Source: https://github.com/xen0n/go-workwx/blob/v2/README.md Details the API endpoints for managing applications, including custom menus. ```APIDOC Application Management API: Get Application: Retrieves information about an application. Set Application: Configures application settings. Custom Menu: - Create Menu: Creates a custom menu for the application. - Get Menu: Retrieves the existing custom menu. - Delete Menu: Deletes the custom menu. ``` -------------------------------- ### WeChat Customer Service Session Management API Calls Source: https://github.com/xen0n/go-workwx/blob/v2/docs/apis.md APIs for managing WeChat customer service sessions, including getting session status, changing session status, syncing messages, and sending messages. ```APIDOC execKfServiceStateGet: Request Type: reqKfServiceStateGet Response Type: respKfServiceStateGet Access Token: + URL: POST /cgi-bin/kf/service_state/get Doc: 获取会话状态 execKfServiceStateTrans: Request Type: reqKfServiceStateTrans Response Type: respKfServiceStateTrans Access Token: + URL: POST /cgi-bin/kf/service_state/trans Doc: 变更会话状态 execKfSyncMsg: Request Type: reqKfSyncMsg Response Type: respKfSyncMsg Access Token: + URL: POST /cgi-bin/kf/sync_msg Doc: 读取消息 execKfSend: Request Type: reqMessage Response Type: respMessageSend Access Token: + URL: POST /cgi-bin/kf/send_msg Doc: 发送消息 execKfOnEventSend: Request Type: reqMessage Response Type: respMessageSend Access Token: + URL: POST /cgi-bin/kf/send_msg_on_event Doc: 发送欢迎语等事件响应消息 ``` -------------------------------- ### Material Management API Documentation Source: https://github.com/xen0n/go-workwx/blob/v2/README.md Details the API endpoints for managing materials, including uploading temporary and permanent media. ```APIDOC Material Management API: Upload Temporary Material: Uploads temporary media files. Upload Permanent Image: Uploads permanent image materials. Get Temporary Material: Retrieves temporary media files. Get High-Quality Voice Material: Retrieves high-quality voice materials. ``` -------------------------------- ### OA API Documentation Source: https://github.com/xen0n/go-workwx/blob/v2/README.md Provides details on the OA (Office Automation) API, including approval processes and callbacks. ```APIDOC OA API: Approval: - Get Approval Template Details: Retrieves details of an approval template. - Submit Approval Application: Submits an approval request. - Approval Application Status Change Callback: Receives notifications for changes in approval application status. - Batch Get Approval Ticket Numbers: Retrieves approval ticket numbers in batches. - Get Approval Application Details: Retrieves details of an approval application. - Get Enterprise Leave Management Configuration: Retrieves the enterprise's leave management configuration. - Modify Member Leave Balance: Modifies a member's leave balance. ``` -------------------------------- ### MediaUploadResult API Documentation Source: https://github.com/xen0n/go-workwx/blob/v2/docs/media_upload.md API documentation for the `MediaUploadResult` model, detailing its fields, types, and descriptions. ```APIDOC MediaUploadResult: Type: object description: 临时素材上传结果 properties: Type: type: string description: 媒体文件类型,分别有图片(image)、语音(voice)、视频(video),普通文件(file) MediaID: type: string description: 媒体文件上传后获取的唯一标识,3天内有效 CreatedAt: type: time.Time description: 媒体文件上传时间戳 ``` -------------------------------- ### Workwx API Endpoints Source: https://github.com/xen0n/go-workwx/blob/v2/docs/foo.md Documentation for key API endpoints in the Workwx API, including user retrieval and access token acquisition. Specifies request/response types, token requirements, and HTTP methods/URLs. ```APIDOC API Endpoints: 1. execUserGet: - Request Type: reqUserGet - Response Type: respUserGet - Access Token Required: Yes - URL: GET /cgi-bin/user/get 2. getAccessToken: - Request Type: reqAccessToken - Response Type: respAccessToken - Access Token Required: No - URL: GET /cgi-bin/accesstoken ``` -------------------------------- ### Application Management - Custom Menu API Calls Source: https://github.com/xen0n/go-workwx/blob/v2/docs/apis.md APIs for managing custom menus within applications, including creating, retrieving, and deleting menus. ```APIDOC execMenuCreate: Request Type: TODO Response Type: TODO Access Token: + URL: POST /cgi-bin/menu/create Doc: 创建菜单 execMenuGet: Request Type: TODO Response Type: TODO Access Token: + URL: GET /cgi-bin/menu/get Doc: 获取菜单 execMenuDelete: Request Type: TODO Response Type: TODO Access Token: + URL: GET /cgi-bin/menu/delete Doc: 删除菜单 ``` -------------------------------- ### Customer Contact API Documentation Source: https://github.com/xen0n/go-workwx/blob/v2/README.md Details the API endpoints for managing customer contacts, including customer and group management, and contact inheritance. ```APIDOC Customer Contact API: Member External Information: - Get Member External Info: Retrieves external information for a member. Enterprise Service Personnel Management: - List Configured Members: Retrieves a list of members configured for customer contact. - Customer Contact "Contact Me" Management: Manages "Contact Me" links for customer contacts. - Customer Group "Join Group" Management: Manages "Join Group" functionality for customer groups. Customer Management: - Get Customer List: Retrieves a list of customers. - Get Customer Details: Retrieves detailed information for a specific customer. - Batch Get Customer Details: Retrieves detailed information for multiple customers. - Edit Customer Remark: Modifies the remark information for a customer. Customer Group Management: - Get Customer Group List: Retrieves a list of customer groups. - Get Customer Group Details: Retrieves detailed information for a customer group. - Customer Group OpenID Conversion: Converts customer group OpenIDs. On-Duty Inheritance: - Assign Customer to On-Duty Member: Assigns customers of a departed member to an on-duty member. - Query Customer Takeover Status: Queries the takeover status of customers. - Assign Customer Group to On-Duty Member: Assigns customer groups of a departed member to an on-duty member. Off-Duty Inheritance: - List Departed Members for Assignment: Retrieves a list of departed members available for customer assignment. - Assign Customer to Off-Duty Member: Assigns customers of a departed member to another member. - Query Customer Takeover Status: Queries the takeover status of customers. - Assign Customer Group to Off-Duty Member: Assigns customer groups of a departed member to another member. Customer Tag Management: - Manage Enterprise Tags: Manages enterprise-level customer tags. - Edit Customer Enterprise Tags: Edits enterprise tags for a customer. Customer Assignment: - Get Departed Member List: Retrieves a list of departed members. - Assign Customer to On-Duty or Off-Duty Member: Assigns customers to either on-duty or off-duty members. - Query Customer Takeover Result: Queries the result of customer takeover assignments. - Assign Customer Group to Off-Duty Member: Assigns customer groups of departed members to other members. Change Callback Notifications: - Add Enterprise Customer Event: Receives events for adding enterprise customers. - Edit Enterprise Customer Event: Receives events for editing enterprise customers. - External Contact Add Member Without Verification Event: Receives events for external contacts adding members without verification. - Delete Enterprise Customer Event: Receives events for deleting enterprise customers. - Delete Follower Event: Receives events for deleting followers. - Customer Takeover Failure Event: Receives events for customer takeover failures. - Customer Group Change Event: Receives events for customer group changes. Message Push: - Create Enterprise Group Send: Creates a group message for the enterprise. - Get Enterprise Group Send Records: Retrieves all group message records for the enterprise. - Send Welcome Message to New Customer: Sends a welcome message to new customers. - Welcome Message Material Management: Manages materials for welcome messages. ``` -------------------------------- ### Tips Control Configuration Source: https://github.com/xen0n/go-workwx/blob/v2/docs/oa.md Configuration for the Tips control, used to display explanatory text within workflows. It holds an array of text content, potentially in different languages. ```APIDOC OATemplateControlConfigTips: TipsContent: []OATemplateControlConfigTipsContent - Array of text content for the tips, supporting different languages and rich text formatting. ``` -------------------------------- ### Identity Authentication API Documentation Source: https://github.com/xen0n/go-workwx/blob/v2/README.md Provides details on the API for obtaining user identity information. ```APIDOC Identity Authentication API: Get Access User Identity: Retrieves the identity information of the user accessing the system. ``` -------------------------------- ### Tips Content Configuration Source: https://github.com/xen0n/go-workwx/blob/v2/docs/oa.md Defines the content for a specific language within the Tips control. It contains an array of text segments, each with a type (plain text or link). ```APIDOC OATemplateControlConfigTipsContent: Text: []OATemplateControlConfigTipsContentText - Array of text segments for a specific language. Lang: string - The language code (e.g., 'zh_CN'). ``` -------------------------------- ### Tips Content SubText Content Configuration Source: https://github.com/xen0n/go-workwx/blob/v2/docs/oa.md Holds the actual content for a Tips text segment, differentiating between plain text and link content. ```APIDOC OATemplateControlConfigTipsContentSubTextContent: Text: *OATemplateControlConfigTipsContentSubTextContentPlain - Content for plain text type. Lang: *OATemplateControlConfigTipsContentSubTextContentLink - Content for link type. ``` -------------------------------- ### Tips Content SubText Configuration Source: https://github.com/xen0n/go-workwx/blob/v2/docs/oa.md Defines a single piece of text within a Tips content segment. It indicates whether the text is plain or a link and provides the corresponding content. ```APIDOC OATemplateControlConfigTipsContentSubText: Type: uint8 - 1: Plain text - 2: Link (only one link allowed per text segment) Content: OATemplateControlConfigTipsContentSubTextContent - The actual content, either plain text or link details. ``` -------------------------------- ### User Authentication API Calls Source: https://github.com/xen0n/go-workwx/blob/v2/docs/apis.md Provides API endpoints for user authentication, including fetching user information. ```APIDOC execUserInfoGet: Request Type: reqUserInfoGet Response Type: respUserInfoGet Access Token: + URL: GET /cgi-bin/user/getuserinfo Doc: 获取访问用户身份 ``` -------------------------------- ### KfServiceState Constants Source: https://github.com/xen0n/go-workwx/blob/v2/docs/kf.md Defines the different states a customer service session can be in. These states track the lifecycle of a session, from initial contact through intelligent assistant handling, queueing, manual reception, and finalization. ```go // KfServiceState 客服会话状态 // // 0 未处理 新会话接入 // 1 由智能助手接待 // 2 待接入池排队中 // 3 由人工接待 // 4 已结束/未开始 type KfServiceState int const ( // KfServiceStateUntreated 未处理 新会话接入 KfServiceStateUntreated KfServiceState = iota // KfServiceStateRobotReception 由智能助手接待 KfServiceStateRobotReception // KfServiceStateInQueue 待接入池排队中 KfServiceStateInQueue // KfServiceStateManualReception 由人工接待 KfServiceStateManualReception // KfServiceStateFinished 已结束/未开始 KfServiceStateFinished ) ``` -------------------------------- ### SendWelcomeMsg Request Parameters Source: https://github.com/xen0n/go-workwx/blob/v2/docs/external_contact.md Parameters for sending a welcome message to new external contacts. Includes a welcome code, text content, and attachments. ```APIDOC SendWelcomeMsgExternalContact: WelcomeCode: string (Welcome message credential provided by the external contact event, valid for 20 seconds) Text: Text (Text message content, max 4000 bytes) Attachments: []Attachments (List of attachments, max 9) ``` -------------------------------- ### OAApplyEvent Model Source: https://github.com/xen0n/go-workwx/blob/v2/docs/oa.md Defines the structure for submitting an approval application. Includes details about the applicant, template, approvers,抄送人, application data, and summary. ```APIDOC OAApplyEvent: 提交审批申请 Fields: CreatorUserID (string): 申请人userid,此审批申请将以此员工身份提交,申请人需在应用可见范围内 TemplateID (string): 模板id。可在“获取审批申请详情”、“审批状态变化回调通知”中获得,也可在审批模板的模板编辑页面链接中获得。暂不支持通过接口提交[打卡补卡][调班]模板审批单。 UseTemplateApprover (uint8): 审批人模式:0-通过接口指定审批人、抄送人(此时approver、notifyer等参数可用); 1-使用此模板在管理后台设置的审批流程,支持条件审批。默认为0 Approver ([]OAApprover): 审批流程信息,用于指定审批申请的审批流程,支持单人审批、多人会签、多人或签,可能有多个审批节点,仅use_template_approver为0时生效。 Notifier ([]string): 抄送人节点userid列表,仅use_template_approver为0时生效。 NotifyType (*uint8): 抄送方式:1-提单时抄送(默认值); 2-单据通过后抄送;3-提单和单据通过后抄送。仅use_template_approver为0时生效。 ApplyData (OAContents): 审批申请数据,可定义审批申请中各个控件的值,其中必填项必须有值,选填项可为空,数据结构同“获取审批申请详情”接口返回值中同名参数“apply_data” SummaryList ([]OASummaryList): 摘要信息,用于显示在审批通知卡片、审批列表的摘要信息,最多3行 ``` -------------------------------- ### Request and Response Types for Bar Source: https://github.com/xen0n/go-workwx/blob/v2/docs/foo.md Defines the request and response types for bar-related operations. 'respBar' is an alias for 'BarTy', and 'reqBar' is an empty struct for requests. ```go type respBar = BarTy ``` ```go type reqBar struct{} ``` -------------------------------- ### WeChat Customer Service API Documentation Source: https://github.com/xen0n/go-workwx/blob/v2/README.md Details the API endpoints for managing WeChat customer service, including account management, receptionists, and message handling. ```APIDOC WeChat Customer Service API: Service Account Management: - Add Service Account: Adds a new customer service account. - Delete Service Account: Deletes a customer service account. - Modify Service Account: Modifies an existing customer service account. - Get Service Account List: Retrieves a list of customer service accounts. - Get Service Account Link: Retrieves the link for a customer service account. Receptionist Management: - Add Receptionist: Adds a receptionist to the service. - Delete Receptionist: Deletes a receptionist. - Get Receptionist List: Retrieves a list of receptionists. Session Assignment and Message Handling: - Assign Service Session: Assigns a customer service session. - Receive Messages and Events: Handles incoming messages and events. - Send Message: Sends messages to customers. - Send Welcome Message and Event Response: Sends welcome messages and responds to events. "Upgrade Service" Configuration: - Configure "Upgrade Service": Manages the "Upgrade Service" feature. Other Basic Information Acquisition: - Get Customer Basic Information: Retrieves basic information about customers. Statistics Management: - Get Customer Data Statistics (Enterprise Summary): Retrieves enterprise-level customer data statistics. - Get Customer Data Statistics (Receptionist Details): Retrieves detailed customer data statistics for receptionists. Robot Management: - Knowledge Base Group Management: Manages knowledge base groups. - Knowledge Base Q&A Management: Manages Q&A pairs within the knowledge base. ``` -------------------------------- ### Tips Content Text Configuration Source: https://github.com/xen0n/go-workwx/blob/v2/docs/oa.md Represents a segment of text within the Tips control content. It specifies the type of text (plain or link) and its associated content. ```APIDOC OATemplateControlConfigTipsContentText: SubText: []OATemplateControlConfigTipsContentSubText - Array of text segments, each with a type and content. ``` -------------------------------- ### OATemplateControlConfigTipsContentSubTextContentLink Type Source: https://github.com/xen0n/go-workwx/blob/v2/docs/oa.md Defines the structure for a link within the configuration of a text control, specifically for tips content. It includes a title and a URL for the link. ```APIDOC OATemplateControlConfigTipsContentSubTextContentLink: Title: string (链接标题) URL: string (链接url) ``` -------------------------------- ### Customer Contact Message Push API Calls Source: https://github.com/xen0n/go-workwx/blob/v2/docs/apis.md API calls for managing message pushes related to customer contacts, including creating message templates and sending welcome messages to new customers. ```APIDOC execAddMsgTemplate: Request Type: reqAddMsgTemplateExternalContact Response Type: respAddMsgTemplateExternalContact Access Token: + URL: POST /cgi-bin/externalcontact/add_msg_template Doc: 创建企业群发 execSendWelcomeMsg: Request Type: reqSendWelcomeMsgExternalContact Response Type: respSendWelcomeMsgExternalContact Access Token: + URL: POST /cgi-bin/externalcontact/send_welcome_msg Doc: 发送新客户欢迎语 ``` -------------------------------- ### Customer Group Management API Calls Source: https://github.com/xen0n/go-workwx/blob/v2/docs/apis.md Provides API endpoints for managing customer groups, including listing groups, retrieving group details, and converting OpenGID to ChatID. ```APIDOC execGroupChatListGet: Request Type: reqGroupChatList Response Type: respGroupChatList Access Token: + URL: POST /cgi-bin/externalcontact/groupchat/list Doc: 获取客户群列表 execGroupChatInfoGet: Request Type: reqGroupChatInfo Response Type: respGroupChatInfo Access Token: + URL: POST /cgi-bin/externalcontact/groupchat/get Doc: 获取客户群详细 execConvertOpenGIDToChatID: Request Type: reqConvertOpenGIDToChatID Response Type: respConvertOpenGIDToChatID Access Token: + URL: POST /cgi-bin/externalcontact/opengid_to_chatid Doc: 客户群opengid转换 ``` -------------------------------- ### Contact Management API Documentation Source: https://github.com/xen0n/go-workwx/blob/v2/README.md Provides details on the various endpoints for managing contacts within the Work WeChat platform, including member and department management. ```APIDOC Contact Management API: Member Management: - Read Member: Retrieves member information. Note: External member information is not yet implemented. - Update Member: Updates existing member details. - Get Department Members: Retrieves members of a specific department. - Get Department Members Details: Retrieves detailed information for members within a department. - UserID to OpenID Conversion: Converts a UserID to an OpenID. - Get Join Enterprise QR Code: Retrieves the QR code for joining the enterprise. - Get UserID by Mobile: Retrieves a UserID using a mobile number. - Get UserID by Email: Retrieves a UserID using an email address. Department Management: - Create Department: Creates a new department. - Get Department List: Retrieves a list of all departments. - Get Sub Department IDs: Retrieves the IDs of sub-departments. Tag Management: - Get Tag Members: Retrieves members associated with a tag. - Add Tag Members: Adds members to a tag. - Delete Tag Members: Removes members from a tag. - Get Tag List: Retrieves a list of all tags. Asynchronous Batch Interfaces: - Incremental Member Update: Performs incremental updates to members. - Full Member Override: Overrides all member data with new data. - Full Department Override: Overrides all department data with new data. - Get Async Task Result: Retrieves the result of an asynchronous task. Contact Callback Notifications: - Member Change Notification: Receives notifications for member changes. - Department Change Notification: Receives notifications for department changes. - Tag Change Notification: Receives notifications for tag changes. - Async Task Completion Notification: Receives notifications when asynchronous tasks are completed. ``` -------------------------------- ### Message Sending API Documentation Source: https://github.com/xen0n/go-workwx/blob/v2/README.md Covers the API for sending various types of messages, including application messages and group chat messages. ```APIDOC Message Sending API: Send Application Message: Sends messages through the application. Receive Message: Handles incoming messages. Send Message to Group Chat Session: - Create Group Chat Session: Creates a new group chat session. - Modify Group Chat Session: Modifies an existing group chat session. - Get Group Chat Session: Retrieves information about a group chat session. - Application Push Message: Pushes messages via the application to a group chat. Message Types: - Text Message: Sends text-based messages. - Image Message: Sends image messages. - Voice Message: Sends voice messages. - Video Message: Sends video messages. - File Message: Sends file messages. - Text Card Message: Sends text card messages. - Rich Media Message: Sends rich media messages (articles). - Rich Media Message (mpnews): Sends rich media messages using the mpnews format. - Markdown Message: Sends messages formatted with Markdown. - Task Card Message: Sends task card messages. ``` -------------------------------- ### Go rxLinkMessageSpecifics Structure Source: https://github.com/xen0n/go-workwx/blob/v2/docs/rx_msg.md Defines the specific fields for link messages, including Title, Description, URL, and PicURL. This structure is used for handling shared links with rich previews. ```go package workwx // rxLinkMessageSpecifics 接收的链接消息,特有字段 type rxLinkMessageSpecifics struct { Title string `xml:"Title" Description string `xml:"Description" URL string `xml:"Url" PicURL string `xml:"PicUrl" } ``` -------------------------------- ### Workwx Department Management APIs Source: https://github.com/xen0n/go-workwx/blob/v2/docs/apis.md APIs for managing departments within the Workwx platform. This includes creating, updating, deleting, and listing departments, as well as retrieving sub-department IDs. ```APIDOC execDeptCreate: URL: POST /cgi-bin/department/create Description: Creates a new department. Requires Access Token: Yes Response Type: respDeptCreate execDeptUpdate: URL: POST /cgi-bin/department/update Description: Updates an existing department's information. Requires Access Token: Yes Response Type: TODO execDeptDelete: URL: GET /cgi-bin/department/delete Description: Deletes a department. Requires Access Token: Yes Response Type: TODO execDeptList: URL: GET /cgi-bin/department/list Description: Retrieves a list of all departments. Requires Access Token: Yes Response Type: respDeptList execDeptSimpleList: URL: GET /cgi-bin/department/simplelist Description: Retrieves a list of sub-department IDs for a given department. Requires Access Token: Yes Response Type: respDeptSimpleList ``` -------------------------------- ### Message Sending Notes Source: https://github.com/xen0n/go-workwx/blob/v2/README.md Explains notes regarding sending confidential messages, particularly for Markdown and other types. ```APIDOC Notes on Confidential Message Sending: Confidentiality Limitations: - Markdown and similar message types do not currently support confidential sending. Attempting to send them as confidential will result in an error. `isSafe` Parameter Rationale: - The `isSafe` parameter is retained in message sending methods for future compatibility. The Work WeChat service may support confidential sending for more message types in the future, avoiding the need for client-side code recompilation. - If an error occurs during sending, the client logic will not persist such attempts, making the parameter's presence non-disruptive. ``` -------------------------------- ### Selector Control Configuration Source: https://github.com/xen0n/go-workwx/blob/v2/docs/oa.md Configuration for Selector controls, supporting single or multi-selection. Includes the type of selection and a list of available options. ```APIDOC OATemplateControlConfigSelector: Type: string - 'single': Single selection - 'multi': Multi-selection Options: []OATemplateControlConfigSelectorOption - List of available options for the selector. ``` -------------------------------- ### KfEvent Model Definition Source: https://github.com/xen0n/go-workwx/blob/v2/docs/kf.md Defines the structure for customer service events, including event type, participants, scene information, and specific event details like welcome codes or failure reasons. ```APIDOC KfEvent: EventType: KfEventType # 事件类型 OpenKfID: string # 客服账号ID ExternalUserID: string # 客户UserID,注意不是企业成员的帐号 ServicerUserID: string # 接待人员userid Scene: string # 用户进入会话事件特有。进入会话的场景值,获取客服账号链接开发者自定义的场景值 SceneParam: string # 用户进入会话事件特有。进入会话的自定义参数,获取客服账号链接返回的url,开发者按规范拼接的scene_param参数 WelcomeCode: string # 用户进入会话事件特有。如果满足发送欢迎语条件(条件为:用户在过去48小时里未收过欢迎语,且未向客服发过消息),会返回该字段。可用该welcome_code调用发送事件响应消息接口给客户发送欢迎语。 WechatChannels: KfWechatChannels # 用户进入会话事件特有。进入会话的视频号信息,从视频号进入会话才有值 FailMsgID: string # 消息发送失败事件特有。发送失败的消息msgid FailType: int # 消息发送失败事件特有。失败类型。0-未知原因 1-客服账号已删除 2-应用已关闭 4-会话已过期,超过48小时 5-会话已关闭 6-超过5条限制 8-主体未验证 10-用户拒收 11-企业未有成员登录企业微信App(排查方法:企业至少一个成员通过手机号验证/微信授权登录企业微信App即可)12-发送的消息为客服组件禁发的消息类型 Status: int # 接待人员接待状态变更事件特有。状态类型。1-接待中 2-停止接待 StopType: int # 接待人员接待状态变更事件特有。接待人员的状态为「停止接待」的子类型。0:停止接待,1:暂时挂起 ChangeType: KfServiceState # 会话状态变更事件特有。变更类型,均为接待人员在企业微信客户端操作触发。1-从接待池接入会话 2-转接会话 3-结束会话 4-重新接入已结束/已转接会话 OldServicerUserID: string # 会话状态变更事件特有。老的接待人员userid。仅change_type为2、3和4有值 NewServicerUserid: string # 会话状态变更事件特有。新的接待人员userid。仅change_type为1、2和4有值 MsgCode: string # 会话状态变更事件特有。用于发送事件响应消息的code,仅change_type为1和3时,会返回该字段。可用该msg_code调用发送事件响应消息接口给客户发送回复语或结束语。 RecallMsgID: string # 撤回消息事件特有。 撤回的消息msgid RejectSwitch: int # 拒收客户消息变更事件特有。 拒收客户消息,1表示接待人员拒收了客户消息,0表示接待人员取消拒收客户消息 ``` -------------------------------- ### Workwx Member Management APIs Source: https://github.com/xen0n/go-workwx/blob/v2/docs/apis.md APIs for managing members within the Workwx platform. This includes creating, retrieving, updating, deleting, and inviting members, as well as converting user IDs and handling mobile/email lookups. ```APIDOC execUserCreate: URL: POST /cgi-bin/user/create Description: Creates a new member. Requires Access Token: Yes Response Type: TODO execUserGet: URL: GET /cgi-bin/user/get Description: Retrieves information for a specific member. Requires Access Token: Yes Response Type: respUserGet execUserUpdate: URL: POST /cgi-bin/user/update Description: Updates an existing member's information. Requires Access Token: Yes Response Type: respUserUpdate execUserDelete: URL: GET /cgi-bin/user/delete Description: Deletes a member. Requires Access Token: Yes Response Type: TODO execUserBatchDelete: URL: POST /cgi-bin/user/batchdelete Description: Deletes multiple members in a batch. Requires Access Token: Yes Response Type: TODO execUserSimpleList: URL: GET /cgi-bin/user/simplelist Description: Retrieves a simple list of members within a department. Requires Access Token: Yes Response Type: TODO execUserList: URL: GET /cgi-bin/user/list Description: Retrieves detailed information for members within a department. Requires Access Token: Yes Response Type: respUserList execConvertUserIDToOpenID: URL: POST /cgi-bin/user/convert_to_openid Description: Converts a user ID to an OpenID. Requires Access Token: Yes Response Type: respConvertUserIDToOpenID execConvertOpenIDToUserID: URL: POST /cgi-bin/user/convert_to_userid Description: Converts an OpenID to a user ID. Requires Access Token: Yes Response Type: respConvertOpenIDToUserID execUserAuthSucc: URL: GET /cgi-bin/user/authsucc Description: Performs secondary authentication for a user. Requires Access Token: Yes Response Type: TODO execUserBatchInvite: URL: POST /cgi-bin/batch/invite Description: Invites members to the enterprise. Requires Access Token: Yes Response Type: TODO execUserJoinQrcode: URL: GET /cgi-bin/corp/get_join_qrcode Description: Retrieves a QR code for users to join the enterprise. Requires Access Token: Yes Response Type: respUserJoinQrcode execUserIDByMobile: URL: POST /cgi-bin/user/getuserid Description: Retrieves a user ID using their mobile number. Requires Access Token: Yes Response Type: respUserIDByMobile execUserIDByEmail: URL: POST /cgi-bin/user/get_userid_by_email Description: Retrieves a user ID using their email address. Requires Access Token: Yes Response Type: respUserIDByEmail ``` -------------------------------- ### WeChat Customer Service Account Management API Calls Source: https://github.com/xen0n/go-workwx/blob/v2/docs/apis.md APIs for managing WeChat customer service accounts, including creating, updating, deleting, listing accounts, and generating contact invitation links. ```APIDOC execKfAccountCreate: Request Type: reqKfAccountCreate Response Type: respKfAccountCreate Access Token: + URL: POST /cgi-bin/kf/account/add Doc: 添加客服账号 execKfAccountUpdate: Request Type: reqKfAccountUpdate Response Type: respKfAccountUpdate Access Token: + URL: POST /cgi-bin/kf/account/update Doc: 修改客服账号 execKfAccountDelete: Request Type: reqKfAccountDelete Response Type: respKfAccountDelete Access Token: + URL: POST /cgi-bin/kf/account/del Doc: 删除客服账号 execKfAccountList: Request Type: reqKfAccountList Response Type: respKfAccountList Access Token: + URL: GET /cgi-bin/kf/account/list Doc: 获取客服账号列表 execAddKfContact: Request Type: reqAddKfContact Response Type: respAddKfContact Access Token: + URL: POST /cgi-bin/kf/add_contact_way Doc: 获取客服账号链接 ``` -------------------------------- ### ExternalContactWay Configuration Source: https://github.com/xen0n/go-workwx/blob/v2/docs/external_contact.md Defines the configuration parameters for creating 'Contact Me' methods for external users. This includes contact type, scene, style, remarks, verification settings, state parameters, user/party associations, and temporary session settings. ```APIDOC ExternalContactWay: Type: int (Contact method type: 1-Single, 2-Multiple) Scene: int (Scene: 1-In mini program, 2-Via QR code) Style: int (Control style for in-mini-program contact) Remark: string (Remarks for the contact method, max 30 chars) SkipVerify: bool (Whether external customers need verification, defaults to true) State: string (Custom state parameter, max 30 chars) User: []string (List of user IDs using this contact method, required for type 1, max 1 user) Party: []int (List of department IDs using this contact method, valid for type 2) IsTemp: bool (Whether it's a temporary session mode, defaults to false) ExpiresIn: int (Temporary session QR code validity in seconds, max 14 days) ChatExpiresIn: int (Temporary session validity in seconds, defaults to 24 hours, max 14 days) UnionID: string (Customer UnionID for temporary sessions, no limit if not specified) Conclusions: Conclusions (End-of-conversation message definition) ``` -------------------------------- ### Go rxVideoMessageSpecifics Structure Source: https://github.com/xen0n/go-workwx/blob/v2/docs/rx_msg.md Defines the specific fields for video messages, including MediaID for the video file and ThumbMediaID for the thumbnail. This enables handling video content and its preview. ```go package workwx // rxVideoMessageSpecifics 接收的视频消息,特有字段 type rxVideoMessageSpecifics struct { MediaID string `xml:"MediaId" ThumbMediaID string `xml:"ThumbMediaId" } ``` -------------------------------- ### Workwx OA Data Interface API Calls Source: https://github.com/xen0n/go-workwx/blob/v2/docs/apis.md Provides API endpoints for interacting with the OA (Office Automation) data interface in Workwx. This includes retrieving template details, submitting approval applications, fetching approval information, and managing vacation configurations for employees. ```APIDOC execOAGetTemplateDetail: Request Type: reqOAGetTemplateDetail Response Type: respOAGetTemplateDetail Access Token: + URL: POST /cgi-bin/oa/gettemplatedetail Doc: 获取审批模板详情 execOAApplyEvent: Request Type: reqOAApplyEvent Response Type: respOAApplyEvent Access Token: + URL: POST /cgi-bin/oa/applyevent Doc: 提交审批申请 execOAGetApprovalInfo: Request Type: reqOAGetApprovalInfo Response Type: respOAGetApprovalInfo Access Token: + URL: POST /cgi-bin/oa/getapprovalinfo Doc: 批量获取审批单号 execOAGetApprovalDetail: Request Type: reqOAGetApprovalDetail Response Type: respOAGetApprovalDetail Access Token: + URL: POST /cgi-bin/oa/getapprovaldetail Doc: 获取审批申请详情 execOAGetCorpVacationConf: Request Type: reqOAGetCorpVacationConf Response Type: respOAGetCorpVacationConf Access Token: + URL: GET /cgi-bin/oa/vacation/getcorpconf Doc: 获取企业假期管理配置 execOAGetUserVacationQuota: Request Type: reqOAGetUserVacationQuota Response Type: respOAGetUserVacationQuota Access Token: + URL: POST /cgi-bin/oa/vacation/getuservacationquota Doc: 获取成员假期余额 execOASetOneUserVacationQuota: Request Type: reqOASetOneUserVacationQuota Response Type: respOASetOneUserVacationQuota Access Token: + URL: POST /cgi-bin/oa/vacation/setoneuserquota Doc: 修改成员假期余额 ``` -------------------------------- ### Session Content Archiving API Documentation Source: https://github.com/xen0n/go-workwx/blob/v2/README.md Details the API for archiving session content, including retrieving participant lists and consent status. ```APIDOC Session Content Archiving API: Get Session Archive Enabled Member List: Retrieves a list of members enabled for session content archiving. Get Session Consent Status: Retrieves the consent status for session archiving. Customer Consent to Chat Content Archiving Event Callback: Receives callback events when customers consent to chat content archiving. Get Session Archive Internal Group Information: Retrieves information about internal groups for session content archiving. ```