Ellipse Gradient for Header

Google Cloud Vision API Integration Guide

Connect enterprise applications to Google Cloud Vision API through authenticated REST calls for OCR, image analysis, batch processing, and asynchronous document workflows.

Google Cloud Vision API integration options at a glance

Google Cloud Vision API provides REST endpoints for synchronous image annotation, batch annotation, asynchronous document processing, and long-running operation management. Requests can include inline base64 image content or Google Cloud Storage URIs, while asynchronous PDF and TIFF workflows can read from and write to Cloud Storage. Authentication uses Google Cloud mechanisms such as OAuth 2.0 access tokens, service accounts, Application Default Credentials, IAM, and supported API keys. Martini can consume these REST endpoints, map image and feature payloads, orchestrate polling for completed operations, validate probabilistic results, and expose a normalized API for downstream applications.

Integration pointSupported by Google Cloud Vision API?Common use casesHow Martini supports it
REST APIsYesUse images:annotate and images:batchAnnotate for synchronous image analysis, including text, labels, objects, faces, logos, safe-search results, and image properties.Martini can consume the Vision REST API, construct feature-specific request payloads, map responses, and expose a normalized REST API to other applications.
Bulk and asynchronous processingYesUse files:asyncBatchAnnotate for larger or multi-page document workflows and manage long-running Operation resources.Martini can submit asynchronous jobs, persist operation names, poll with controlled backoff, process completion results, and route operation-level errors.
File and attachment APIsLimitedVision accepts inline base64 image content and Google Cloud Storage URIs, including supported PDF and TIFF workflows; it is not a general file-management API.Martini can transform incoming files, reference Cloud Storage objects, submit supported file-annotation requests, and process output files written to Cloud Storage.
Google Cloud Storage integrationYesCloud Storage can provide asynchronous input files and receive Vision output files for document annotation.Martini can orchestrate Cloud Storage and Vision calls, retain object references, and continue processing when output becomes available through the configured workflow pattern.
AuthenticationYesGoogle Cloud supports OAuth 2.0 access tokens, service accounts, Application Default Credentials, IAM permissions, and supported API-key usage.Martini can keep environment-specific credentials in secure configuration and use authenticated REST requests with the required Google Cloud permissions.
Client libraries and SDKsYesGoogle provides client libraries for Java, Python, Node.js, Go, C#, PHP, Ruby, and C++ for applications that prefer language-specific APIs.Martini can use REST directly and may use custom JVM-compatible logic when a client library or specialized processing is required.

How Google Cloud Vision API exposes data and business events

Google Cloud Vision API REST APIs

Google Cloud Vision API exposes REST endpoints under vision.googleapis.com for synchronous image annotation, batch image annotation, asynchronous file annotation, and operation management. Requests can use inline image content or Google Cloud Storage references.

Martini implementation pattern

Martini receives an image, document reference, or feature selection, constructs the appropriate REST payload, authenticates with Google Cloud credentials, calls Vision, and maps the response into the consuming application's model. A Martini REST API can provide a stable internal contract over the provider-specific request and response structures.

Implementation sequence

Receive an image, document reference, or analysis request
Select the required Vision features
Build the AnnotateImageRequest payload
Send the authenticated REST request
Map the AnnotateImageResponse into the target model
Validate optional fields and confidence values

Google Cloud Vision API asynchronous batch processing

Vision supports asynchronous file annotation for supported document workflows, including PDF and TIFF processing, using long-running Operation resources and Google Cloud Storage input and output.

Martini implementation pattern

Martini submits an asynchronous request, stores the returned operation name and source identifiers, and runs a follow-up workflow or scheduled poll with controlled backoff. Once the operation completes, Martini retrieves or processes the output, applies business validation, and routes failures for review or retry.

Implementation sequence

Stage the supported document in Google Cloud Storage
Submit the asynchronous file-annotation request
Persist the operation name and source document identifier
Poll the operation with bounded backoff
Retrieve or process the completed output
Validate extracted values and route exceptions

Google Cloud Storage input and output

Google Cloud Storage is a companion service for Vision workflows that need URI-based input or asynchronous output files. Vision can read supported files from configured buckets and write asynchronous results to Cloud Storage.

Martini implementation pattern

Martini coordinates storage and analysis as separate integration steps. It can receive a file from an enterprise system, place or reference it in Cloud Storage, submit the Vision request, and process the output object after the operation completes. Storage permissions must be configured independently from Vision permissions.

Implementation sequence

Receive or locate the source file
Verify the Cloud Storage URI and access permissions
Submit the URI to Google Cloud Vision API
Persist the output location and operation state
Read the completed output object
Send normalized results to the downstream system

Common Google Cloud Vision API integration patterns

Pattern 1: Process documents into business records

When to use this pattern

Use this pattern for invoices, forms, receipts, and other supported documents where OCR output must be validated before creating or updating an enterprise record. Asynchronous processing is appropriate for multi-page or larger documents.

Integration direction
Document intake application
Martini
Google Cloud Storage
Google Cloud Vision API
Example Mapping
Google Cloud Vision API FieldCanonical FieldTarget Field
fullTextAnnotation.textdocumentTextSource document text
textAnnotations[].descriptiondetectedTextExtracted line text
textAnnotations[].boundingPolytextLocationDocument coordinates
confidenceextractionConfidenceReview threshold
Martini implementation pattern

Martini receives or retrieves the document, stages it in Cloud Storage when appropriate, submits DOCUMENT_TEXT_DETECTION asynchronously, and polls the Operation with backoff. It normalizes dates, amounts, identifiers, and supplier names, validates required fields and confidence, then sends valid results to a downstream application while routing incomplete results to human review. Operation errors, transport failures, and duplicate source documents are handled separately.

Martini capabilities used
  • workflows
  • API consumption
  • data mapping
  • business rules
  • asynchronous orchestration
  • error handling

Pattern 2: Expose a normalized image-analysis API

When to use this pattern

Use this pattern when multiple internal applications need image labels, OCR, object localization, or safe-search results without each application implementing Google Cloud authentication and Vision-specific response handling.

Integration direction
Internal application
Martini
Google Cloud Vision API
Internal application
Example Mapping
Google Cloud Vision API FieldCanonical FieldTarget Field
requests[].image.contentimageContentVision image content
features[].typeanalysisFeaturesRequested analyses
responses[].labelAnnotationslabelsNormalized labels
responses[].safeSearchAnnotationsafetyClassificationModeration result
Martini implementation pattern

Martini exposes a REST API that accepts image content or a Cloud Storage URI and a controlled feature selection. The workflow calls Vision synchronously, normalizes feature-specific responses, applies allowed-feature and confidence rules, and returns a stable internal response. Authentication, input validation, transport retries, and provider error translation are centralized in Martini.

Martini capabilities used
  • API exposure
  • workflows
  • API consumption
  • data mapping
  • validation
  • error handling

Pattern 3: Enrich product catalog images

When to use this pattern

Use this pattern for scheduled catalog enrichment where product images should be classified or described with labels, objects, logos, or image properties before metadata is updated.

Integration direction
Shopify
Martini
Google Cloud Vision API
Shopify
Example Mapping
Google Cloud Vision API FieldCanonical FieldTarget Field
product.idproductIdProduct identifier
product.image.urlimageUriVision source URI
labelAnnotations[].descriptiondetectedLabelsProduct image labels
localizedObjectAnnotations[].namedetectedObjectsProduct image objects
Martini implementation pattern

A scheduled Martini workflow reads source products in pages, checks an image hash or version for idempotency, submits eligible images to Vision, and compares normalized results with existing metadata. It updates only changed values, checkpoints progress, and routes unreadable images or quota failures to a retry path without reprocessing the complete catalog.

Martini capabilities used
  • scheduled workflows
  • pagination orchestration
  • API consumption
  • data mapping
  • idempotency
  • retry handling

Pattern 4: Route image moderation exceptions

When to use this pattern

Use this pattern when applications need a consistent moderation or classification decision before an image is published, stored, or sent for operational review.

Integration direction
Content application
Martini
Google Cloud Vision API
Slack
Example Mapping
Google Cloud Vision API FieldCanonical FieldTarget Field
safeSearchAnnotation.adultadultClassificationModeration status
safeSearchAnnotation.violenceviolenceClassificationModeration status
labelAnnotations[].scorelabelConfidenceReview threshold
image.urisourceImageReview reference
Martini implementation pattern

Martini receives an image reference, calls Vision with safe-search or classification features, applies organization-specific thresholds, and returns an allow, reject, or review decision. Low-confidence or disallowed results can be sent to Slack for review, while transient Vision failures use bounded retries and downstream notifications avoid duplicate alerts through an event key.

Martini capabilities used
  • API exposure
  • workflows
  • business rules
  • data mapping
  • conditional routing
  • error handling

Applications commonly integrated with Google Cloud Vision API

Google Cloud Vision API is commonly used as an analysis service within broader document, content, commerce, and operational workflows. Martini can coordinate the source application, Vision API, Cloud Storage, and downstream systems without requiring each application to implement Vision-specific authentication, polling, mapping, and exception handling.

Application Scenario Direction Martini Pattern
Google Cloud Storage Store source images and documents for URI-based requests and receive asynchronous Vision output files. Google Cloud Storage → Martini → Google Cloud Vision API Martini retrieves or references the Cloud Storage object, submits the appropriate Vision request, persists the long-running operation name, and processes output files after completion.
Salesforce Extract text from receipts, forms, or images and attach normalized results to Accounts, Leads, Cases, or custom objects. Salesforce → Martini → Google Cloud Vision API → Salesforce Martini receives an image or attachment reference, calls Vision with the selected feature, validates extracted content, and updates Salesforce through its supported APIs.
ServiceNow Analyze attachments submitted with incidents or requests and place extracted text or classifications into ticket fields. ServiceNow → Martini → Google Cloud Vision API → ServiceNow A Martini workflow retrieves the attachment through ServiceNow APIs, submits it to Vision, applies confidence and validation rules, and updates the incident or request.
SAP S/4HANA Extract invoice or document data before creating or updating finance and procurement records. SAP S/4HANA → Martini → Google Cloud Vision API → SAP S/4HANA Martini coordinates document retrieval, asynchronous OCR, field normalization, validation, exception routing, and calls to SAP S/4HANA APIs.
NetSuite Process receipts, invoices, and supporting documents before updating transaction or vendor data. NetSuite → Martini → Google Cloud Vision API → NetSuite Martini sends document content or a Cloud Storage URI to Vision, maps the response into NetSuite transaction fields, and prevents duplicate updates using source identifiers or hashes.
Shopify Enrich product images with labels, detected objects, logos, or image-property results before updating product metadata. Shopify → Martini → Google Cloud Vision API → Shopify A scheduled Martini workflow reads product images, invokes selected Vision features, compares results with existing metadata, and writes only changed values back to Shopify.
Microsoft SharePoint Analyze documents or images stored in SharePoint and return OCR or classification results to metadata or a downstream repository. Microsoft SharePoint → Martini → Google Cloud Vision API → Microsoft SharePoint Martini uses SharePoint APIs to retrieve content, calls Vision with inline content or a staged Cloud Storage reference, and updates metadata after validation.
Slack Send OCR, classification, or low-confidence exceptions to operational channels for review. Slack → Martini → Google Cloud Vision API → Slack Martini invokes Vision from an event or scheduled workflow, formats the result or exception summary, and sends a notification through Slack's supported API.

How to build a Google Cloud Vision API integration in Martini

Objective

Configure the Google Cloud endpoint and environment-specific authentication without embedding credentials in workflow definitions.

Instructions in Martini

  • Configure the Vision REST endpoint and required project settings
  • Use OAuth 2.0, service-account, ADC, or another confirmed Google Cloud credential pattern
  • Store credentials and environment values in secure Martini configuration
  • Verify the service account has required Vision and Cloud Storage IAM permissions

Objective

Select the event, API request, or schedule that starts image analysis and define the source document contract.

Instructions in Martini

  • Use an inbound API, application event, file intake, or scheduler trigger
  • Capture the source identifier, image reference, file type, and requested Vision features
  • Define whether the workflow is synchronous or asynchronous
  • Set a correlation identifier for tracing and idempotency

Objective

Prepare the image or document in the format appropriate for the selected Vision operation.

Instructions in Martini

  • Retrieve the source file or receive inline image content
  • Use base64 content for suitable synchronous requests
  • Use a Google Cloud Storage URI for larger or asynchronous document workflows
  • Validate supported formats, size limits, and required storage permissions

Objective

Call the appropriate Vision REST operation and manage its response lifecycle.

Instructions in Martini

  • Build the Image, Feature, and request structures
  • Call images:annotate or images:batchAnnotate for synchronous analysis
  • Call asynchronous file annotation for supported document workflows
  • Persist Operation names and processing state when a long-running request is returned

Objective

Convert provider-specific analysis results into a stable internal or target-system model.

Instructions in Martini

  • Map text, labels, objects, classifications, and properties into canonical fields
  • Handle absent fields and empty arrays for feature-specific responses
  • Validate required values and confidence thresholds
  • Preserve the original response when auditability or reprocessing is required

Objective

Deliver validated analysis to the downstream application, repository, or internal API.

Instructions in Martini

  • Create or update the target record through its supported API
  • Apply source identifiers, content hashes, or operation names for duplicate detection
  • Route low-confidence or incomplete results to an exception process
  • Return a normalized response when Martini is exposing an internal API

Common Google Cloud Vision API data objects used in integrations

ObjectTypical UseCommon target systemsMartini handling
ImageCarries inline image content or a Google Cloud Storage URI for analysis.Google Cloud Storage, Salesforce, ServiceNow, SharePointMartini receives or retrieves the image, chooses inline content or a URI, applies size and file-type rules, and submits the request.
FeatureSpecifies analysis such as TEXT_DETECTION, DOCUMENT_TEXT_DETECTION, LABEL_DETECTION, OBJECT_LOCALIZATION, or SAFE_SEARCH_DETECTION.Google Cloud Vision API, internal analysis APIsMartini selects features from workflow configuration or request parameters and maps the returned feature-specific results into a canonical model.
AnnotateImageRequestContains an Image, requested Features, and optional ImageContext for one annotation request.Google Cloud Vision APIMartini builds and validates the request from source application data before making an authenticated REST call.
AnnotateImageResponseContains detected text, labels, objects, faces, properties, or safe-search classifications.Salesforce, SAP S/4HANA, NetSuite, ServiceNow, databasesMartini maps optional and feature-specific response fields, preserves relevant source results, validates confidence, and routes exceptions.
BatchAnnotateImagesRequest / BatchAnnotateImagesResponseProcesses multiple image annotation requests in a synchronous batch operation.Google Cloud Vision API, product catalogs, document intake systemsMartini batches eligible inputs within documented limits, tracks source identifiers, and handles partial or transport failures according to workflow rules.
OperationRepresents an asynchronous Vision job that is polled until completion and then yields results or an error.Google Cloud Vision API, Google Cloud Storage, enterprise document systemsMartini persists the operation name and processing state, polls with backoff, processes completed output, and handles timeout or operation errors separately.

Authentication and security considerations

Google Cloud authentication

Google Cloud Vision API supports OAuth 2.0 access tokens, service accounts, Application Default Credentials, IAM permissions, and supported API-key usage. Service-account-based OAuth is generally more appropriate for production server integrations.

Credential and storage security

  • Store environment-specific credentials in Martini secure configuration rather than workflow mappings.
  • Grant the calling identity only the required Vision permissions.
  • Verify Cloud Storage read and write permissions separately when asynchronous workflows use buckets.
  • Prefer managed identity or workload-based credentials where available and avoid embedding service-account keys.
  • Restrict logs so image content, OCR text, access tokens, and credentials are not unnecessarily recorded.

Operational considerations for Google Cloud Vision API integrations

Quotas and retries

Design for Google Cloud quotas, request limits, payload constraints, transient 429 and 5xx responses, timeouts, and network failures. Use bounded retries with backoff and avoid repeating downstream updates without an idempotency strategy.

Asynchronous processing

Persist each Operation name with the source document identifier and poll with controlled backoff. Handle operation-level errors separately from HTTP transport errors, and define timeout and exception paths.

Data and schema handling

  • Choose inline content or Cloud Storage URIs according to image size and processing mode.
  • Respect supported file types, page limits, image dimensions, and request-size limits.
  • Handle feature-specific response structures, absent fields, and empty arrays.
  • Validate OCR confidence and extracted values before committing business records.
  • Use source IDs, object generations, content hashes, and checkpoints to support idempotency and restartability.
  • Define retention, deletion, regional processing, and data-residency policies for images and OCR results.

Why use Martini instead of scripts or point-to-point integrations?

Centralized integration logic

Martini separates Google Cloud Vision access from business applications by centralizing authentication, request construction, response mapping, validation, and downstream API calls in maintainable workflows.

Reliable orchestration

Unlike a narrowly scoped script or point-to-point implementation, Martini can coordinate synchronous requests, asynchronous Operation polling, Cloud Storage, retries, exception routing, checkpoints, and target-system updates.

Reusable APIs and mappings

Martini can expose a normalized REST API so multiple applications use a consistent image-analysis contract. Reusable mappings and business rules reduce duplicated Vision-specific logic while preserving the flexibility to add custom JVM-compatible processing when required.

Frequently asked questions

How can Google Cloud Vision API be integrated with enterprise systems?

Google Cloud Vision API integrates through authenticated REST endpoints for synchronous image annotation, batch annotation, asynchronous document processing, and long-running operation management. Images can be supplied inline or through Google Cloud Storage URIs. Enterprise workflows can send Vision results to applications such as Salesforce, ServiceNow, SAP S/4HANA, NetSuite, or SharePoint.

Can Martini integrate with Google Cloud Vision API?

Yes. Martini can consume the Google Cloud Vision REST API, authenticate with Google Cloud credentials, map image and feature payloads, process synchronous responses, and orchestrate polling for asynchronous Operation resources. No dedicated Martini connector is documented in the supplied material.

Do I need a connector to integrate Google Cloud Vision API with Martini?

No. A dedicated Google Cloud Vision connector is not required. Martini can use the vendor's native REST API, Google Cloud authentication mechanisms, inline image content, Google Cloud Storage URIs, and long-running operation endpoints.

Is there any extra Lonti cost to integrate Google Cloud Vision API with Martini?

Lonti does not charge an additional per-connector or per-vendor fee to integrate Google Cloud Vision API with Martini. Integrations are subject to the provisioned capacity of the Martini environment. Separate costs may apply from Google Cloud, infrastructure providers, or other third-party systems based on usage, storage, subscriptions, and deployment.

Which Google Cloud Vision integration methods should architects use?

Use the Vision REST API for current integrations. Synchronous annotation suits smaller low-latency requests, while asynchronous batch file annotation is appropriate for larger or multi-page PDF and TIFF workflows. Google Cloud Storage is used for URI-based input and asynchronous output, and Google Cloud authentication should be configured with appropriate IAM permissions.

Does Google Cloud Vision API provide webhooks or callbacks?

A general Google Cloud Vision webhook or outbound callback mechanism was not identified in the supplied documentation. Asynchronous processing returns a long-running Operation, so Martini should persist the operation name and poll with controlled backoff, or use a broader Google Cloud architecture outside the native Vision webhook model.

How does Martini synchronize Google Cloud Vision results with other systems?

Martini can receive or retrieve images, submit Vision requests, poll asynchronous operations, map feature-specific responses, validate confidence and required fields, and write results to supported downstream APIs or databases. Source identifiers, content hashes, operation names, and checkpoints can support resumption and duplicate prevention.

How does Martini handle Vision errors, retries, and duplicate processing?

Martini can distinguish HTTP transport errors from Vision Operation errors, apply bounded retries with backoff for transient failures such as rate limiting or server errors, and route permanent failures to exception handling. Idempotency remains a workflow concern and can use source document IDs, object generations, content hashes, and persisted operation state.