Skip to content

List images and videos shared in a conversation

GET
/chats/{chat}/attachments/media
curl --request GET \
--url 'https://chat.work.optidata.cloud/api/chats/36/attachments/media?page=1' \
--header 'Authorization: Bearer <token>'

The visual attachments of the conversation, newest first, paginated — what a gallery view is built from.

chat
required
integer format: int64

Numeric id of the conversation.

page
integer
default: 1 >= 1

1-based page number.

A page of attachments, newest first.

Media typeapplication/json
object
current_page
integer
data
Array
first_page_url
string | null format: uri
from
integer | null
last_page
integer
last_page_url
string | null format: uri
links
Array<object>

Navigation links of a paginated envelope.

object
url
string | null format: uri
label
string
page
integer | null
active
boolean
next_page_url
string | null format: uri
path
string format: uri
per_page
integer
prev_page_url
string | null format: uri
to
integer | null
total
integer
data
Array<object>

A file attached to a message.

object
id
integer format: int64
message_id
integer format: int64
chat_id
integer | null format: int64
cuid
string
hash

Alternative identifier accepted by the attachment content endpoints.

string | null
name
string
url
string | null format: uri
mime_type
string | null
size

Size in bytes.

integer | null
audio

true for a voice message.

boolean | null
duration

Playback length in seconds, for audio and video.

string | null
preview

Thumbnail, when one was generated.

string | null
type
string | null
meta

Storage metadata. Its keys depend on where the file is stored, so treat it as an open object.

object | null
created_at
string format: date-time
updated_at
string format: date-time
deleted_at
string | null format: date-time
Example
{
"current_page": 1
}

Missing, malformed or expired authentication key.

Media typeapplication/json

Authentication failures — and a few permission denials — use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The caller is not a participant of the conversation, or lacks the role the operation requires.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Exampledenied
{
"message": "This action is unauthorized."
}

The resource does not exist, or does not belong to the given conversation.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplemissing
{
"message": "No query results for model [App\\Models\\Chat\\Chat] 99999999"
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}