Skip to navigation

Get Ocr Async

Preview
View as Markdown

Asynchronous OCR (optical character recognition) text extraction for images and PDFs, including scanned / non-text PDFs. Supported formats:

  • Image formats: .bmp, .gif, .heic, .jpeg, .jpg, .png, .tif, .tiff, .webp.
  • PDF format: .pdf.

Unsupported formats return an unsupported_format_error. For the url variant only Dropbox shared links are supported; external URLs return unsupported_format_error.

Text-based PDFs already carry a text layer, so OCR is not run against them and the result is empty; use get_text_async to read the embedded text layer of such a PDF.

The result carries the extracted words as plain text, plus the same content as hOCR with per-word coordinates.

Required scope: files.content.read

Endpoint format: RPC

Authentication: App, User

This endpoint does not support apps with the app folder permission.

Authentication

AuthorizationBearer

App-level OAuth 2.0 token (no user context). Use Authorization: Bearer <token>.

Obtain by calling the token endpoint with grant_type=client_credentials.

Only available on endpoints that declare app auth support.

OR
AuthorizationBearer

OAuth 2.0 token issued to a specific user. Use Authorization: Bearer <token>.

Public clients should use the authorization code flow with PKCE (S256).

For background or offline access, send token_access_type=offline during authorization and use the returned refresh token to obtain new access tokens.

You can generate a short-lived access token in the Developer Console; see Testing with a generated token.

Headers

Dropbox-API-Select-UserstringOptional

Acts on behalf of a team member for supported user-auth operations. Pass a team member ID such as dbmid:.... When used with a team token, that token must also include the team_data.member scope.

Dropbox-API-Path-RootstringOptional

Scopes path-based operations to a namespace (root). The value is a JSON serialization of the common.PathRoot union: {".tag": "home"}, {".tag": "root", "root": "<namespace_id>"}, or {".tag": "namespace_id", "namespace_id": "<namespace_id>"}. On failure the request returns 422 with a common.PathRootError.

Request

This endpoint expects a nullable object.
file_id_or_urlobject or nullOptional

Identifier of the file to run OCR on. Callers must set exactly one of the FileIdOrUrl variants. OCR is supported for image files and PDFs, including scanned / non-text PDFs; see the route description for the supported formats. Requests against unsupported formats return unsupported_format_error.

NOTE: for the url variant, only Dropbox shared links (www.dropbox.com) are supported. External (non-Dropbox) URLs are not supported and return unsupported_format_error; import the file into Dropbox and reference it by file_id or path instead.

Variant:
riviera_api_v2.FileIdOrUrl.file_idobjectRequired

A Dropbox-issued file ID for a file the authenticated user has access to, e.g. “id:a4ayc_80_OEAAAAAAAAAYa”.

Response headers

X-Dropbox-Request-IdstringOptional
A unique identifier for the request, useful for debugging and support.

Response

Successful response
Variant:
async_common.LaunchResultBase.async_job_idobject
This response indicates that the processing is asynchronous. The string is an id that can be used to obtain the status of the asynchronous job.

Errors

401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error
500
Internal Server Error