### JS-SDK - Getting Started
Source: https://developer.work.weixin.qq.com/document/path/100134
Guide to starting with the JS-SDK.
```APIDOC
## JS-SDK - Getting Started
### Description
Guide to getting started with the JS-SDK.
### Title
Start using
### Description
Instructions on how to begin using the JS-SDK.
```
--------------------------------
### Service Provider Development - Quick Start
Source: https://developer.work.weixin.qq.com/document/path/100047
Guides for service providers to quickly get started with developing applications.
```APIDOC
## Service Provider Development
### Description
Guides for service providers to quickly get started with developing applications.
### Topics
- Server-side API
- Client-side API
- Appendix
- Changelog
- Contact Us
```
--------------------------------
### Service Provider Development - Quick Start
Source: https://developer.work.weixin.qq.com/document/path/100008
Guides for getting started with service provider development, including server-side and client-side APIs.
```APIDOC
## Service Provider Development
### Description
This section covers the development guide for service providers, including prerequisites, basic concepts, and differences from self-built applications.
### Topics
- Development Guide
- Prerequisites
- Basic Concepts
- Differences from Self-Built Application Interfaces
- Application Permission Description for Service Providers
- Callback Configuration
- Get Enterprise WeChat Interface IP Segment
- Get Enterprise WeChat Callback IP Segment
```
--------------------------------
### JS-SDK - Overview
Source: https://developer.work.weixin.qq.com/document/path/100035
General guide and getting started information for the JS-SDK.
```APIDOC
## JS-SDK - Overview
### Description
Provides an overview and instructions on how to get started with the JS-SDK.
### Sections
- `Development Guide`
- `Getting Started`
```
--------------------------------
### Service Provider Agent Development - Quick Start
Source: https://developer.work.weixin.qq.com/document/path/100148
Guides for quickly getting started with service provider agent development, including server-side and client-side APIs.
```APIDOC
## Service Provider Agent Development
### Description
This section covers the quick start guide for service provider agent development, including server-side and client-side APIs.
### Topics
- Quick Start
- Server-side API
- Client-side API
- Appendix
- Update Log
- Contact Us
```
--------------------------------
### Request Example for Getting Chat Info
Source: https://developer.work.weixin.qq.com/document/path/100135
This is an example of the JSON payload required to request chat information. Ensure the 'chat_key' is correctly provided.
```json
{
"chat_key":"CHAT_KEY"
}
```
--------------------------------
### C++ SDK - Get Chat History Example
Source: https://developer.work.weixin.qq.com/document/path/100010
Example of how to call the sync_msg interface using the C++ SDK. This demonstrates the usage of basic parameters and the Invoke method.
```APIDOC
## C++ SDK - Get Chat History
### Description
This example demonstrates how to call the `sync_msg` interface using the C++ SDK. It utilizes the `SpecSdk` class and its `Invoke` method with basic parameters.
### Method
`SpecSdk(corpid, agentid, ability_id, job_info).Invoke(interface_name, req, &rsp)`
### Parameters
#### Basic Parameters
- **corpid** (string) - Required - Authorized enterprise's corpid.
- **agentid** (uint32_t) - Required - Application's agentid. Use 0 if not available for asynchronous tasks.
- **ability_id** (string) - Required - Capability ID used by the program.
- **job_info** (string) - Optional - Task information for associating asynchronous tasks. Required only for reporting asynchronous task results; otherwise, use an empty string.
#### Request Body (req)
- **cursor** (string) - Required - Cursor for pagination.
- **token** (string) - Required - Authentication token.
- **limit** (int) - Optional - Maximum number of records to retrieve.
### Request Example
```cpp
std::string corpid = "YOUR_CORPID";
uint32_t agentid = 123;
std::string ability_id = "YOUR_ABILITY_ID";
std::string job_info = "";
std::string req = "{\"cursor\":\"RMTJID\",\"token\":\"NGEJKGOEGJKOEGNEOAGOEGOKEGHOEEEEE\",\"limit\":200}";
std::string rsp;
// int ret = SpecSdk(corpid, agentid, ability_id, job_info).Invoke("sync_msg", req, &rsp);
// Example using callback SDK (if applicable and initialized)
// SpecCallbackSDK callback_sdk;
// int ret = SpecSdk(callback_sdk).Invoke("sync_msg", req, &rsp);
```
### Response
#### Success Response
- **rsp** (string) - The response content from WeCom backend upon successful invocation. The `errcode` field within `rsp` should be checked for API-level errors.
- **ret** (int) - Return value indicating network and request protocol layer success (0 for success). Callers must check `rsp` for API-level errors even if `ret` is 0.
#### Response Example
(Response content depends on the actual API call)
```
--------------------------------
### JS-SDK Development Guide
Source: https://developer.work.weixin.qq.com/document/path/100036
Development guide for the WeCom JS-SDK, covering setup and basic interfaces.
```APIDOC
## JS-SDK Development
### Description
Guides for using the WeCom JavaScript SDK.
### Topics
- 开发指南
- 概述
- 开始使用
- 基础接口
- 开放接口
```
--------------------------------
### Delete Student Request Example
Source: https://developer.work.weixin.qq.com/document/path/100146
This example demonstrates how to make a GET request to delete a student. Ensure you have the correct access token and the student's userid.
```HTTP
GET https://qyapi.weixin.qq.com/cgi-bin/school/user/delete_student?access_token=ACCESS_TOKEN&userid=USERID
```
--------------------------------
### C++ SDK: Get Chat Data with Callback Example
Source: https://developer.work.weixin.qq.com/document/path/100057
Alternative example for invoking the sync_msg interface using the C++ SDK with a callback instance. This is used when the request parsing was successful, indicated by callback_sdk.IsOk() == true.
```cpp
// SpecCallbackSDK callback_sdk;
int ret = SpecSdk(callback_sdk).Invoke("sync_msg", req, &rsp);
```
--------------------------------
### Knowledge Base Document Snippet Example
Source: https://developer.work.weixin.qq.com/document/path/100035
Illustrates how to format knowledge base documents using the {knowledge} placeholder. This example shows a standard knowledge base file format.
```text
文档1:文本片段1
文档2:文本片段2
```
--------------------------------
### Install Python SDK
Source: https://developer.work.weixin.qq.com/document/path/100057
Install the pycryptodome library required for the Python SDK. This is a prerequisite for using the Python version of the SDK.
```bash
pip3 install pycryptodome
```
--------------------------------
### Customer Tag JSON Example
Source: https://developer.work.weixin.qq.com/document/path/100035
Provides an example of customer tag data formatted as JSON using the {tagjson} placeholder. This helps guide the model in understanding customer attributes.
```json
{
"tag_group": [{
"group_id": "GROUPID1",
"group_name": "客户年龄",
"tag_list": [{
"tag_id": "TAGID1",
"tag_name": "30岁以下"
},{
"tag_id": "TAGID2",
"tag_name": "30岁以上"
}]
}]
}
```
--------------------------------
### Mini Program Development Guide
Source: https://developer.work.weixin.qq.com/document/path/100036
Development guide for WeChat Mini Programs, covering prerequisites, tools, and API support.
```APIDOC
## Mini Program Development
### Description
Guides and information for developing WeChat Mini Programs.
### Topics
- 开发指南
- 开发前须知
- 开发者工具插件支持
- 小程序关联到代开发应用
- 小程序体验版配置
- 微信小程序API支持情况
- 微信小程序组件支持情况
```
--------------------------------
### Authorization Button Example
Source: https://developer.work.weixin.qq.com/document/path/100050
Provides an example of using the `ww-open-button` component for business authorization, specifically for the `getExportCode` open-type. It includes the event handler for the authorization callback.
```html
点击授权
```
```javascript
onExportCodeReady(event) {
console.log(event.detail.exportCode);
}
```
--------------------------------
### Input Protocol Example for Custom Model Analysis
Source: https://developer.work.weixin.qq.com/document/path/100035
This is an example input protocol for custom model analysis. It includes a prompt that utilizes placeholders like {knowledge} and {chatcontent} for dynamic content insertion.
```json
{"prompt": "你是文档问答助手,能够利用给定的文档回答问题。给定的文档为:{knowledge}。请根据上述给定的文档,仔细思考,回答问题:{chatcontent},回答时只能使用给定文档中直接相关的文本内容。忽略无关文本。回答要准确。兜底回复:很抱歉,根据现有的文档内容,无法回答这一问题。", "max_output_length": 200}
```
--------------------------------
### Start Recording Voice
Source: https://developer.work.weixin.qq.com/document/path/100154
Starts recording voice using `ww.startRecord`. This API initiates the voice recording process on the device.
```javascript
ww.startRecord({
success: function () {
console.log('Voice recording started')
}
})
```
--------------------------------
### Upload Media Response Example
Source: https://developer.work.weixin.qq.com/document/path/100140
This is an example of a successful response when uploading media. It includes the errcode, errmsg, file type, the generated media_id, and the creation timestamp.
```JSON
{
"errcode": 0,
"errmsg": "",
"type": "file",
"media_id": "1G6nrLmr5EC3MMb_-zK1dDdzmd0p7cNliYu9V5w7o8K0",
"created_at": "1380000000"
}
```
--------------------------------
### C++ Program Startup Configuration
Source: https://developer.work.weixin.qq.com/document/path/100052
Configuration for starting a C++ program, including the command and arguments.
```bash
/bin/bash // 绝对路径
/app/run.sh
```
--------------------------------
### Java Application Call Get Session Records Example
Source: https://developer.work.weixin.qq.com/document/path/100051
Example of how a Java application can call the get session records capability. It includes program ID, ability ID, and request data.
```json
"program_id": "xxx",
"ability_id": "invoke_sync_msg",
"request_data": "{\"cursor\":\"xxx\",\"token\":\"xxx\",\"limit\":200}"
```
--------------------------------
### Python Application Call Get Session Records Example
Source: https://developer.work.weixin.qq.com/document/path/100051
Example of how a Python application can call the get session records capability. It includes program ID, ability ID, and request data.
```json
{
"program_id": "xxx",
"ability_id": "xxx",
"request_data": "{\"input\":{\"func\":\"sync_msg\",\"func_req\":{\"cursor\":\"RMTJID\",\"token\":\"NGEJKGOEGJKOEGNEOAGOEGOKEGHOEEEEE\",\"limit\":200}}}"
}
```
--------------------------------
### Upload Media Request Example
Source: https://developer.work.weixin.qq.com/document/path/100140
This example demonstrates how to send a POST request to upload a media file to the data zone. Ensure the request includes the correct access token, file type, and uses multipart/form-data with the 'media' field for the file.
```HTTP
POST https://qyapi.weixin.qq.com/cgi-bin/chatdata/upload_media?access_token=accesstoken001&type=file HTTP/1.1
Content-Type: multipart/form-data; boundary=-------------------------acebdf13572468
Content-Length: 220
---------------------------acebdf13572468
Content-Disposition: form-data; name="media";filename="wework.txt"; filelength=6
Content-Type: application/octet-stream
mytext
---------------------------acebdf13572468--
```
--------------------------------
### Media Preview Group Example
Source: https://developer.work.weixin.qq.com/document/path/100050
Demonstrates how to use `ww-media-preview-group` to wrap `ww-open-message` components for media preview functionality. Allows custom preview order using `preview-index`.
```html
```
--------------------------------
### wx.qy.navigateToAddCustomer
Source: https://developer.work.weixin.qq.com/document/path/100079
导航到添加客户页面。
```APIDOC
## wx.qy.navigateToAddCustomer
### 概述
导航到添加客户页面。
```
--------------------------------
### Java Application Call Get Callback Data Example
Source: https://developer.work.weixin.qq.com/document/path/100051
Example of how a Java application can call the get callback data capability. It includes program ID, ability ID, notify ID, and request data.
```json
"program_id": "xxx",
"ability_id": "get_callback_data",
"notify_id": "xxx",
"request_data": "{}"
```
--------------------------------
### Python Application Call Get Callback Data Example
Source: https://developer.work.weixin.qq.com/document/path/100051
Example of how a Python application can call the get callback data capability. It includes program ID, ability ID, notify ID, and request data.
```json
{
"program_id": "xxx",
"ability_id": "xxx",
"notify_id": "xxx",
"request_data": "{\"input\":{\"func\":\"do_async_job\",\"func_req\":{\"notify_id\":\"NOTIFYID\"}}}"
}
```
--------------------------------
### School-Home Application - Live Classes
Source: https://developer.work.weixin.qq.com/document/path/100084
Guides on managing live classes within the school-home application, including retrieving IDs, statistics, and playback details.
```APIDOC
## School-Home Application - Live Classes
### Description
This section details the management of live classes within the school-home application, covering functionalities to retrieve class IDs, view statistics, and manage playback recordings.
### Functionality
- **Get Teacher Live ID List**: Retrieve a list of live class IDs for teachers.
- **Get Live Class Details**: Fetch detailed information about a specific live class.
- **Get Live Class Watch Statistics**: Obtain statistics on who has watched the live class.
- **Get Live Class Non-Watch Statistics**: Get statistics on who has not watched the live class.
- **Delete Live Class Playback**: Remove recordings of live classes.
- **Get Live Class Watch Statistics V2**: Retrieve updated watch statistics.
- **Get Live Class Non-Watch Statistics V2**: Retrieve updated non-watch statistics.
```
--------------------------------
### Handling Callbacks with SpecCallbackSDK (Java Example)
Source: https://developer.work.weixin.qq.com/document/path/100010
Demonstrates how to use `SpecCallbackSDK` to handle callbacks from the WeCom backend. It includes checking the callback status, processing the content, and building a response.
```APIDOC
## Handling Callbacks with SpecCallbackSDK
### Description
This section illustrates how to handle callbacks initiated by the WeCom backend using the `SpecCallbackSDK`. It shows how to construct the SDK instance, check its validity, process the callback data, and prepare a response.
### Code Example
```java
SpecCallbackSDK callback = new SpecCallbackSDK(method, reqHeaders, reqBody);
if (callback.IsOk()) {
String rspContent = HandleCallback(callback); // User-defined handler function
callback.BuildResponseHeaderBody(responseContent);
Map rspHeaders = callback.GetResponseHeaders();
String rspBody = callback.GetResponseBody();
}
```
### Parameters
- `SpecCallbackSDK`: An instance of the callback class generated when the WeCom backend calls the Call Zone. It requires the request to be successfully parsed during construction (`callback.IsOk() == true`).
- `method`: The HTTP method of the incoming request.
- `reqHeaders`: The headers of the incoming request.
- `reqBody`: The body of the incoming request.
- `HandleCallback`: A user-defined callback handling function that returns the response data as a String.
### Usage
- `callback.IsOk()`: Checks if the request parsing was successful.
- `callback.BuildResponseHeaderBody(responseContent)`: Builds the response header and body.
- `callback.GetResponseHeaders()`: Retrieves the response headers.
- `callback.GetResponseBody()`: Retrieves the response body.
```
--------------------------------
### Export Button Example
Source: https://developer.work.weixin.qq.com/document/path/100050
Demonstrates how to use the `ww-open-data-export-button` to create a download button for files. Requires a valid `href` pointing to the file download URL.
```html
点击下载文件
```
--------------------------------
### Input and Output Protocol Example
Source: https://developer.work.weixin.qq.com/document/path/100038
Provides an example of the input and output protocols for asynchronous analysis program calls. The input includes an ability ID, task type, and formatted chat content, while the output contains analysis results like average reply time and negative feedback count.
```json
{"ability_id":"1", "task_type":"service_statistics", "msg": "{chat}"}
```
```json
{"avg_reply_time": 8, "negative_feedback_cnt": 5}
```
--------------------------------
### 小程序登录
Source: https://developer.work.weixin.qq.com/document/path/100044
小程序登录是用户访问小程序的基础,通过wx.qy.login接口可以实现。
```APIDOC
## 小程序登录
### Description
小程序登录是用户访问小程序的基础,通过`wx.qy.login`接口可以实现。
### Method
`wx.qy.login`
### Endpoint
N/A (Client-side API)
### Parameters
None
### Request Example
```javascript
wx.qy.login({
success: function(res) {
console.log(res.code);
}
});
```
### Response
#### Success Response
- **code** (string) - 登录凭证
```
--------------------------------
### Python SDK - Get Chat History Example
Source: https://developer.work.weixin.qq.com/document/path/100010
Example of how to call the sync_msg interface using the Python SDK to retrieve chat history. This demonstrates the usage of basic parameters and the ChatDataSDK class.
```APIDOC
## Python SDK - Get Chat History
### Description
This example shows how to call the `sync_msg` interface using the Python SDK to retrieve chat history. It utilizes the `ChatDataSDK` class with basic parameters.
### Method
`ChatDataSDK.sync_msg(req)`
### Parameters
#### Basic Parameters
- **corpid** (str) - Required - Authorized enterprise's corpid.
- **agentid** (int) - Required - Application's agentid. Use 0 if not available for asynchronous tasks.
- **ability_id** (str) - Required - Capability ID used by the program.
- **job_info** (str) - Optional - Task information for associating asynchronous tasks. Required only for reporting asynchronous task results; otherwise, use an empty string.
#### Request Body (req)
- **cursor** (str) - Required - Cursor for pagination.
- **token** (str) - Required - Authentication token.
- **limit** (int) - Optional - Maximum number of records to retrieve.
### Request Example
```python
corpid = "YOUR_CORPID"
agentid = 123
ability_id = "YOUR_ABILITY_ID"
job_info = ""
req_body = {"cursor":"RMTJID","token":"NGEJKGOEGJKOEGNEOAGOEGOKEGHOEEEEE","limit":200}
req = json.dumps(req_body)
# Assuming ChatDataSDK is imported and initialized
# from wwspecapisdk import ChatDataSDK
# sdk_instance = ChatDataSDK(corpid, agentid, ability_id, job_info)
# res = sdk_instance.sync_msg(req)
# Simplified example as per source:
req = "{\"cursor\":\"RMTJID\",\"token\":\"NGEJKGOEGJKOEGNEOAGOEGOKEGHOEEEEE\",\"limit\":200}"
# res = ChatDataSDK(corpid, agentid, ability_id, job_info).sync_msg(req)
```
### Response
#### Success Response
- **res** (str) - The JSON content of the response from WeCom backend. Note that `errcode` within the response may still indicate an error.
#### Response Example
(Response content depends on the actual API call)
```
--------------------------------
### Q&A Knowledge Base Document Snippet Example
Source: https://developer.work.weixin.qq.com/document/path/100035
Shows the format for 'Q&A pair' knowledge base files using the {knowledge} placeholder. This format is suitable for question-answering models.
```text
文档1:问题1:答案1
文档2:问题2:答案2
```
--------------------------------
### Call Get Chat History API (Python)
Source: https://developer.work.weixin.qq.com/document/path/100010
Example of calling the get chat history API using the Python SDK. Pass basic parameters and the request body as a JSON string.
```python
req = "{\"cursor\":\"RMTJID\",\"token\":\"NGEJKGOEGJKOEGNEOAGOEGOKEGHOEEEEE\",\"limit\":200}"
res = ChatDataSDK(corpid, agentid, ability_id, job_info).sync_msg(req)
```
--------------------------------
### Python: Application Call to Get Callback Data
Source: https://developer.work.weixin.qq.com/document/path/100053
Example of how a Python application can call the 'do_async_job' function to get callback data. It includes program ID, ability ID, notify ID, and request data.
```json
{
"program_id": "xxx",
"ability_id": "xxx",
"notify_id": "xxx",
"request_data": "{\"input\":{\"func\":\"do_async_job\",\"func_req\":{\"notify_id\":\"NOTIFYID\"}}}"
}
```
--------------------------------
### Invoking APIs with SpecSDK (Java Example)
Source: https://developer.work.weixin.qq.com/document/path/100010
Example of how to invoke an API using the SpecSDK, including setting the request and handling the response. It also explains the parameters involved and the meaning of the return code.
```APIDOC
## Invoking APIs with SpecSDK
### Description
This section provides an example of how to invoke an API using the `SpecSDK` in Java. It covers setting the request, invoking the API with a specific interface name, and retrieving the response.
### Code Example
```java
SpecSDK sdk = new SpecSDK(corpId, agentId, abilityId, jobInfo);
sdk.SetRequest(req);
int ret = sdk.Invoke("sync_msg");
String rsp = sdk.GetResponse();
```
### Parameters
- `corpId`, `agentId`, `abilityId`, `jobInfo`: Basic parameters required for SDK initialization.
- `sync_msg`: The interface name. Refer to the specific API documentation for details.
- `req`: The request body, converted to a string in JSON format.
- `rsp`: The response content from the WeCom backend upon successful API invocation.
- `ret`: A return code indicating the success or failure of the network and request protocol layer. A value of 0 indicates successful invocation.
### Note
A `ret` value of 0 signifies no network or protocol-level failure. Callers must further inspect the `errcode` field within `rsp` for application-level errors.
```
--------------------------------
### Call Get Chat History API (C++)
Source: https://developer.work.weixin.qq.com/document/path/100010
Example of calling the get chat history API using the C++ SDK. The Invoke method takes the API name, request body, and a pointer to the response buffer.
```cpp
std::string req = "{\"cursor\":\"RMTJID\",\"token\":\"NGEJKGOEGJKOEGNEOAGOEGOKEGHOEEEEE\",\"limit\":200}";
int ret = SpecSdk(corpid, agentid, ability_id, job_info).Invoke("sync_msg", req, &rsp);
```
--------------------------------
### Python SDK: Get Chat Data Example
Source: https://developer.work.weixin.qq.com/document/path/100057
Example of calling the sync_msg interface using the Python SDK to retrieve chat records. Ensure base parameters like corpid, agentid, ability_id, and job_info are correctly provided.
```python
req = "{\"cursor\":\"RMTJID\",\"token\":\"NGEJKGOEGJKOEGNEOAGOEGOKEGHOEEEEE\",\"limit\":200}"
res = ChatDataSDK(corpid, agentid, ability_id, job_info).sync_msg(req)
```
--------------------------------
### wx.qy.startNFCReader
Source: https://developer.work.weixin.qq.com/document/path/100079
启动NFC读卡器。
```APIDOC
## wx.qy.startNFCReader
### 概述
启动NFC读卡器。
```
--------------------------------
### Request Example for Get Log Level
Source: https://developer.work.weixin.qq.com/document/path/100109
This snippet shows the JSON payload required to request the log level for a specific program ID.
```json
{
"program_id": "xxxx"
}
```
--------------------------------
### Response Example for Get Log Level
Source: https://developer.work.weixin.qq.com/document/path/100109
This snippet illustrates a successful response from the 'get_log_level' API, including the return code, message, and the log level.
```json
{
"errcode": 0,
"errmsg": "ok",
"log_level": 3
}
```
--------------------------------
### C++ SDK: Get Chat Data Example
Source: https://developer.work.weixin.qq.com/document/path/100057
Example of invoking the sync_msg interface using the C++ SDK to fetch chat records. The Invoke function takes the interface name, request payload, and a response buffer. A return value of 0 indicates success at the network and protocol level.
```cpp
std::string req = "{\"cursor\":\"RMTJID\",\"token\":\"NGEJKGOEGJKOEGNEOAGOEGOKEGHOEEEEE\",\"limit\":200}";
int ret = SpecSdk(corpid, agentid, ability_id, job_info).Invoke("sync_msg", req, &rsp);
```
--------------------------------
### Delete Parent API Request Example
Source: https://developer.work.weixin.qq.com/document/path/100152
This snippet shows how to make a GET request to delete a parent using their userid. Ensure you have the necessary access token and permissions.
```http
GET (HTTPS) https://qyapi.weixin.qq.com/cgi-bin/school/user/delete_parent?access_token=ACCESS_TOKEN&userid=USERID
```
--------------------------------
### Login with WeCom Mini Program
Source: https://developer.work.weixin.qq.com/document/path/100154
Demonstrates the process of logging into a WeCom mini program using the `wx.qy.login` API. This involves obtaining a code and then using `code2Session` to exchange it for user session information.
```javascript
wx.qy.login({
success: function (res) {
if (res.code) {
// Send res.code to backend to get session_key and openid
wx.request({
url: 'YOUR_BACKEND_URL',
data: {
code: res.code
}
})
} else {
console.log('Login failed: ' + res.errMsg)
}
}
})
```
```javascript
// Backend code example (Node.js with Express)
app.all('/login', function(req, res) {
const code = req.query.code;
// Replace with your actual AppID and AppSecret
const appid = 'YOUR_APPID';
const secret = 'YOUR_APPSECRET';
const url = `https://qyapi.weixin.qq.com/cgi-bin/miniprogram/jscode2session?appid=${appid}&secret=${secret}&js_code=${code}`;
request(url, function (error, response, body) {
if (!error && response.statusCode == 200) {
res.send(body);
} else {
res.status(500).send('Error fetching session');
}
});
});
```
--------------------------------
### Call Get Chat History API with Callback (C++)
Source: https://developer.work.weixin.qq.com/document/path/100010
Example of calling an API using the C++ SDK with a callback instance. This is used when the request parsing is successful.
```cpp
// SpecCallbackSDK callback_sdk;
int ret = SpecSdk(callback_sdk).Invoke("sync_msg", req, &rsp);
```
--------------------------------
### Callback Configuration
Source: https://developer.work.weixin.qq.com/document/path/100019
Guides on configuring callback notifications for service provider applications.
```APIDOC
## Callback Configuration
### Description
Instructions on setting up and managing callback notifications for service provider applications.
### Topics Covered
- Push Suite Ticket
- Authorization Notification Events
- Permanent Authorization Code Reset Notification
```
--------------------------------
### Application Invokes Get Callback Data Ability (C++)
Source: https://developer.work.weixin.qq.com/document/path/100051
Example of how a C++ application can invoke the 'get_callback_data' ability, requiring program ID, ability ID, and notify ID.
```APIDOC
## Application Invokes Get Callback Data Ability (C++)
### Description
This example demonstrates how a C++ application can invoke the 'get_callback_data' ability. It requires the `program_id`, `ability_id`, and `notify_id`.
### Request Body
```json
{
"program_id": "xxx",
"ability_id": "get_callback_data",
"notify_id": "xxx",
"request_data": "{}"
}
```
```
--------------------------------
### Initialize Bluetooth Module
Source: https://developer.work.weixin.qq.com/document/path/100154
Initializes the Bluetooth module using `ww.bluetooth.init`. This is the first step required before interacting with Bluetooth devices.
```javascript
ww.bluetooth.init({
success: function () {
console.log('Bluetooth module initialized')
},
fail: function (err) {
console.error('Failed to initialize Bluetooth module:', err)
}
})
```
--------------------------------
### Application Invokes Get Callback Data Ability (Java)
Source: https://developer.work.weixin.qq.com/document/path/100051
Example of how a Java application can invoke the 'get_callback_data' ability, requiring program ID, ability ID, and notify ID.
```APIDOC
## Application Invokes Get Callback Data Ability (Java)
### Description
This example demonstrates how a Java application can invoke the 'get_callback_data' ability. It requires the `program_id`, `ability_id`, and `notify_id`.
### Request Body
```json
{
"program_id": "xxx",
"ability_id": "get_callback_data",
"notify_id": "xxx",
"request_data": "{}"
}
```
```
--------------------------------
### Java SDK - Basic Parameters
Source: https://developer.work.weixin.qq.com/document/path/100010
Overview of the basic parameters required for initializing and using the Java SDK to interact with WeCom backend services.
```APIDOC
## Java SDK - Basic Parameters
### Description
This section outlines the fundamental parameters required when using the Java SDK to make requests to the WeCom backend. These parameters are essential for initializing SDK components and authenticating requests.
### Parameters
#### Basic Parameters
- **corpId** (String) - Required - The authorized enterprise's corpid.
- **agentId** (long) - Required - The application's agentid. This identifies the application making the call. Use 0 if the agentid is not available for asynchronous tasks.
- **abilityId** (String) - Required - The capability ID utilized by the program.
- **jobInfo** (String) - Optional - Task information used to correlate asynchronous tasks. This is mandatory only when calling the interface to report asynchronous task results. For other calls, an empty string can be used.
### Usage Notes
- Ensure the Java SDK classes (`SpecSDK.java`, `SpecCallbackSDK.java`, `SpecUtil.java`) are placed within the `com.tencent.wework` package structure.
- The native dynamic library `libWeWorkSpecSDK.so` must be accessible via `java.library.path` or placed in a system library path (e.g., `/usr/lib`).
- The SDK depends on `openssl3`, requiring `libcrypto.so.3` and `libssl.so.3`.
```
--------------------------------
### Service Provider 代开发 - Basic Concepts
Source: https://developer.work.weixin.qq.com/document/path/100016
Introduction to the basic concepts and differences between service provider代开发 and self-built applications.
```APIDOC
## Service Provider 代开发 - Basic Concepts
### Description
This section covers the fundamental concepts of service provider代开发, highlighting the differences compared to self-built applications and explaining permission details.
### Key Areas:
- Basic Concepts Introduction
- Differences from Self-built Application Interfaces
- 代开发 Application Permission Description
- Callback Configuration
```
--------------------------------
### Application Invokes Get Callback Data Ability (Python)
Source: https://developer.work.weixin.qq.com/document/path/100051
Example of how a Python application can invoke the 'get_callback_data' ability, requiring program ID, ability ID, and notify ID.
```APIDOC
## Application Invokes Get Callback Data Ability (Python)
### Description
This example demonstrates how a Python application can invoke the 'get_callback_data' ability. It requires the `program_id`, `ability_id`, and `notify_id`.
### Request Body
```json
{
"program_id": "xxx",
"ability_id": "xxx",
"notify_id": "xxx",
"request_data": "{\"input\":{\"func\":\"do_async_job\",\"func_req\":{\"notify_id\":\"NOTIFYID\"}}}"
}
```
```
--------------------------------
### Java: Application Call to Get Session Records
Source: https://developer.work.weixin.qq.com/document/path/100053
Example of how a Java application can call the 'invoke_sync_msg' ability to retrieve session records. It specifies program ID, ability ID, and request data.
```json
"program_id": "xxx",
"ability_id": "invoke_sync_msg",
"request_data": "{\"cursor\":\"xxx\",\"token\":\"xxx\",\"limit\":200}"
```
--------------------------------
### Python: Application Call to Get Session Records
Source: https://developer.work.weixin.qq.com/document/path/100053
Example of how a Python application can call the 'sync_msg' function to retrieve session records. It includes program ID, ability ID, and request data.
```json
{
"program_id": "xxx",
"ability_id": "xxx",
"request_data": "{\"input\":{\"func\":\"sync_msg\",\"func_req\":{\"cursor\":\"RMTJID\",\"token\":\"NGEJKGOEGJKOEGNEOAGOEGOKEGHOEEEEE\",\"limit\":200}}}"
}
```