云函数发送订阅消息报错501007?
发布于 7 年前 作者 zoumin 7482 次浏览 来自 问答

{“errorCode”:1,“errorMessage”:“user code exception caught”,“stackTrace”:“Error: errCode: -501007 invalid parameters | errMsg: templateMessage.send:fail Invalid request param\n at callGeneralOpenAPI (/var/user/node_modules/wx-server-sdk/index.js:422:19)\n at process._tickCallback (internal/process/next_tick.js:68:7)”,“statusCode”:430}

config里面也设置了:

  "permissions": {

    "openapi": [

      "templateMessage.send"

    ]

  }

package里改为最新版本:

  "dependencies": {

    "wx-server-sdk": "latest"

  }

云函数就一句话都错(参数填不填都一样):

const result = await cloud.openapi.templateMessage.send({})

是哪里没有配置好吗?还是开发工具测试不了?

真机调试也报错:

Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID , cloud function service error code -504002, error message Error: errCode: 45103  | errMsg: openapi.templateMessage.send:fail This API has been unsupported rid: 5fec4149-44c7f7be-2f6b6ca8

    at callWXOpenAPI (:28408/var/user/node_modules/wx-server-sdk/index.js:2378)

    at process._tickCallback (:28408/remote-debug/internal/process/next_tick.js:68) (callid 1609318729244-0.96096835906173); at cloud.callFunction api; 

    at new g (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:1220821)

    at c (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:1221328)

    at I (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:1221419)

    at e (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:1393747)

    at eval (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:66297)

    at eval (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:66406)

    at A (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:68857)

    at A.exports (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:27577)

    at E.<computed> (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:32976)

    at Number.n (eval at n.call.document (runtime.js?devtools_ignore=true:1), <anonymous>:2:32679)

回到顶部