API referenceovok_sdk.resources

ovok_sdk.resources.chat

The `ovok.chat` namespace: chat between patients and their care team.

  • Stable unknown
  • Release candidate not available
  • Development since 0.2.0-dev.34+53a6a64

The ovok.chat namespace: chat between patients and their care team.

ChatThreadsResource

ChatThreadsResource(chat: HttpClient)

Threads the signed-in person takes part in; access it as ovok.chat.threads.

Parameters

NameTypeDefaultDescription
chatHttpClientThe HTTP client scoped to the chat routes.

open()

open(body: JsonObject, *, options: RequestOptions | None = None) -> Any

Open a thread about a patient, or return the open one with the same people.

Parameters

NameTypeDefaultDescription
bodyJsonObjectpatient and participants as references, and an optional title.
optionsRequestOptions | NoneNonePer-request options; timeout overrides the client's.

Returns

  • Any: The thread.

list()

list(
    params: JsonObject | None = None,
    *,
    options: RequestOptions | None = None,
) -> Page[Any]

List threads, most recently active first.

Parameters

NameTypeDefaultDescription
paramsJsonObject | NoneNoneOptional patient reference, updatedSince (ISO time) and limit.
optionsRequestOptions | NoneNonePer-request options; timeout overrides the client's.

Returns

  • Page[Any]: A page of threads that loads later pages on demand.

retrieve()

retrieve(thread_id: str, *, options: RequestOptions | None = None) -> Any

Read one thread.

Parameters

NameTypeDefaultDescription
thread_idstrThe thread ID.
optionsRequestOptions | NoneNonePer-request options; timeout overrides the client's.

Returns

  • Any: The thread, with its last message and unread count.

ChatThreadMessagesResource

ChatThreadMessagesResource(chat: HttpClient)

Messages in a thread; access it as ovok.chat.messages.

Parameters

NameTypeDefaultDescription
chatHttpClientThe HTTP client scoped to the chat routes.

list()

list(
    thread_id: str,
    params: JsonObject | None = None,
    *,
    options: RequestOptions | None = None,
) -> Page[Any]

List a thread's messages, newest first.

Parameters

NameTypeDefaultDescription
thread_idstrThe thread ID.
paramsJsonObject | NoneNoneOptional since (ISO time) and limit.
optionsRequestOptions | NoneNonePer-request options; timeout overrides the client's.

Returns

  • Page[Any]: A page of messages that loads older pages on demand.

send()

send(thread_id: str, body: JsonObject, *, options: RequestOptions | None = None) -> Any

Send a message; a retry with the same clientId answers the message already sent.

Parameters

NameTypeDefaultDescription
thread_idstrThe thread ID.
bodyJsonObjecttext, optional attachments (IDs from ovok.chat.attachments.upload), replyTo and clientId; a random clientId is added when there is none.
optionsRequestOptions | NoneNonePer-request options; timeout overrides the client's.

Returns

  • Any: The message.
attachment_link(
    thread_id: str,
    message_id: str,
    attachment_id: str,
    *,
    options: RequestOptions | None = None,
) -> Any

Get a link that downloads a message's attachment.

Parameters

NameTypeDefaultDescription
thread_idstrThe thread ID.
message_idstrThe message ID.
attachment_idstrThe attachment ID.
optionsRequestOptions | NoneNonePer-request options; timeout overrides the client's.

Returns

  • Any: url, usable without a bearer, and expiresAt.

ChatAttachmentsResource

ChatAttachmentsResource(chat: HttpClient, settings: OvokSettings)

Files to send in chat messages; access it as ovok.chat.attachments.

Parameters

NameTypeDefaultDescription
chatHttpClientThe HTTP client scoped to the chat routes.
settingsOvokSettingsThe client's settings; the file goes to the store through its transport.

upload()

upload(
    *,
    file: bytes,
    file_name: str,
    content_type: str,
    options: RequestOptions | None = None,
) -> Any

Upload a file to send with a message.

Parameters

NameTypeDefaultDescription
filebytesThe file's content.
file_namestrThe file's name.
content_typestrapplication/pdf, image/png, image/jpeg or image/webp.
optionsRequestOptions | NoneNonePer-request options; timeout overrides the client's.

Returns

  • Any: The attachment: id, title and contentType. Send its id in a message's attachments.

Raises

  • OvokConnectionError: The file store could not be reached.
  • OvokServiceError: The file store refused the file.
link(attachment_id: str, *, options: RequestOptions | None = None) -> Any

Get a link that downloads an attachment you uploaded.

Parameters

NameTypeDefaultDescription
attachment_idstrThe attachment ID.
optionsRequestOptions | NoneNonePer-request options; timeout overrides the client's.

Returns

  • Any: url, usable without a bearer, and expiresAt.

ChatResource

ChatResource(http: HttpClient, settings: OvokSettings)

Chat between patients and their care team.

Created by Ovok; access it as ovok.chat.

Parameters

NameTypeDefaultDescription
httpHttpClientThe client's HTTP client.
settingsOvokSettingsThe client's settings.

read()

read(
    thread_id: str,
    body: JsonObject | None = None,
    *,
    options: RequestOptions | None = None,
) -> None

Mark a thread read for the signed-in person.

Parameters

NameTypeDefaultDescription
thread_idstrThe thread ID.
bodyJsonObject | NoneNoneOptional readAt (ISO time); defaults to now.
optionsRequestOptions | NoneNonePer-request options; timeout overrides the client's.

Last updated on

On this page