小程序直播间获取商品列表接口报错:{"errmsg":"status is invalid rid: 6047345d-1a0be26f-307b5fa7","errcode":200002}
请求获取直播间商品列表接口报错
传入参数
{"offset":1,"limit":30,"status":0}
报错
{"errmsg":"status is invalid rid: 604732c1-0578da70-6f8f056f","errcode":200002}
{"errmsg":"status is invalid rid: 604732d1-3f1e96b5-7f69dd4d","errcode":200002}
{"errmsg":"status is invalid rid: 60473359-00e9ff85-2f7f1d01","errcode":200002}
{"errmsg":"status is invalid rid: 6047338d-2e4eee45-23ddc44d","errcode":200002}
{"errmsg":"status is invalid rid: 6047339e-75636e92-4e46192c","errcode":200002}
{"errmsg":"status is invalid rid: 6047345d-1a0be26f-307b5fa7","errcode":200002}
解决方案
该API和小程序直播商品管理的其他API的入参方式不同。其他API是通过json格式入参,而这个API的参数需要写入url中
const GET_APPROVED_URL = 'https://api.weixin.qq.com/wxaapi/broadcast/goods/getapproved';
$url = self::GET_APPROVED_URL . '?access_token=' . $access_token . '&offset=' . $params['offset'] . '&limit=' . $params['limit'] . '&status=' . $params['status'];
再次请求返回正确数据