API Description
This API is used by developers to switch on or off red packet campaigns in real time. Note that the red packet campaign switch only takes effect within the campaign validity period. If you're not sure the validity period, set a validity period as long as possible.
API Request Format
API request from server
HTTP request method: GET
URL:https://api.weixin.qq.com/shakearound/lottery/setlotteryswitch?access_token=ACCESSTOKEN&lottery_id=LOTTERYID&onoff=1
Request Parameters
Parameter | Type | Description |
---|---|---|
access_token | string | accesstoken, which is appended to the URL as a parameter. |
lottery_id | string | Red packet campaign ID, which should be same as the lottery_id from addlotteryinfo. |
onoff | int | Campaign switch. 0: off; 1: on. |
Response
Parameter | Type | Description |
---|---|---|
errcode | int | Error code. 0 indicates a successful request, and any value other than 0 indicates a failed request. For more information, see the list of error codes. |
errmsg | string | Error message |
Example
{
"errcode":0,
"errmsg":""
}