Method: media.download

Download file yang dilampirkan ke kasus.

Catatan: permintaan HTTP harus menambahkan "?alt=media" ke URL.

CONTOH:

{i>cURL<i}:

name="projects/some-project/cases/43594844/attachments/0674M00000WijAnZAJ"
curl \
  --header "Authorization: Bearer $(gcloud auth print-access-token)" \
  "https://cloudsupport.googleapis.com/v2/$name:download?alt=media"

Python:

import googleapiclient.discovery


apiVersion = "v2"
supportApiService = googleapiclient.discovery.build(
    serviceName="cloudsupport",
    version=apiVersion,
    discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={apiVersion}",
)
request = supportApiService.media().download(
    name="projects/some-project/cases/43595344/attachments/0684M00000Pw6pHQAR"
)
request.uri = request.uri.split("?")[0] + "?alt=media"
print(request.execute())

Permintaan HTTP

GET https://cloudsupport.googleapis.com/v2/{name=*/*/cases/*/attachments/*}:download

URL menggunakan sintaks gRPC Transcoding.

Parameter jalur

Parameter
name

string

Nama lampiran file yang akan didownload.

Isi permintaan

Isi permintaan harus kosong.

Isi respons

Jika berhasil, isi respons akan berisi instance Media.

Cakupan otorisasi

Memerlukan salah satu cakupan OAuth berikut:

  • https://www.googleapis.com/auth/cloudsupport
  • https://www.googleapis.com/auth/cloud-platform

Untuk informasi selengkapnya, lihat Ringkasan Autentikasi.