- HTTP request
- Request body
- Response body
- Authorization Scopes
- AsyncAnnotateFileRequest
- InputConfig
- GcsSource
- OutputConfig
- GcsDestination
- Try it!
Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the google.longrunning.Operations
interface. Operation.metadata
contains OperationMetadata
(metadata). Operation.response
contains AsyncBatchAnnotateFilesResponse
(results).
HTTP request
POST https://vision.googleapis.com/v1p2beta1/files:asyncBatchAnnotate
The URL uses Google API HTTP annotation syntax.
Request body
The request body contains data with the following structure:
JSON representation | |
---|---|
{
"requests": [
{
object( |
Fields | |
---|---|
requests[] |
Individual async file annotation requests for this batch. |
Response body
If successful, the response body contains data with the following structure:
This resource represents a long-running operation that is the result of a network API call.
JSON representation | |
---|---|
{ "name": string, "metadata": { "@type": string, field1: ..., ... }, "done": boolean, // Union field |
Fields | ||
---|---|---|
name |
The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the |
|
metadata |
Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. An object containing fields of an arbitrary type. An additional field |
|
done |
If the value is |
|
Union field result . The operation result, which can be either an error or a valid response . If done == false , neither error nor response is set. If done == true , exactly one of error or response is set. result can be only one of the following: |
||
error |
The error result of the operation in case of failure or cancellation. |
|
response |
The normal response of the operation in case of success. If the original method returns no data on success, such as An object containing fields of an arbitrary type. An additional field |
Authorization Scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/cloud-vision
For more information, see the Auth Guide.
AsyncAnnotateFileRequest
An offline file annotation request.
JSON representation | |
---|---|
{ "inputConfig": { object( |
Fields | |
---|---|
inputConfig |
Required. Information about the input file. |
features[] |
Required. Requested features. |
imageContext |
Additional context that may accompany the image(s) in the file. |
outputConfig |
Required. The desired output location and metadata (e.g. format). |
InputConfig
The desired input location and metadata.
JSON representation | |
---|---|
{
"gcsSource": {
object( |
Fields | |
---|---|
gcsSource |
The Google Cloud Storage location to read the input from. |
mimeType |
The type of the file. Currently only "application/pdf" and "image/tiff" are supported. Wildcards are not supported. |
GcsSource
The Google Cloud Storage location where the input will be read from.
JSON representation | |
---|---|
{ "uri": string } |
Fields | |
---|---|
uri |
Google Cloud Storage URI for the input file. This must only be a Google Cloud Storage object. Wildcards are not currently supported. |
OutputConfig
The desired output location and metadata.
JSON representation | |
---|---|
{
"gcsDestination": {
object( |
Fields | |
---|---|
gcsDestination |
The Google Cloud Storage location to write the output(s) to. |
batchSize |
The max number of response protos to put into each output JSON file on Google Cloud Storage. The valid range is [1, 100]. If not specified, the default value is 20. For example, for one pdf file with 100 pages, 100 response protos will be generated. If Currently, batchSize only applies to GcsDestination, with potential future support for other output configurations. |
GcsDestination
The Google Cloud Storage location where the output will be written to.
JSON representation | |
---|---|
{ "uri": string } |
Fields | |
---|---|
uri |
Google Cloud Storage URI where the results will be stored. Results will be in JSON format and preceded by its corresponding input URI. This field can either represent a single file, or a prefix for multiple outputs. Prefixes must end in a Examples:
If multiple outputs, each response is still AnnotateFileResponse, each of which contains some subset of the full list of AnnotateImageResponse. Multiple outputs can happen if, for example, the output JSON is too large and overflows into multiple sharded files. |