快推365SEO问答正文

第三方接入为授权的百度智能小程序帐号如何上传小程序代码的接口地址和参数说明

2020/12/16 13:32:56

1105浏览量

回答

2020/12/16 13:35:13

接口地址


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中。

这个接口调用成功后会有一段延迟生效时间。<>




此教程来源于《搜外网-夫唯SEO培训》,网址:https://www.seowhy.com/

本教程连接:https://www.seowhy.com/a/834.html,为原创表示感谢!


0+1

0+1