アプリのアップロード
POST
https://deploygate.com/api/users/{OWNER_NAME}/apps
テストサーバや自作ツールから簡単に自動アップロードできます。
distribution_key と distribution_name を同時に指定したときの挙動
distribution_key が優先されます。指定された distribution_key に対応する配布ページが存在しないとき、API は 404 エラーを返します。
ワークスペース(Flexible/Enterpriseプラン)へのアップロード
ワークスペース配下のグループにアプリをアップロードすることになります。
${API_TOKEN}
にはグループにオーナーもしくは開発者として追加されたユーザーのAPI Keyをご利用ください。
${OWNER_NAME}
にはアップロード先のグループ名を指定してください。
Path Params
Name | Type | Required | Description |
---|---|---|---|
OWNER_NAME | string | true | ユーザー名もしくはグループ名 |
Form Data
Name | Type | Required | Description |
---|---|---|---|
file | file | true | アプリケーションのバイナリファイル(IPA/APK) |
message | string | false | アップロードするファイ ルの説明 |
distribution_key | string | false | 配布ページのハッシュ (配布ページURLの /distributions/xxxx の xxxx 部分) を指定するとその配布ページも同時に更新します。 |
distribution_name | string | false | 更新する配布ページを名前で指定できます。存在しない場合は新しい配布ページが作成されます。Gitのブランチ名ごとに配布ページを作るなどの使い方が可能です。 |
release_note | string | false | 配布ページアプリ更新時に付与するメッセージ。 |
disable_notify | string | false | (iOSのみ) 値に yes を設定するとPush時のメール通知を無効にします |
Example
curl \
--url "https://deploygate.com/api/users/${OWNER_NAME}/apps" \
-H "Authorization: Bearer ${API_TOKEN}" \
-X POST \
-F "file=@sample.apk" \
--form-string "message=sample"
配布ページも更新
curl \
--url "https://deploygate.com/api/users/${OWNER_NAME}/apps" \
-H "Authorization: Bearer ${API_TOKEN}" \
-X POST \
-F "file=@sample.apk" \
--form-string "message=sample" \
--form-string "distribution_key=abcd1234" \
--form-string "release_note=new build"
Gitブランチごとに配布
curl \
--url "https://deploygate.com/api/users/${OWNER_NAME}/apps" \
-H "Authorization: Bearer ${API_TOKEN}" \
-X POST \
-F "file=@sample.apk" \
--form-string "message=git:${GIT_HASH}" \
--form-string "distribution_name=${GIT_BRANCH}" \
--form-string "release_note=new build"
Result 200
{
"error":false,
"results":{
"name":"DeployGate",
"package_name":"com.deploygate",
"secret":"1234567890abcdef1234567890abcdef12345678",
"os_name":"Android",
"path":"/users/_your_name_/apps/com.deploygate",
"revision":1,
"version_code":"36",
"version_name":"1.6.0",
"sdk_version":"7",
"target_sdk_version":23,
"signature":"1234567890abcdef1234567890abcdef12345678",
"message":"sample",
"file":"https://example.com/path/to/file",
"md5":"1234567890abcdef1234567890abcdef",
"icon":"https://example.com/path/to/icon",
"user": {
"name": "${OWNER_NAME}"
}
}
}
Result 400
{
"error": true,
"message": "application create error: cannot detect the package.",
"because": "application create error: cannot detect the package."
}