Retrieve a Document Content URL

Retrieve a download or upload content URL for a document.

You can use this URL to download the latest version of the document (download URL) or upload a new version of the document (upload URL).

Note  Download content URLs will only be returned if the document status is SCANNED.

Endpoint

GET /v1/documents/{documentId}/content-url

Authorization Header

Authorization: Bearer <access_token>

Path Parameters

documentId  REQUIRED

string

Semantic ID of the document (example: driving-license).

Note  Use the List Document Types API to retrieve a list of semantic IDs.

Query Parameters

contentUrlType  REQUIRED

string enum, values: DOWNLOAD, UPLOAD

Type of content URL. The following values are supported:

  • DOWNLOAD  Download the latest version of the document.
  • UPLOAD  Upload a new version of the document.

contentLength

integer (int64), max size: 5,242,880 bytes (5 MB)

File content size in bytes. Optional if contentUrlType is UPLOAD. Ignored if contentUrlType is DOWNLOAD.

fileExtension

string enum, values: JPG, JPEG, PNG, PDF

Document file extension. Allowed values are JPG, JPEG, PNG, and PDF. Optional if contentUrlType is UPLOAD. Ignored if contentUrlType is DOWNLOAD.

Request Body

None

Returns

Returns the document content URL. The following fields are returned.

value

string (URI)

Content URL. Download content URLs will only be returned if the document status is SCANNED.

allowed

string enum, values: GET, PUT

Allowed HTTP method for the URL. Possible values are:

  • GET  Download the latest version of the document.
  • PUT  Upload a new version of the document.

expiresIn

integer (int64)

URL expiry period (in seconds).

SAMPLE RESPONSE

				
					{
  "value": "https://documents.rocketkor.net/7260554c5",
  "allowed": "GET",
  "expiresIn": 600
}
				
			
Exit mobile version