接口地址
POST https://openapi.baidu.com/rest/2.0/smartapp/package/upload access_token=ACCESS_TOKEN
參數說明
參數名 類型 是否必須 描述
access_token string 是 授權小程序的接口調用憑據
template_id long 是 代碼庫中的代碼模版ID
ext_json string 是 第三方自定義的配置
user_version string 是 代碼版本號,開發者可自定義。
user_desc string 是 代碼描述,開發者可自定義。
返回值示例
{
“errno”: 0,
“msg”: “success”,
“data”:null
}
錯誤情況下:
字段名 類型 描述
errno int 錯誤碼
msg string 錯誤描述信息,用來幫助理解和解決發生的錯誤。
ext_json需為string類型,格式示例如下 :
{
“extEnable”:true,
“extAppid”:”100000282″,
“directCommit”:false,
“ext”:{
“name”:”helloword”,
“attr”:{
“host”:”open.baidu.com”,
“users”:[
“user_1”,
“user_2”
]
}
},
“extPages”:{
“pages/api/api”:{
“navigationBarTitleText”:”小程序接口能力展示open”
}
},
“window”:{
“backgroundTextStyle”:”light”,
“navigationBarBackgroundColor”:”#fff”,
“navigationBarTitleText”:”Demo”,
“navigationBarTextStyle”:”black”
},
“tabBar”:{
“list”:[
{
“iconPath”:”images/component_normal.png”,
“pagePath”:”pages/index”,
“text”:”首頁open”
},
{
“pagePath”:”pages/component/component”,
“iconPath”:”images/component_normal.png”,
“selectedIconPath”:”images/component_selected.png”,
“text”:”組件open”
}
]
},
“networkTimeout”:{
“request”:20000,
“downloadFile”:20000
}
}
說明
為了便于第三方平臺使用同一個小程序模版為不同的小程序提供服務,第三方可以將自定義信息放置在ext_json中。
這個接口調用成功后會有一段延遲生效時間。<>