Method: media.upload
Stay organized with collections
Save and categorize content based on your preferences.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-13 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-13 UTC."],[[["\u003cp\u003eAnalyzes uploaded app bundles, returning a Report within a long-running Operation.\u003c/p\u003e\n"],["\u003cp\u003eSupports two upload methods: a regular POST with \u003ccode\u003eX-Goog-Upload-Protocol: raw\u003c/code\u003e for binary-only uploads, and a multipart POST with \u003ccode\u003eX-Goog-Upload-Protocol: multipart\u003c/code\u003e for uploads with metadata.\u003c/p\u003e\n"],["\u003cp\u003eRequires specifying the app resource name (\u003ccode\u003eaccounts/{account_id}/apps/{app_id}\u003c/code\u003e) in the URL path.\u003c/p\u003e\n"],["\u003cp\u003eOptionally accepts a \u003ccode\u003ecodeReferenceId\u003c/code\u003e in the request body to associate the upload with a specific code revision.\u003c/p\u003e\n"],["\u003cp\u003eRequires the \u003ccode\u003ehttps://www.googleapis.com/auth/checks\u003c/code\u003e OAuth scope for authorization.\u003c/p\u003e\n"]]],[],null,["# Method: media.upload\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [AppBinaryFileType](#AppBinaryFileType)\n- [Try it!](#try-it)\n\nAnalyzes the uploaded app bundle and returns a [google.longrunning.Operation](/checks/reference/rest/v1alpha/accounts.apps.operations#Operation) containing the generated [Report](/checks/reference/rest/v1alpha/accounts.apps.reports#Report).\n\n#### Example (upload only)\n\nSend a regular POST request with the header `X-Goog-Upload-Protocol: raw`. \n\n POST https://checks.googleapis.com/upload/v1alpha/{parent=accounts/*/apps/*}/reports:analyzeUpload HTTP/1.1\n X-Goog-Upload-Protocol: raw\n Content-Length: \u003cbinary size\u003e\n Content-Type: application/octet-stream\n\n \u003cbinary\u003e\n\n#### Example (upload with metadata)\n\nSend a multipart POST request where the first body part contains the metadata JSON and the second body part contains the binary upload. Include the header `X-Goog-Upload-Protocol: multipart`. \n\n POST https://checks.googleapis.com/upload/v1alpha/{parent=accounts/*/apps/*}/reports:analyzeUpload HTTP/1.1\n X-Goog-Upload-Protocol: multipart\n Content-Length: ?\n Content-Type: multipart/related; boundary=BOUNDARY\n\n --BOUNDARY\n Content-Type: application/json\n\n {\"codeReferenceId\":\"db5bcc20f94055fb5bc08cbb9b0e7a5530308786\"}\n --BOUNDARY\n\n \u003cbinary\u003e\n --BOUNDARY--\n\n\u003cbr /\u003e\n\n| **Note:** Metadata-only requests are not supported.\n\n\u003cbr /\u003e\n\n### HTTP request\n\n- Upload URI, for media upload requests: \n `POST https://checks.googleapis.com/upload/v1alpha/{parent=accounts/*/apps/*}/reports:analyzeUpload`\n- Metadata URI, for metadata-only requests: \n `POST https://checks.googleapis.com/v1alpha/{parent=accounts/*/apps/*}/reports:analyzeUpload`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|-------------------------------------------------------------------------------|\n| `parent` | `string` Required. Resource name of the app. Example: `accounts/123/apps/456` |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"codeReferenceId\": string, \"appBinaryFileType\": enum (/checks/reference/rest/v1alpha/media/upload#AppBinaryFileType) } ``` |\n\n| Fields ||\n|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `code``Reference``Id` | `string` Optional. Git commit hash or changelist number associated with the upload. |\n| `app``Binary``File``Type` | `enum (`[AppBinaryFileType](/checks/reference/rest/v1alpha/media/upload#AppBinaryFileType)`)` Optional. The type of the uploaded app binary. If not provided, the server assumes APK file for Android and IPA file for iOS. |\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/checks/reference/rest/v1alpha/accounts.apps.operations#Operation).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/checks`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).\n\nAppBinaryFileType\n-----------------\n\nThe type of the uploaded app binary.\n\n| Enums ||\n|------------------------------------|------------------------------|\n| `APP_BINARY_FILE_TYPE_UNSPECIFIED` | Not specified. |\n| `ANDROID_APK` | .apk file type. |\n| `ANDROID_AAB` | .aab (app bundle) file type. |\n| `IOS_IPA` | .ipa file type. |"]]