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: getSharedCode
This API is used to obtain the share QR code for a live room.
1. Call Method
HTTPS Call
GET https://api.weixin.qq.com/wxaapi/broadcast/room/getsharedcode?access_token=ACCESS_TOKEN
Cloud Call
-
Call Method: liveBroadcast.getSharedCode
-
Input and output parameters are the same as HTTPS call. For call method, please refer to Cloud Call documentation.
Third-party Call
-
This API supports third-party platforms on behalf of Merchant call.
-
The permission set ID of this API is: 52
-
After the service provider obtains one of the permission set authorizations, 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 | Example | Description |
|---|---|---|---|---|
| access_token | string | Yes | ACCESS_TOKEN | API call credential, you can use access_token, authorizer_access_token |
Request Body Request Payload
| Parameter | Type | Required | Description |
|---|---|---|---|
| roomId | number | Yes | Room ID |
| params | string | No | Custom parameters |
3. Response Parameters
Response Body Response Payload
| Parameter | Type | Description |
|---|---|---|
| errcode | number | Return code |
| cdnUrl | string | CDN URL of the share QR code |
| pagePath | string | Share path |
| posterUrl | string | URL of the share poster |
4. Notes
No special notes for this API
5. Code Example
Request Example
// URL query parameters { "roomId" : 6209, "params" : encodeURIComponent(JSON.stringify(custom_params)) }
Response Example
{ "cdnUrl": "http://mmbiz.qpic.cn/mmbiz_jpg/FVribAGdErI2jhO1hbzVDH1E5LW7VQ9D1SIvTLFmyYwkIUucJqE72icgAj6NYw92kbJRNV0zwnGZWaO0Y8T0vqlg/0", // Share QR code "pagePath": "plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=6209", // Share path "posterUrl": "http://mmbiz.qpic.cn/mmbiz_jpg/dlFudV139LtQn96YNHSGtVfcUkUwQaYeR5OiaJ6bPr7OZxy3yhIK3icjxop0QeRBiaDPiaxuzENtCj15zFIM8sh7ag/0", // Share poster "errcode": 0 }
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 |
|---|---|---|
| 1001 | Invalid request parameters. | |
| 40001 | invalid credential access_token isinvalid or not latest | The AppSecret is incorrect when obtaining the access_token, or the access_token is invalid. Please verify the correctness of the AppSecret, or check whether the API is being called for the correct Official Account. |
| 300022 | This room ID does not exist. | |
| 300023 | The room status is blocked (the current room status does not allow this operation). |
7. Applicable Scope
The callable account types for this API are not yet clear, or are determined by the calling parameters in business. Please refer to the actual calling situation.