微信小程序二维码B接口报错
发布于 5 年前 作者 vmeng 10223 次浏览 来自 问答

使用B接口:https://api.weixin.qq.com/wxa/getwxacodeunlimit 生成小程序二维码报错:{“errcode”:40169,“errmsg”:“invalid length for scene, or the data is not json string hint: [s0142b451]”}

请问scene参数怎么传,能否在url中传递,比如:https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=123&scene=3211

有java请求微信小程序二维码的demo代码?

5 回复

请问,批量生成20二维码总是会前面10个左右成功,后面几个报错{“errcode”:40169,“errmsg”:"invalid length for scene, or the data is not json string hint}是什么原因?前面成功肯定参数肯定没问题,再往后就失败,是不是小程序后台服务器有做反爬机制?

  1. B接口是一个post接口,access_token放在url中,其他的page,width,scence都放在body中,scence按文档要求来。

  2. access_token用你的app_id和app_secret去获取。

  3. 生成的二维码在开发者工具上是可以调试的,在工具编译配置里选择自定义编译条件,然后设置扫码的场景。

    在postman里多试几遍,肯定会成功的。

你好,请确认scene长度符合要求,另外,参数是否已经转成json字符串呢?

j请问在Java这些参数怎样带过去

开发工具上生成不了,要看真机测试

回到顶部