Third-Party App
Hardware Access and Credits Redemption
Integration Introduction
Platform Overview
WorkBuddy Open Platform uses the OAuth 2.1 specification for user authentication and authorization, and provides HTTPS-based Open APIs for developers and ecosystem partners. Third-party applications can operate on user data through the Open API after obtaining user authorization.
To protect the security and privacy of user data, third-party applications must explicitly request authorization from the user before accessing user data. After the user authorizes, the platform issues third-party credentials in accordance with the OAuth specification. Third-party applications can obtain these credentials and perform the required operations with the platform.
Core Capabilities
| Capability Domain | Description |
|---|---|
| Local Assistant Chat | Message interaction with the PC local assistant via API |
| Cloud Task Management | Create and manage cloud AI tasks; supports mobile / app sessions |
| Artifact Management | Fetch session artifacts, incremental updates, and media file downloads |
| Redemption Code Redemption | Redeem WorkBuddy credits for users via vouchers or redemption codes |
Application Types
The Open Platform currently supports three types of third-party applications for different integration scenarios:
| Application Type | Description | Available Permissions |
|---|---|---|
| Hardware Access | Open API capabilities for hardware device vendors and partners. Hardware devices (such as smart glasses and in-vehicle systems) connect to WorkBuddy through the Open Platform. After user authorization, they can call Open APIs such as local assistant chat, cloud tasks, and session artifacts | All permissions (apply as needed for the business) |
| Buddy App | Vertical-industry AI Harness capabilities for industry partners. Partners wrap industry know-how into WorkBuddy; after user authorization they can call Open APIs and deliver a ready-to-use industry AI Harness | Partial permissions (apply as needed for the business) |
| Credits App | Credit-benefits API capabilities for developers and partners. After user authorization, the application can redeem WorkBuddy credits for users via vouchers or redemption codes, suitable for credit issuance and similar scenarios | Partial permissions (e.g. credits and benefits) |
Terminology
| Role | Description | Trust Boundary |
|---|---|---|
| Resource Owner | The resource owner, typically a WorkBuddy user | Determines the resource scope accessible to third-party apps or connectors |
| Third Application | A standard third-party application built on WorkBuddy Open Platform | Can call Open API after user authorization |
| WorkBuddy | The agent runtime that executes tasks and initiates tool calls on behalf of the user | Short-lived credentials should be obtained before calling |
| Open Platform | The open platform responsible for app registration, authorization confirmation, token issuance, Scope management, and auditing | Platform-level trust boundary; the permission source for all open API calls |
Integration Guide
Integration Flow Overview
Step 1: Create an Application and Complete Configuration
In WorkBuddy Open Platform, fill in the application basic information, permission management information, and callback URL configuration in one pass. After completing all application configuration, submit for review.
Step 2: From User Authorization to Calling APIs
The application guides the user through OAuth 2.1 authorization. After the server exchanges for access credentials, it can call the Open API. The overall process consists of three consecutive stages:
- First, the third-party application initiates user authorization
2. After the user completes authorization, the application server exchanges for access credentials 3. The application uses the access credentials to call the required Open API
For details on authorization requests, see "Auth API: Request User Authorization". For obtaining and refreshing access credentials, see "Auth API: Exchange for API Access Credentials". For parameters, permissions, and response structures of specific business APIs, see "Open API Reference". The following sequence diagram shows the complete process from user authorization to API calls.
Application Registration and Authorization
Hardware Access
Hardware Access is open to hardware device vendors and partners. After creating a hardware access application on the Open Platform, hardware devices (such as smart glasses and in-vehicle systems) can complete OAuth 2.1 authorization with the user and then use Open APIs for local assistant chat, cloud task management, session artifacts, and more, extending WorkBuddy's agent capabilities to hardware terminals.
When creating a hardware access application, complete the basic information, permission management information, and callback URL configuration in one pass. After submission, the application enters the review process. Once approved, the application is published and the corresponding capabilities are enabled.
Application Basic Configuration
- Sign in to WorkBuddy Open Platform
- Click "Hardware Access"
- Fill in the basic information
- Configure permission management information
- Configure the OAuth callback URL
- Submit for review
Credits App
The Credits App is open to developers and partners for credit-benefits redemption. After user authorization, the application can use Open APIs to redeem WorkBuddy credits for users via vouchers or redemption codes, suitable for credit issuance and similar scenarios.
When creating a credits app, complete the basic information, permission management information, and callback URL configuration in one pass. After submission, the application enters the review process. Once approved, the application is published and the corresponding capabilities are enabled.
Application Basic Configuration
- Sign in to WorkBuddy Open Platform
- Click "Other > Credits"
- Fill in the basic information
- Configure permission management information (only credits and benefits Scopes are available)
- Configure the OAuth callback URL
- Submit for review
Application Notes
| Status | Description |
|---|---|
| Under Review | Application configuration submitted; awaiting platform review |
| Enabled | Application approved and published; can call authorized Open APIs |
| Rejected | Application review failed; modify the configuration based on review feedback and resubmit |
Application credential notes: After creation, the application enters review status and the platform generates client_id and client_secret. client_secret is shown in plaintext only once after the application is created successfully. Keep client_secret secure and do not expose it in frontend or client code. If it is lost, contact the platform.
Authorization
After the application is approved and enabled, guide the user through OAuth 2.1 authorization to obtain an access_token. The authorization flow involves two types of endpoints. Full API documentation is in "Open API Reference":
- "Auth API" — GET /authorize (request user authorization), POST /token (exchange / refresh Token)
Token Types Overview
| Token Type | Purpose | Validity | Notes |
|---|---|---|---|
| access_token | Credential for calling Open API | 24 hours | Obtained via "Exchange for Access Credentials"; must be re-obtained after expiration. |
| refresh_token | Refresh access_token | 60 days | Obtained via "Exchange for Access Credentials"; must be stored securely on the server and must not be exposed in frontend or client code. |
Permission Configuration List and Related APIs
Scope Permission List
| Category | Scope | Permission Name | Description |
|---|---|---|---|
| User profile | user.profile.readable | Read personal profile | Read the user's nickname and avatar |
| User profile | user.contact.readable | Verify contact information | Check whether the phone number provided by the caller matches the user's phone number |
| Credits and benefits | user.credit.exchange | Redeem credits via voucher | Redeem WorkBuddy credits for the user via a voucher or redemption code |
| Cloud tasks | user.task.invokable | Create and execute cloud tasks | Allow the application to create and execute cloud tasks per user instructions |
| Cloud tasks | user.task.readable | Read task list and details | Allow the application to read the user's cloud task list and task details |
| Local assistant | user.localassistant.invokable | Send messages to the local assistant | Send messages to the local assistant (the user's PC) to drive the on-device Agent to execute tasks |
| Local assistant | user.localassistant.readable | Read local assistant online status and message history | Read the local assistant's (user PC) online status and conversation message history |
Permission Application Guide
Application Steps
- On the application management page, select the Scope to apply for
- Describe the use case and necessity
- Submit for review
Principle of least privilege: Apply only for Scopes required by the application's features; when the user authorizes, request only the Scopes needed for the current operation; avoid requesting permissions beyond business needs.
Share Capability Integration
Feature Overview
WorkBuddy Share lets a third-party application send text, images, audio, files, and resource links into WorkBuddy in one step.
WorkBuddy Share is open to developers who have completed enterprise verification. Create a share application on WorkBuddy Open Platform (fill in Basic configuration → App platform information), submit it for review, and an application ID is generated. After approval, generate a key pair to obtain share integration permission.
WorkBuddy Share currently supports PC integration (Windows applications / macOS applications). Mobile integration (Android / iPhone / HarmonyOS applications) will be available later.
Before You Integrate
Before integrating the share capability, create a share application on WorkBuddy Open Platform, pass review, and generate a key pair. Confirm that the user's WorkBuddy client is 5.8.0 or later. Earlier versions cannot launch a share. Mobile integration (Android / iPhone / HarmonyOS) and the share SDK will be available later.
On the Open Platform, open Third-party integration → Share capability integration, click Create application, and complete the two steps Basic configuration → App platform information. You can Save draft at any time. An application ID is generated as soon as you submit for review, and the review finishes within 7 business days. After approval, generate a key pair on the application details page, then integrate by following the PC Development Guide.
Step 1: Basic Configuration
| Field | Required | How to fill it in |
|---|---|---|
| Application name | Yes | Unique across the platform. A duplicate name cannot be submitted. Use the real product name, consistent with the application website. Do not use words such as "Demo", "test", or "测试". Exaggerated, misleading, or infringing names are not allowed |
| Application logo | Yes | At least 96×96 px, at most 100 KB, JPG or PNG. Use the product's real icon. Do not use unauthorized third-party assets |
| Application description | Yes | Describe the service and features the application provides. Reviewers use this to verify that the application is real, and it must match the actual features |
| Application website | Yes | Must be reachable (a login page does not count). The page must include an application introduction, service details, a user agreement, copyright information, and website filing information. Applications whose filing entity matches the verified entity on the Open Platform are approved first. If they differ, explain the relationship in the application notes |
| Application notes | No | Anything reviewers need to know, such as a login account for viewing the website or an explanation of the relationship between entities |
Step 2: App Platform Information
Select the platforms to integrate (Windows application / macOS application). Select at least one. Each selected platform expands into its own card.
Windows application
| Field | Required | How to fill it in and where to find it |
|---|---|---|
| Windows application identifier | Yes | The executable file name of the main program (for example wemeet.exe) or the product name. Windows has no package-name concept. Do not enter a reverse-DNS name |
| Code signing subject | Yes | The Subject of the signing certificate. To find it: right-click the .exe → Properties → Digital Signatures → select the signature → Details → View Certificate → Subject |
| Code signing certificate thumbprint | Yes | The certificate Thumbprint, 40 hexadecimal characters. Find it on the same path under Thumbprint. The thumbprint shown in certificate properties has a space between every two characters. Remove the spaces when you fill it in |
| Application listed | Yes | Yes / No. If you select Yes, provide a download link (Microsoft Store or the official website) |
| Integration method | Fixed | deeplink |
Read the subject and thumbprint together (PowerShell; replace the path with your exe path):
$sig = Get-AuthenticodeSignature "C:\Path\To\App.exe"
$sig.SignerCertificate.Subject # 例:CN="XXX Technology Co., Ltd.", O="XXX Technology Co., Ltd.", C=CN
$sig.SignerCertificate.Thumbprint # 例:A1B2C3D4E5F6…(40 位十六进制)
The application must be published with a code signing certificate (OV / EV certificates require a verified company application). Self-signed or unsigned applications cannot pass review.
macOS application
| Field | Required | How to fill it in and where to find it |
|---|---|---|
| Bundle ID | Yes | The unique identifier of your macOS application. Find it in the Xcode project under General → Identity → Bundle Identifier |
| Team ID | Yes | The 10-character identifier Apple assigns to a developer team. Sign in to developer.apple.com → Account → Membership details |
| Application listed | Yes | Yes / No. If you select Yes, provide a download link (Mac App Store or the official website) |
| Integration method | Fixed | deeplink |
Read the Bundle ID and Team ID together (Terminal; replace the path with your .app path):
defaults read /Applications/你的应用.app/Contents/Info.plist CFBundleIdentifier # 例:com.example.app
codesign -dv --verbose=4 /Applications/你的应用.app 2>&1 | grep TeamIdentifier # 例:TeamIdentifier=AB12CD34EF
The Team ID comes from the Apple Developer Program membership page and is shared by every application in the same team. If you cannot see it, confirm that the account has joined the developer program.
What these fields are for: Launching on desktop does not verify the caller's application signature. The Windows code signing subject and thumbprint, and the macOS Team ID, are used for registration, uniqueness checks, and review. A wrong value does not block launch, but it is rejected during review.
Submission and Review
After both steps are complete, click Submit for review.
| Item | Description |
|---|---|
| Submit | The submit button stays disabled while a required field is missing |
| Application ID | Generated immediately after submission. The application status becomes Under review. You can view the application ID, but you cannot generate a key pair yet |
| Review | Completed within 7 business days. During review you can Withdraw the application and return to editing |
| Result notification | The result is sent through the Open Platform notification center, the in-app WorkBuddy message center, and the developer email. A rejection includes the reason. You can edit and resubmit, and the application ID stays the same |
| After approval | The application status becomes Enabled. Generate a key pair under Security configuration on the application details page, then integrate the share capability by following the PC Development Guide. Basic information is frozen after submission. The platform handles later changes. You can Add a platform at any time |
Generate a Key Pair
The key pair is generated after the application is approved. It is not submitted when the application is created.
| Item | Description |
|---|---|
| Where to generate | On the application details page, click Generate a key pair. Only the organization's super admin can do this |
| How it is generated | An asymmetric key pair is generated locally in the browser (RSA-2048, private key in PKCS#8 PEM, signature algorithm RSAwithSHA256 with PSS padding). The private key never reaches the platform server |
| Key ID | After generation, the key pair's identifier kid is shown. Pass it with the signature parameters when calling the share capability. WorkBuddy looks up the matching public key by kid to verify the signature |
| When it takes effect | It takes effect as soon as it is generated. No extra save step is required. The public key is used for verification immediately |
| Keeping the private key | A dialog shows the public key and the private key. The private key can be copied in one click, with the notice "The private key is shown only this once. It will not be shown again after you close this dialog. Copy and save it now." After the dialog closes, the private key is not shown again. The platform does not store your private key. If you lose it, generate a new pair. Keep the private key on your server. Do not put it in a web page, a desktop application package, or a mobile application package |
| Limit | At most 10 key pairs can be active at the same time. At the limit, delete a key pair you no longer use before generating another |
| Multiple pairs | Several pairs can be active at once, each with its own kid. WorkBuddy selects the public key by the kid sent with the call, so you can rotate smoothly: generate the new pair, switch signing to the new kid, then delete the old pair |
| Delete | You can delete a key pair you no longer use. Deletion takes effect immediately, and that public key is no longer used for verification. The kid becomes invalid, and calls still signed with the old kid fail verification |
| Public key | The key list shows each kid, the public key fingerprint, the creation time, and the last-used time. The public key can be copied at any time. The private key appears only once, in the generation dialog |
Identifier Conflicts and Appeals
| Check | Rule |
|---|---|
| Application name | Unique across the platform. A duplicate shows "该应用名称已被占用,请更换" under the input |
| Per-platform application identifier and signature information | Unique across the platform for that platform, and it can belong to only one organization. A conflict is blocked and an appeal is offered |
To appeal: if the identifier or name is yours (for example after a rebind, or when another account claimed it by mistake), email openworkbuddy@tencent.com. Include the occupied application name or identifier, your developer organization name, and proof of ownership (a software copyright certificate, screenshots of a store console, and similar). The platform checks the verified organization and then updates ownership.
Using the WorkBuddy Brand Mark
After you integrate the share capability, show the WorkBuddy mark on the entry in your application that launches a share (the share target in the share panel, and the integration badge on the settings page), so users can see where the content will go. The mark must follow the WorkBuddy brand guidelines: WorkBuddy Brand Center (switch to the WorkBuddy brand after you open it, and download logo assets from 徽标 on that page).
| Category | Rule |
|---|---|
| Where it may be used | Only on entries directly related to the WorkBuddy share capability. Do not use it as your application icon, splash screen, advertising, or external promotional material |
| Assets | Use the official logo pack downloaded from the brand center, or the standard assets provided by the SDK. Use them as-is. You may scale them proportionally. Do not stretch, squash, crop, rotate, or add shadows or effects |
| Clear space and background | Keep the required clear space. On a light background use the standard horizontal lockup or the symbol. On a dark background the wordmark turns white, but the symbol stays the brand color. Do not place it on a busy background |
| Color | Do not change the specified colors of the logo or the symbol, and do not use unapproved colors |
| Visual hierarchy | The WorkBuddy mark must not be more visually prominent than your own brand |
| Wording | Always write WorkBuddy (camel case). Do not write WORK BUDDY, Work Buddy, or codebuddy. Describe it as "分享到 WorkBuddy" or "基于 WorkBuddy". Do not use wording such as "官方", "授权", or "合作伙伴" |
| What the relationship means | Showing the WorkBuddy mark only means you have integrated the share capability. It does not mean WorkBuddy officially endorses or recommends you |
The platform checks mark usage during application review and in production. If the mark is not used as specified, the platform may require a correction and pause the share capability.
FAQ
| Question | Answer |
|---|---|
| The certificate thumbprint is rejected as the wrong format | The thumbprint in the certificate properties has a space between every two characters. Remove the spaces. It is 40 hexadecimal characters |
| The signing subject or thumbprint cannot be read | Confirm the exe is signed with a code signing certificate. If Properties has no Digital Signatures tab, the file is unsigned, and an unsigned application cannot integrate |
| The Team ID cannot be found | Sign in to developer.apple.com → Account → Membership details. The account must have joined the Apple Developer Program |
| Several products in one company share one signing certificate | They can integrate. Create a separate application for each product and fill in that product's application identifier |
| The application is not listed in any store yet | It can still integrate. Set Application listed to No. After it is listed, add the link on the application details page |
| There is no code signing certificate | Windows cannot integrate yet. Apply for an OV / EV code signing certificate, then submit |
| The private key was lost | Generate a new key pair under Security configuration on the application details page. It takes effect immediately. Delete the old key pair once you are sure it is no longer used |
After the steps above, integrate the share capability by following the PC Development Guide.
PC Development Guide
Supported versions: WorkBuddy 5.8.0 and later.
Capability Overview
A third-party application builds a share message, signs a packet with the application private key, and hands it to WorkBuddy through the PC HTTPS interstitial page or, later, the mobile SDK. After WorkBuddy validates the request, it prefills the content into the task input. The user can review, edit, and send. A successful launch or a successful prefill does not mean the user has submitted the task.
The current share scene value is always newTask. If the new-task input in WorkBuddy already has content, the shared content overwrites that input. Otherwise a new task is created and the content is filled into the task input. newTask is the name of a protocol scene. It does not mean every share is forced to create a brand-new task.
The message payload uses TaskPayload. Its content blocks can carry text, images, audio, file resources, and resource links. Support for local resources and embedded data differs by platform. See below.
Quick Start: Share a Text Message
The example below uses Node.js built-in modules. It signs on the server and produces the PC HTTPS interstitial link. You first need a real appId, kid, and the matching private key from the Open Platform. Save the private key as private-key.pem on the server, keeping the PEM header, footer, and line breaks. Do not commit this file to a repository.
Save the following code as sign.cjs:
const fs = require('node:fs');
const crypto = require('node:crypto');
const b64 = value => Buffer.from(value, 'utf8').toString('base64');
const appId = process.env.APP_ID;
const kid = process.env.KEY_ID;
if (!appId || !kid) throw new Error('缺少 APP_ID 或 KEY_ID');
const messageObject = {
title: '分析仓库',
description: '请总结仓库结构',
payload: {
action: 'start',
promptContentBlocks: [{ type: 'text', text: '分析这个仓库' }]
}
};
const messageJson = JSON.stringify(messageObject);
if (Buffer.byteLength(messageJson, 'utf8') > 16384) {
throw new Error('原始消息 JSON 超过 16 KiB');
}
const packet = {
appId,
kid,
message: b64(messageJson),
nonce: crypto.randomBytes(16).toString('hex'),
scene: 'newTask',
timestamp: String(Math.floor(Date.now() / 1000))
};
const signingText = [
`appId=${b64(packet.appId)}`,
`kid=${b64(packet.kid)}`,
`message=${packet.message}`,
`nonce=${b64(packet.nonce)}`,
`scene=${b64(packet.scene)}`,
`timestamp=${b64(packet.timestamp)}`
].join('&');
packet.sig = crypto.sign('sha256', Buffer.from(signingText, 'utf8'), {
key: fs.readFileSync('./private-key.pem', 'utf8'),
padding: crypto.constants.RSA_PKCS1_PADDING
}).toString('base64');
const query = new URLSearchParams(packet).toString();
console.log(`https://workbuddy.cn/app/open-deeplink?${query}`);
Run it in the server directory where the private key is stored (replace the values with your application):
APP_ID='你的应用标识' KEY_ID='对应的密钥标识' node sign.cjs
Open the HTTPS interstitial link that is printed, and confirm that it launches WorkBuddy, prefills the message in the input, and then lets the user edit and send. Generate the signed packet when the user starts a share. Do not generate a link ahead of time and reuse it for a long time.
The Full PC Link
The PC side exposes an HTTPS interstitial page: https://workbuddy.cn/app/open-deeplink. The third-party application opens the link, with its parameters, in the system browser. After the user confirms, WorkBuddy is launched. If the client is not installed, the page can guide the user to install it.
The link uses seven query parameters: appId, kid, message, nonce, scene, timestamp, and sig. Encode the transport parameters with URLSearchParams. Do not concatenate the Base64 characters +, /, and = by hand.
The link below is a complete example of every field and value. It was produced with a temporary RSA-2048 key and verified locally, but app_demo and kid_demo are not registered on the platform, and the example timestamp expires. It cannot be used for a real share.
HTTPS interstitial page:
https://workbuddy.cn/app/open-deeplink?appId=app_demo&kid=kid_demo&message=eyJ0aXRsZSI6IkRlbW8iLCJkZXNjcmlwdGlvbiI6IkRlbW8iLCJwYXlsb2FkIjp7ImFjdGlvbiI6InN0YXJ0IiwicHJvbXB0Q29udGVudEJsb2NrcyI6W3sidHlwZSI6InRleHQiLCJ0ZXh0IjoiSGVsbG8gV29ya0J1ZGR5In1dfX0%3D&nonce=9f2c8b1a6d4e7035c8a912f0b7d6e453&scene=newTask×tamp=1791515336&sig=s%2Bbo02%2BkPMj%2BbJV9iuzAxsIo3oEoPVYLl%2FkgPqQe4J0MTEEqa2kxmSssB%2Bg%2BzhsD1UZrNTlMPLQfUbApszCx05ujCKJ%2Fmn5u3QdoiWsIwl7dejptqHLI9iLIndlVroeliQ7r1mKtZNjLElWH4GNCeQbA2taPZanBcrcTQ5LXPXRRouxmryDPq%2FgbFKH9%2FU5vAoZUFEnKI1NqMs1W2QkEvLhj6kDOz2NmffZK64mHrpMlip6v3hD3ImPECWen1xmJJhetTV4Iy8bsinsio3PG7ccNf9dqYtpevWPlQlQhl09GVvhfNrKjQREkJG5Y6SkA3pIoB8vbNdLSH09D1UgV2Q%3D%3D
URL-decode message above, then decode it as standard Base64. The UTF-8 JSON is:
{"title":"Demo","description":"Demo","payload":{"action":"start","promptContentBlocks":[{"type":"text","text":"Hello WorkBuddy"}]}}
%3D, %2B, and %2F are the URL encodings of the Base64 characters =, +, and /. The values used for signing are the field values before URL encoding. The values used in the link are the transport values after signing is complete.
Parameter Types and Message Structure
Transport Signature Packet
The table describes the transport values in the URL query parameters or the signature packet. message is a string in transit. It becomes a WorkBuddyMessage object only after decoding. The actual parameters of the mobile SDK follow its official API documentation.
| Parameter | Transport type | Format and meaning |
|---|---|---|
appId | string | Application identifier assigned by the Open Platform |
kid | string | Key identifier paired with the private key used for this signature |
message | string | Standard Base64 of the UTF-8 JSON. The raw JSON is at most 16,384 bytes |
nonce | string | 32 lowercase hexadecimal characters from 16 cryptographically random bytes. Only 0–9 and a–f |
scene | string | Currently fixed as newTask |
timestamp | string | Decimal string of a Unix timestamp in seconds, not milliseconds |
sig | string | Standard Base64 of the RS256 signature bytes. It is not part of the signing string |
The first six fields are signed. Together with sig there are seven fields. Do not send the public key used for verification.
WorkBuddyMessage
| Field | Type | Description |
|---|---|---|
title | string | Share title, at most 50 characters |
description | string | Content description, at most 200 characters |
payload | TaskPayload object | The task payload currently available |
Serialize the whole message object first, then count the bytes of the raw UTF-8 JSON. The 16 KiB limit applies to the raw JSON, not to the URL length and not to the length of the Base64 string. If you embed media in data, those characters count toward the JSON byte size as well.
TaskPayload
| Field | Type | Description |
|---|---|---|
action | string | Currently start is supported |
promptContentBlocks | ContentBlock[] | An ordered array of content blocks. Supported types may be mixed |
connectorIds | string[] | When connectors must be specified, the list of connector identifiers in the message payload |
The specified connectors should already be published, and they should belong to the same organization as the share application. Whether the user has authorized still affects whether the resource can be read.
ContentBlock Types
type | Content | Known fields and types | Platform differences |
|---|---|---|---|
text | Text | text: string | Text content |
image | Image | data?: string (image Base64), uri?: string, mimeType?: string | Embedded data: supported on mobile, not supported on PC |
audio | Audio | data?: string (audio Base64), uri?: string, mimeType?: string | Embedded data: supported on mobile, not supported on PC |
resource | File resource | data?: string (file Base64), uri?: string, mimeType?: string | Embedded data: supported on mobile, not supported on PC |
resource_link | Resource link | name?: string, uri: string, _meta?: object | Confirm that the link is reachable and that any required connector authorization is in place |
A ? in the table only means a given source might omit that field. It is not a promise about field combinations or which fields are required. Whether WorkBuddy can read a resource path or link depends on what the target platform can access. A local file:// path that the third-party application can read is not necessarily readable by WorkBuddy. _meta may include preview fields such as og:title, og:image, and og:description. Field combinations, size limits, and the full per-platform support matrix follow the official SDK and protocol.
Text block example:
{"type":"text","text":"分析这个仓库"}
Resource link block example:
{"type":"resource_link","name":"产品文档","uri":"https://example.com/docs","_meta":{"og:title":"产品文档"}}
Signature Generation: Detailed Steps
The signature algorithm is RS256: RSA PKCS#1 v1.5 padding and a SHA-256 digest. Sign with the RSA-2048 private key (PKCS#8 PEM) paired with kid. Keep and use the private key on the developer's server.
- Build the message object. Fill in
title,description, andTaskPayload. For example, the text message in Quick Start. - Serialize the JSON. JSON-serialize the whole message object and take the exact UTF-8 byte sequence. The raw JSON must not exceed 16,384 bytes. Do not serialize or modify the message again between signing and sending, or the bytes may change.
- Produce
message. Apply one standard Base64 encoding to the UTF-8 bytes from step 2. Keep+,/, and any required=padding. Use that value as-is when signing. Do not Base64-encodemessagea second time. - Prepare the other fields. Read
appIdandkid, and setscenetonewTask. Use a cryptographically secure random generator to produce 16 bytes, and convert them to a 32-character lowercase hexadecimalnonce. Produce the Unix-seconds stringtimestampfor this request. - Encode the plain field values separately. Apply standard Base64 to the UTF-8 bytes of each of
appId,kid,nonce,scene, andtimestamp. Encode only the values. Do not encode=,&, or the parameter names. - Build the signing string. Join the fields in ASCII order of the key names,
appId → kid → message → nonce → scene → timestamp. Parameter names are case-sensitive. Put a single&between items, and do not add a trailing space or newline:
appId=Base64(appId)&kid=Base64(kid)&message=message&nonce=Base64(nonce)&scene=Base64(scene)×tamp=Base64(timestamp)
- Produce
sig. RS256-sign the UTF-8 bytes of the signing string from step 6, then apply standard Base64 to the signature bytes.sigis not included in the signing string it belongs to. - Build the transport link. Pass the six raw transport field values and
sigtoURLSearchParamsas seven query parameters. The URL carries the raw values such asappIdandkid, not theBase64(appId)andBase64(kid)used inside the signing string. - Check validity and retries. Require
-30 ≤ platform current time − timestamp ≤ 300, in seconds. A retry of the same share keeps the original packet. After a new share, or after the packet expires, generatenonce,timestamp, andsigagain. The sameappId + noncemay pass in-app verification at most 3 times.
When a signature fails, first compare the exact signing string both sides used: field order, case, Base64 padding, whether message was encoded twice, and whether a newline was mixed in. Then check that kid matches the private key. Do not put the private key, or a complete real share link, into a support ticket.
Sharing Resources and Connectors
Before sharing an image, audio, a file, or a link, confirm that the target platform supports that content form, and that WorkBuddy can read the referenced resource. Remote resource links should stay valid. A local file URI works only when the target platform can access it. On PC, do not rely on embedding an image, audio, or file directly in the message through data.
When a connector is required, put the connectors published under the application's organization in TaskPayload.connectorIds. If the user has not authorized, the resource cannot be accessed, or the content does not pass review, the share may not be prefilled. Let the user adjust the content and share again.
Error Handling and Launch Checklist
| Symptom | Check first | What to do |
|---|---|---|
| The client cannot be launched | Whether WorkBuddy is installed and is 5.8.0 or later, and whether the HTTPS interstitial link and its parameters are correct | Check that the interstitial page opens, and confirm the client is installed and updated |
| The application is unavailable | Whether the application has been reviewed and enabled | Check the application status on the Open Platform |
| The endpoint is unavailable or the identity does not match | PC registration, package name, Bundle ID, and signature information | Complete the endpoint registration, and compare the test build with the release build |
| Signature verification fails | Whether kid matches the private key, field order, Base64 versus URL encoding, and whether timestamp is used | Rebuild the signing string step by step following Signature Generation: Detailed Steps |
| The request is expired or repeated | Server clock, seconds versus milliseconds, and whether nonce was regenerated for a new share | Sync the clock, and sign again according to the retry rules |
| A resource or connector is unavailable | Resource URL lifetime, whether the target platform can access it, the connector's organization, and user authorization | Fix resource access, then share again |
| Content was not prefilled | Raw JSON byte size, content block type, whether the resource is readable, and the content review result | Start with a minimal text-only message to rule out a resource problem |
Before launch, verify at least: a plain-text share through the PC HTTPS interstitial page, the client not installed, a wrong private key, an expired request, a repeated request, an identity mismatch, and an unreachable resource.
