Skip to content

Commit 1f66b80

Browse files
committed
fix: broken link
1 parent 6d8bde0 commit 1f66b80

File tree

3 files changed

+43
-62
lines changed

3 files changed

+43
-62
lines changed

docsearch.config.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
{
22
"index_name": "rentsoft",
33
"start_urls": [
4-
"https:/doc.rentsoft.cn/",
4+
"https:/docs.openim.io/",
55
{
6-
"url": "https:/doc.rentsoft.cn/guides/introduction",
6+
"url": "https:/docs.openim.io/guides/introduction",
77
"tags": "guides",
88
"selectors_key": "guides"
99
},
1010
{
11-
"url": "https://doc.rentsoft.cn/restapi/introduction",
11+
"url": "https://docs.openim.io/restapi/apis/introduction",
1212
"tags": "restapi",
1313
"selectors_key": "restapi"
1414
},
1515
{
16-
"url": "https:/doc.rentsoft.cn/sdks/introduction",
16+
"url": "https:/docs.openim.io/sdks/introduction",
1717
"tags": "sdks",
1818
"selectors_key": "sdks"
1919
}
2020
],
21-
"sitemap_urls": ["https://doc.rentsoft.cn/sitemap.xml"],
21+
"sitemap_urls": ["https://docs.openim.io/sitemap.xml"],
2222
"sitemap_alternate_links": true,
2323
"stop_urls": ["/tests"],
2424
"selectors": {
Lines changed: 36 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,55 @@
11
---
2-
title: Callback After Single Chat Message Recall
2+
sidebar_position: 1
3+
title: Callback Description
34
hide_title: true
45
---
56

6-
# Callback After Single Chat Message Recall
7+
# 📞 Callback Description
78

8-
## Description
9-
The App backend can use this callback to receive requests for recalling a user's single chat message.
9+
📢 **OpenIM** offers powerful callback functionalities. When a specific event happens before or after a process, OpenIMServer proactively sends an HTTP/HTTPS request to the APP’s business server. This allows the APP’s business server to intervene in the subsequent processing of that event or to perform data synchronization based on the callback.
1010

11-
## Important Notes
12-
- To enable this callback, configure the callback URL and activate the corresponding protocol switch. For configuration details, see the [Callback Introduction](../introduction) document.
13-
- The callback direction is from OpenIMServer to the App backend as an HTTP/HTTPS POST request.
14-
- The App backend must respond to this request within the specified timeout.
11+
## 📑 Callback Classification
1512

16-
## Scenarios that Trigger This Callback
17-
- An App user recalls a single chat message through the client.
18-
- An administrator recalls a single chat message through the `admin_msgwithdraw` REST API.
13+
Callbacks are divided into two main types based on the timing of their processing:
1914

20-
## Timing of Callback
21-
- After the single chat message has been successfully recalled.
15+
• 🚫 **Callbacks Before the Event Occurs**: These “before” type callbacks allow the APP’s business server to intervene in the event handling process. For example, you can implement sensitive word filtering for messages. OpenIMServer determines subsequent steps based on the callback response.
16+
• 📤 **Notifications After the Event Occurs**: These “after” type callbacks are mainly used to notify the APP’s business server for data synchronization. For example, when a user joins a group. In this case, OpenIMServer ignores the callback’s return values and error codes.
2217

23-
## Interface Description
18+
## ⚙️ Configuration Description
2419

25-
### Example Request URL
26-
The `CallbackCommand` here is: `callbackBeforeAfterMsgCommand`
27-
28-
```plaintext
29-
{WEBHOOK_ADDRESS}/callbackBeforeAfterMsgCommand?contenttype=json
30-
```
31-
32-
### Example Request Package
33-
```json
34-
{
35-
"callbackCommand": "callbackBeforeAfterMsgCommand",
36-
"conversationID": "si_u1_u2:0",
37-
"seq": 10,
38-
"userID": "user456"
39-
}
20+
```yaml
21+
url: http://127.0.0.1:10006/callbackExample
22+
beforeSendSingleMsg:
23+
enable: false
24+
timeout: 5
25+
failedContinue: true
4026
```
4127
42-
### Request Package Field Descriptions
28+
• url: The APP business server callback address, supports HTTP/HTTPS
29+
• enable: Whether to enable the callback, true for enable
30+
• timeout: Response timeout in seconds
31+
• failedContinue: Whether to continue the process if the callback times out or if the API fails. Generally effective for before type callbacks. true means to continue execution.
4332
44-
| Field | Type | Description |
45-
|------------------|--------|-----------------------------------------------|
46-
| callbackCommand | string | Callback command for recalling a single chat message |
47-
| conversationID | string | Conversation ID |
48-
| seq | string | Message sequence number |
49-
| userID | string | User ID of the message sender |
33+
## 🔄 Callback Protocol
5034
51-
## Example Response Package
35+
**OpenIMServer** uses a third-party callback mechanism based on HTTP/HTTPS protocol. When initiating a callback request, OpenIMServer sends a POST request to notify the APP’s business server. The specifics of these requests are directly included in the request body.
5236
53-
### Success Response
54-
The backend confirms successful processing of the recall request.
37+
### Sample Request URL
5538
56-
```json
57-
{
58-
"actionCode": 0,
59-
"errCode": 0,
60-
"errMsg": "",
61-
"errDlt": "",
62-
"nextCode": 0
63-
}
39+
```plaintext
40+
{WEBHOOK_ADDRESS}/callbackCommand?contenttype=json
6441
```
6542

66-
## Response Package Field Descriptions
43+
### Request Parameter Description
44+
45+
|Parameter | Description |
46+
|-----------------|------------------------------------------------------------|
47+
|{WEBHOOK_ADDRESS} | The url field in webhooks.yml, domain or hostname, for example: http://127.0.0.1:10006/callbackExample|
48+
|callbackCommand | The callback command, refer to each callback method’s description for details|
49+
|contenttype | The request input type, json|
50+
51+
### Header
6752

68-
| Field | Value | Description |
69-
|---------------|-------------------------------|-------------------------------------------------------|
70-
| actionCode | 0 | Indicates whether the callback was successfully executed. `0` means success. |
71-
| errCode | 0 | Custom error code; `0` to ignore the callback result. |
72-
| errMsg | "An error message" | Simple error message for the custom error code |
73-
| errDlt | "Detailed error information" | Detailed error message |
74-
| nextCode | 1 | Next step directive, `1` to halt further action if `actionCode` is `0` |
53+
|Header Name |Example Value| Required |Type |Description|
54+
|-----------------|-----------------|-----------------|-----------------|-----------------|
55+
|operationID| 123456| Yes |string| Used for global link tracking, recommended to use timestamps, unique in each request|

src/components/homepage/APIReferenceSection.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function APIReferenceSection() {
1414
</Head>
1515
<div className="relative mx-auto flex w-full max-w-7xl flex-col items-center gap-10 rounded-2xl bg-gradient-to-r from-black to-zinc-800 px-6 py-20 text-center text-white dark:from-zinc-100 dark:to-white dark:text-black lg:flex-row lg:p-20 lg:text-left">
1616
<Link
17-
href="/restapi/introduction"
17+
href="/restapi/apis/introduction"
1818
aria-label="API Reference"
1919
target="_blank"
2020
className="absolute top-8 right-8 flex h-16 w-16 items-center justify-center rounded-full bg-zinc-600/40 dark:bg-transparent"
@@ -34,7 +34,7 @@ export default function APIReferenceSection() {
3434
</Translate>
3535
</p>
3636
<Link
37-
href="/restapi/introduction"
37+
href="/restapi/apis/introduction"
3838
className="font-medium text-primary-100 dark:text-primary"
3939
>
4040
<Translate id="homepage.apiSection.getStarted">

0 commit comments

Comments
 (0)