跳到主要内容
CNode

nodejs开发微信公众号

问答
Hhelloedmund发布于 10 年前最后回复 10 年前
1898460

各位有用nodejs开发过微信公众号吗?小弟我的是未认证的订阅号...通过接口生成自定义菜单时,报错40007,invalid media_id? 不知道是不是因为我的公众号未认证的原因

查看回复

回复 (18)

H
hdumok#1810 年前

没权限好像是报 api unauthorized

H
hdumok#1710 年前

应该是你在menu创建里media_id 但是id 对应的素材你是没有的 素材是要上传的才有id 官方文档里那个id 是乱填只是个说明

C
chux0519#1610 年前
引用 chux0519最近也在搞公众号,个人类未认证的订阅号确实是没有自定义菜单权限的。

@chux0519 另外,使用koa2的同学们可以看看,我把接入部分注册成koa2的中间件了koa2wechat

C
chux0519#1510 年前

最近也在搞公众号,个人类未认证的订阅号确实是没有自定义菜单权限的。

W
woodbon#1410 年前

mark 自豪地采用 CNodeJS ionic

Y
yakczh#1310 年前

有没有微信支付的指南?

Z
zhangzeyang#1110 年前

没开发过,不过有这个意向。学习学习 From Noder

W
welchwsy#1010 年前

没有权限,正解

T
tomoya92#910 年前

未认证的公众号没有菜单权限,想折腾可以申请一个测试账号,绝大部分功能都有

来自酷炫的 CNodeMD

J
jiangli373#810 年前

给看下你的menu结构呢

H
helloedmund#610 年前

不知道为啥,贴点代码总是会报错,算了,还是截图: 2.png 3.png

H
helloedmund#510 年前
引用 i5tinghttps://github.com/i5ting/wechat dev with nodejs 自己找吧

@i5ting

wechatApi.createMenu(menu).then(function(msg) { console.log(msg) }) Wechat.prototype.createMenu = function(menu) { var that = this return new Promise(function(resolve, reject) { that .fetchAccessToken() .then(function(data) { var url = api.menu.create + 'access_token=' + data.access_token request({method: 'POST', url: url, body: menu, json: true}).then(function(response) { var _data = response.body if (_data) { console.log(_data + "create test") resolve(_data) } else { throw new Error('Create menu fails') } }) .catch(function(err) { reject(err) }) }) }) } 的error message 是 invalid media_id, err code : 40007 后来查询了微信文档 1.png 发现是不是未认证的订阅号没有权限啊,只是不明白为什么会报media_id 的错

H
helloedmund#410 年前
引用 haozxuan是因为你的多媒体id无效;

@haozxuan

wechatApi.createMenu(menu).then(function(msg) { console.log(msg) }) Wechat.prototype.createMenu = function(menu) { var that = this return new Promise(function(resolve, reject) { that .fetchAccessToken() .then(function(data) { var url = api.menu.create + 'access_token=' + data.access_token request({method: 'POST', url: url, body: menu, json: true}).then(function(response) { var _data = response.body if (_data) { console.log(_data + "create test") resolve(_data) } else { throw new Error('Create menu fails') } }) .catch(function(err) { reject(err) }) }) }) }

的error message 是 invalid media_id, err code : 40007 后来查询了微信文档 1.png 发现是不是未认证的订阅号没有权限啊,只是不明白为什么会报media_id 的错

H
helloedmund#310 年前
引用 haozxuan是因为你的多媒体id无效;

@haozxuan 我并没有添加多媒体啊,只是用json来生成自定义菜单

H
haozxuan#210 年前

是因为你的多媒体id无效;

I
i5ting#110 年前

参与回复

登录后即可参与回复。登录