上传 App
通过蒲公英 API 1.0 上传 App 的旧版接口说明。
本页为 API 1.0 旧版接口,仅供历史项目维护参考。新接入项目请优先使用 API 2.0 上传与发布。
上传 App
通过该接口,您可以直接上传 App 到蒲公英。上传时,请使用 HTTP POST 方式,其中 enctype 为 "multipart/form-data"
POST
https://upload.pgyer.com/apiv1/app/upload请求参数
| 参数 | 类型 | 说明 |
|---|---|---|
| uKey | String | 必填,用户 Key |
| _api_key | String | 必填,API Key |
| file | File | 必填,需要上传的 ipa 或 apk 文件 |
| installType | Integer | 选填,应用安装方式,值为(1、2、3)。1:公开,2:密码安装,3:邀请安装。默认为 1 公开 |
| password | String | 选填,设置 App 安装密码,如果不想设置密码,请传空字符串,或不传。 |
| updateDescription | String | 选填,版本更新描述,请传空字符串,或不传。 |
| channelShortcut | String | 选填,所需更新的指定渠道的下载短链接,只可指定一个渠道,字符串型,如:abcd。 |
返回数据
| 参数 | 类型 | 说明 |
|---|---|---|
| appKey | String | App Key |
| userKey | String | User Key |
| appType | Integer | 应用类型(1:iOS;2:Android) |
| appIsFirst | Integer | 是否是第一个 App(1:是;2:否) |
| appIsLastest | Integer | 是否是最新版(1:是;2:否) |
| appFileSize | Integer | App 文件大小 |
| appName | String | 应用名称 |
| appVersion | String | 版本号 |
| appVersionNo | Integer | 适用于 Android 的版本编号,iOS 始终为 0 |
| appBuildVersion | Integer | 蒲公英生成的用于区分历史版本的 build 号 |
| appIdentifier | String | 应用程序包名,iOS 为 Bundle ID,Android 为包名 |
| appIcon | String | 应用的 Icon 图标 Key,访问地址为 https://www.pgyer.com/image/view/app_icons/[应用的 Icon 图标 Key] |
| appDescription | String | 应用介绍 |
| appUpdateDescription | String | 应用更新说明 |
| appScreenShots | String | 应用截图 Key,获取地址为 https://www.pgyer.com/image/view/app_screenshots/[应用截图 Key] |
| appShortcutUrl | String | 应用短链接 |
| appQRCodeURL | String | 应用二维码地址 |
| appCreated | String | 应用上传时间 |
| appUpdated | String | 应用更新时间 |
上传 App 示例
使用 Linux 下的 curl 命令上传 App 示例:
curl -F "file=@/tmp/example.ipa" -F "uKey=YOUR_UKEY" -F "_api_key=YOUR_API_KEY" https://upload.pgyer.com/apiv1/app/upload请根据您的账号,将其中的 uKey 和 _api_key 的值替换为相应的值。