メインコンテンツまでスキップ

アプリのアップロード

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

NameTypeRequiredDescription
OWNER_NAMEstringtrueユーザー名もしくはグループ名

Form Data

NameTypeRequiredDescription
filefiletrueアプリケーションのバイナリファイル(IPA/APK)
messagestringfalseアップロードするファイルの説明
distribution_keystringfalse配布ページのハッシュ (配布ページURLの /distributions/xxxx の xxxx 部分) を指定するとその配布ページも同時に更新します。
distribution_namestringfalse更新する配布ページを名前で指定できます。存在しない場合は新しい配布ページが作成されます。Gitのブランチ名ごとに配布ページを作るなどの使い方が可能です。
release_notestringfalse配布ページアプリ更新時に付与するメッセージ。
disable_notifystringfalse(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",
"labels":{ /* obsoleted field. this may be deleted in near future. */ },
"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://xxx",
"md5":"1234567890abcdef1234567890abcdef",
"icon":"https://yyy",
"user":{
"id":1,
"name":"_your_name_",
"profile_icon":"https://zzz"
}
}
}

Result 400

{
"error": true,
"message": "application create error: cannot detect the package.",
"because": "application create error: cannot detect the package."
}