Objects: get

Retrieves object metadata. When alt=media is included as a query parameter, retrieves object data. Try it now.

The authenticated user must have sufficient permission to use this method.

To download an object encrypted by a customer-supplied encryption key, or to get object metadata with content hashes, use the headers listed on the Encryption page in your request. Getting object metadata without such headers omits the content hashes in the response.

For examples of performing object downloads with different Cloud Storage tools and client libraries, see the Downloading Objects guide.

Request

HTTP request

GET https://www.googleapis.com/storage/v1/b/bucket/o/object

Parameters

Parameter name Value Description
Path parameters
bucket string Name of the bucket in which the object resides.
object string Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.
Optional query parameters
alt string Type of data to return. Defaults to json.

Acceptable values are:

  • json: Return object metadata.
  • media: Return object data.
generation long If present, selects a specific revision of this object (as opposed to the latest version, the default).
ifGenerationMatch long Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
ifGenerationNotMatch long Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
ifMetagenerationMatch long Makes the operation conditional on whether the object's current metageneration matches the given value.
ifMetagenerationNotMatch long Makes the operation conditional on whether the object's current metageneration does not match the given value.
projection string Set of properties to return. Defaults to noAcl.

Acceptable values are:
  • "full": Include all properties.
  • "noAcl": Omit the owner, acl property.
userProject string The project to be billed for this request. Required for Requester Pays buckets.

Request body

Do not supply a request body with this method.

Response

By default, this responds with an object resource in the response body. If you provide the URL parameter alt=media, then it will respond with the object data in the response body.

Try it!

Use the APIs Explorer below to call this method on live data and see the response.

Bu sayfayı yararlı buldunuz mu? Lütfen görüşünüzü bildirin:

Şunun hakkında geri bildirim gönderin...

Yardım mı gerekiyor? Destek sayfamızı ziyaret edin.