开发者上传小程序代码参数问题
发布于 6 年前 作者 yonglu 1780 次浏览 来自 问答

代码管理

第三方平台在开发者工具上开发完成后,可点击上传,代码将上传到开放平台草稿箱中,第三方平台可选择将代码添加到代码中,获得代码模版ID后,可调用以下接口进行代码管理。

1、为授权的小程序帐号上传小程序代码

POST数据示例:

{
"template_id":0,
"ext_json":"JSON_STRING", //*ext_json需为string类型,请参考下面的格式*
"user_version":"V1.0",
"user_desc":"test",
}

参数说明:

参数说明
access_token请使用第三方平台获取到的该小程序授权的authorizer_access_token
template_id代码库中的代码模版ID
ext_json第三方自定义的配置
user_version代码版本号,开发者可自定义
user_desc代码描述,开发者可自定义

ext_json需为string类型,格式示例如下 :


{
   extAppid:"",
   ext:{
       "attr1":"value1",
       "attr2":"value2",
   },
   extPages:{
       "index":{
       },
       "search/index":{
       },
   },
   pages:["index","search/index"],
   "window":{
   },
   "networkTimeout":{
   },
   "tabBar":{
   },
}

想知道  ext_json的东西我在模板小程序里配置好了,参数中的字段有可选的吗?还是所有都必须,文档没写。

10 回复

可以了。

好的,谢谢!

ext_json: {}

这种方式呢?

是可选的 没用到的可以不写

我也碰到了这个问题

{"template_id":1,"ext_json":{"extAppid":"wx5c911ab0f6a70bXX"},"user_version":"3.3","user_desc":"test"}

这样传还是

"errcode":47001,"errmsg":"data format error hint: [Y94LMa06094529]"

请问您是怎么解决的 谢谢。

给一下错误的hint,我查一下日志

{

“user_version”:“v1.0”,

“user_desc”:“SCRM_TEST”,

“ext_json”:{“extAppid”:“wx26c46f8c8fde6xxx”},

“template_id”:1

}

这样的参数返回是这样的。

{“errcode”:47001,“errmsg”:“data format error hint: [abCMoA06694524]”}

你不用谢ext_json这个字段吧 既然是空干嘛要写

{“errcode”:85048,“errmsg”:“parse ext_json fail hint: [Uay_Oa05544529]”}

{

“user_version”:“v1.0”,

“user_desc”:“SCRM_TEST”,

“ext_json”:{

“directCommit”:false,

“extAppid”:“wx26c46f8c8fde6xxxx”,

“extEnable”:true

},

“template_id”:1

}

这样也试过

回到顶部