API referenceresources

ovok_sdk.resources.documents

Stored documents: uploads, metadata and download links.

  • Stable unknown
  • Release candidate since 0.1.0-rc.4
  • Development since 0.1.0-dev.25+2ba84b0

Stored documents: uploads, metadata and download links.

DocumentsResource

DocumentsResource(http: HttpClient, base_url: str)

List, upload, replace and delete stored documents, and build download URLs.

Created by Ovok; access it as ovok.documents.

list()

list(params: QueryParams | None = None) -> Resource

List documents.

Parameters

NameTypeDefaultDescription
paramsQueryParams | NoneNoneOptional query parameters passed to the API.

Returns

  • Resource: The API's list response.

create_upload()

create_upload(body: Resource) -> Resource

Create a document and start its upload.

Parameters

NameTypeDefaultDescription
bodyResourceThe document metadata as the API takes it.

Returns

  • Resource: The created document, including where to upload the file.

replace_upload()

replace_upload(document_id: str, body: Resource) -> Resource

Start an upload that replaces a document's file.

Parameters

NameTypeDefaultDescription
document_idstrThe document ID.
bodyResourceThe new file's metadata.

Returns

  • Resource: The document, including where to upload the new file.

update_metadata()

update_metadata(document_id: str, body: Resource) -> Resource

Update a document's metadata without touching its file.

Parameters

NameTypeDefaultDescription
document_idstrThe document ID.
bodyResourceThe metadata fields to change.

Returns

  • Resource: The updated document.

delete()

delete(document_id: str) -> Resource

Delete a document.

Parameters

NameTypeDefaultDescription
document_idstrThe document ID.

Returns

  • Resource: The API's delete response.

download_url()

download_url(document_id: str, params: QueryParams | None = None) -> str

Build the download URL of a document; no request is sent.

Parameters

NameTypeDefaultDescription
document_idstrThe document ID.
paramsQueryParams | NoneNoneOptional query parameters to append.

Returns

  • str: The absolute download URL.

public_download_url()

public_download_url(public_token: str, params: QueryParams | None = None) -> str

Build the public download URL for a shared document; no request is sent.

Parameters

NameTypeDefaultDescription
public_tokenstrThe document's public share token.
paramsQueryParams | NoneNoneOptional query parameters to append.

Returns

  • str: The absolute download URL, usable without authentication.

Last updated on

On this page