Get data from an object store layer
Note
Currently, the blob
service supports REST API versions v1
and v2
. Version v1
should be used to access versioned, index and stream (if the stream payload is larger than 1MB) layers. Version v2
should be used to access the object store layer. Always pick the proper API version from API Lookup to ensure you get back the correct API version response. For instructions, see the API Lookup Developer's Guide.
You can get data by requesting its object key
in blob
v2
REST APIs.
The typical flow for getting data consists of the following steps.
- Obtain an authorization token.
- Get API base URLs.
- Get data by key.
You can list the object keys
already stored in your layer. For more information, see List object keys from the object store layer.
Obtain an authorization token
Obtain an authorization token for your HTTP requests. For instructions, see the Identity & Access Management Guide.
Get API base URLs
Use the API Lookup service to get the API endpoints for the blob
v2
APIs for the catalog you want to get data from. For instructions, see the API Lookup Developer's Guide.
Get data by key
Use the object key
to retrieve data using the blob
API.
GET /<Base path for the blob API from the API Lookup Service>/layers/<Layer ID>/keys/<Object Key> HTTP/1.1
Host: <Hostname for the blob API from the API Lookup Service>
Authorization: Bearer <Authorization Token>
Cache-Control: no-cache
The response consists of the binary data that was uploaded most recently to the given object key
.
Note
We recommend that your application includes retry logic for handling HTTP 5xx errors. Use exponential backoff in the retry logic.
Get partial data by key
To resume download of a large response when there is a connection issue between the client and server or to fetch a specific slice of the blob, you can provide a Range
header as RFC 7233, for example Range: bytes=10-
.
GET /<Base path for the blob API from the API Lookup Service>/layers/<Layer ID>/keys/<Object Key> HTTP/1.1
Host: <Hostname for the blob API from the API Lookup Service>
Range: bytes=10-
Authorization: Bearer <Authorization Token>
Cache-Control: no-cache
The response includes only the byte slice you requested.