This API should be called on the server side and cannot be called directly on the client side (Mini Program, web page, APP, etc.). For details, please refer to API Call Guide.
API English Name: getRidInfo
This interface is used to query the detailed information of an RID returned due to an error when calling a server-side interface, helping developers efficiently locate issues.
The account types that can use this interface include: Official Accounts, Service Accounts, Mini Programs, Mini Games, WeChat Stores, Shopping Assistants, Video Account Assistants, Alliance Shopping Agencies, Mobile Applications, Web Applications, Multi-platform Applications, and Third-party Platforms.
1. Call Method
HTTPS Call
POST https://api.weixin.qq.com/cgi-bin/openapi/rid/get?access_token=ACCESS_TOKEN
Encryption Support: This API supports secondary encryption and signature for service communication, which can effectively prevent data tampering and leakage. View Details
Cloud Call
- This API does not support cloud call.
Third-party Call
-
This API supports third-party platforms to call using component_access_token, and also supports calling on behalf of Merchant call.
-
After the service provider obtains any permission set authorization, it can use authorizer_access_token to call on behalf of Merchant, for details please refer to Third-party Call documentation.
2. Request Parameters
Query Parameters Query String Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| access_token | string | Yes | API call credential, you can use access_token, component_access_token, authorizer_access_token |
Request Body Request Payload
| Parameter | Type | Required | Description |
|---|---|---|---|
| rid | string | Yes | The RID returned due to an error when calling the interface. |
3. Response Parameters
Response Body Response Payload
| Parameter | Type | Description |
|---|---|---|
| errcode | number | Return code. |
| errmsg | string | Error message. |
| request | object | Request details corresponding to the RID. |
Res.request Object Payload
Request details corresponding to the RID.
| Parameter | Type | Description |
|---|---|---|
| invoke_time | number | Timestamp when the request was initiated. |
| cost_in_ms | number | Millisecond-level request duration. |
| request_url | string | URL parameters of the request. |
| request_body | string | Request parameters for POST requests. |
| response_body | string | Parameters returned by the interface request. |
| client_ip | string | Client IP address of the interface request. |
4. Notes
-
Since querying RID information is a private developer action, it is only supported for queries using the same account. For example, if rid=1111 indicates an error occurred when Mini Program Account A called a certain interface, then Account A’s access_token must be used to query the details of rid=1111. Using another account’s credentials will result in an error with code xxx. The same applies to interfaces for Official Accounts and Third-party Platform accounts.
-
If a third-party service provider is querying the RID returned by an API on behalf of an Official Account, Service Account, Mini Program, Mini Game, WeChat Store, Shopping Assistant, or Video Account Assistant, then the authorizer_access_token of the same account should be used for the query.
-
The validity period of a RID is only 7 days, meaning only RIDs from the past 7 days can be queried. Querying RIDs older than 7 days will result in an error with code 76001.
-
Interfaces of the format “/xxx/sns/xxx” do not support this query and will result in an error with code 76022.
5. Code Example
Request Example
{
"rid": "61725984-6126f6f9-040f19c4"
}
Response Example
{
"errcode": 0,
"errmsg": "ok",
"request": {
"invoke_time": 1635156704,
"cost_in_ms": 30,
"request_url": "access_token=50_Im7xxxx",
"request_body": "",
"response_body": "{\"errcode\":45009,\"errmsg\":\"reach max api daily quota limit rid: 617682e0-09059ac5-34a8e2ea\"}",
"client_ip": "113.xx.70.51"
}
}
6. Error Codes
The following is the error code list of this API, other error codes can refer to Common Error Codes; When encountering errors in calling the API, you can use the official API Diagnostic Tool to assist in locating and analyzing problems.
| Error Code | Error Description | Solution |
|---|---|---|
| 0 | ok | ok |
| 76001 | rid not found | The RID does not exist. |
| 76002 | rid is error | The RID is empty or has an invalid format. |
| 76003 | could not query this rid,no permission | The current account does not have permission to query this RID; it was generated by another account’s call. |
| 76004 | rid time is error | The RID has expired. Only RIDs within the last 7 days are supported. |
7. Applicable Scope
| Mini Program | Official Account | Service Account | Mini Game | WeChat Shop | Alliance Agency | Influencer | Shop Supplier | Third-party Platform | Mobile App | Website App | Channels Window | Multi-platform App |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | 〇 | ✔ | ✔ | ✔ | ✔ |
- ✔:This account type can call this API。
- 〇:Third-party platforms can use component_access_token to call. For calling on behalf of Merchant, please refer to the Call Method section。