API
1. Obtain upload context ID
Request
POST /api/v1/projects/{projectName}/build-uploads
Response
JSON body with parameters:
id(required) – integer upload contextId to use in next stepsdateCreated(required) – creation date in ISO 8601 format
Example:
{
"id": 28,
"dateCreated": "2024-03-07T16:55:49.168Z"
}
2. Submit build metadata and obtain upload URL
Call this endpoint when your build file is ready.
Request
POST /api/v1/projects/{projectName}/builds
JSON body with parameters:
contextId(required) – upload context ID obtained in step 1buildType(required) – possible values are:APKorINSTRUMENTED_APKbuildFileName(required) – file name, e.g.app-play-release.apkname– arbitrary name to distinguish the build, e.g.release-5.2.8description– arbitrary build descriptionsourceControlId– VCS commit, e.g. git commit hashsourceControlIsoTimestamp– VCS commit timestamp in ISO 8601 format. To retrieve the timestamp in Git, you can use the following shell command:git show -s --format='%cI' <commit-hash>
Example:
{
"contextId": "28",
"buildType": "APK",
"buildFileName": "app-play-release.apk",
"name": "v5.2.8",
"description": "Arbitrary description",
"sourceControlId": "e3c0fedc625094db1cbb2823fd425b51ddc0932e",
"sourceControlIsoTimestamp": "2024-03-07T14:55:43.540Z"
}
Response
JSON body with parameters:
uploadSpec(required) – metadata to upload build to a storagemethod(required) – HTTP methodurl(required) – URLheaders(required) – map of HTTP headers
build(required) – build metadataid(required) – build ID numbercontextId(required) – upload context ID obtained in step 1buildType(required) – possible values are:APKorINSTRUMENTED_APKbuildFileName(required) – file name, e.g.app-play-release.apkname– arbitrary name to distinguish the build, e.g.release-5.2.8description– arbitrary build descriptionsourceControlId– VCS commit, e.g. git commit hashsourceControlIsoTimestamp– VCS commit timestamp in ISO 8601 formatuploadState–UPLOADINGorFINISHEDorFAILEDdateCreated– build creation timestamp
Example:
{
"uploadSpec": {
"method": "PUT",
"url": "https://storage.googleapis.com/some/path?someParams=someValue",
"headers": {
"Content-Type": "application/octet-stream",
"X-Goog-Content-Length-Range": "0,1073741824"
}
},
"build": {
"id": 70,
"contextId": 28,
"buildType": "APK",
"buildFileName": "app-play-release.apk",
"name": "v5.2.8",
"description": "Arbitrary description",
"sourceControlId": "e3c0fedc625094db1cbb2823fd425b51ddc0932e",
"sourceControlIsoTimestamp": "2024-03-07T14:55:43.540Z",
"dateCreated": "2024-03-08T14:13:33.143Z",
"uploadState": "UPLOADING"
}
}
3. Upload file to the obtained URL
Use uploadSpec object from the previous response to upload a file as application/octet-stream.
{uploadSpec.method} {uploadSpec.url}
{uploadSpec.hearder1}: {uploadSpec.header1Value}
{uploadSpec.hearder2}: {uploadSpec.header2Value}
Content-Length: {YOUR_FILE_LENGTH}
{YOUR_FILE_BINARY_DATA}