go-waku/cmd/waku/server/rest/store_api.yaml

135 lines
4.0 KiB
YAML
Raw Normal View History

2024-05-14 13:06:11 +00:00
# /store/v3/messages:
get:
summary: Gets message history
description: >
Retrieves Waku message history. The returned history
can be potentially filtered by optional request parameters.
operationId: getMessageHistory
tags:
- store
parameters:
- name: peerAddr
in: query
schema:
type: string
required: true
description: >
P2P fully qualified peer multiaddress
in the format `(ip4|ip6)/tcp/p2p/$peerId` and URL-encoded.
example: '%2Fip4%2F127.0.0.1%2Ftcp%2F60001%2Fp2p%2F16Uiu2HAmVFXtAfSj4EiR7mL2KvL4EE2wztuQgUSBoj2Jx2KeXFLN'
2023-04-10 20:39:49 +00:00
2024-05-14 13:06:11 +00:00
- name: includeData
in: query
schema:
type: string
2023-04-10 20:39:49 +00:00
description: >
2024-05-14 13:06:11 +00:00
Boolean indicating if the query should return messages (data) or hashes only.
A value of 'false' returns hashes only.
A value of 'true' returns hashes AND messages.
Default value is 'false'
example: 'true'
2023-04-10 20:39:49 +00:00
2024-05-14 13:06:11 +00:00
- name: pubsubTopic
in: query
schema:
type: string
description: >
The pubsub topic on which a WakuMessage is published.
If left empty, no filtering is applied.
It is also intended for pagination purposes.
It should be a URL-encoded string.
example: 'my%20pubsub%20topic'
2023-04-10 20:39:49 +00:00
2024-05-14 13:06:11 +00:00
- name: contentTopics
in: query
schema: string
description: >
Comma-separated list of content topics. When specified,
only WakuMessages that are linked to any of the given
content topics will be delivered in the get response.
It should be a URL-encoded-comma-separated string.
example: 'my%20first%20content%20topic%2Cmy%20second%20content%20topic%2Cmy%20third%20content%20topic'
2023-04-10 20:39:49 +00:00
2024-05-14 13:06:11 +00:00
- name: startTime
in: query
schema:
type: string
description: >
The inclusive lower bound on the timestamp of
queried WakuMessages. This field holds the
Unix epoch time in nanoseconds as a 64-bits
integer value.
example: '1680590945000000000'
2023-04-10 20:39:49 +00:00
2024-05-14 13:06:11 +00:00
- name: endTime
in: query
schema:
type: string
description: >
The inclusive upper bound on the timestamp of
queried WakuMessages. This field holds the
Unix epoch time in nanoseconds as a 64-bits
integer value.
example: '1680590945000000000'
2023-04-10 20:39:49 +00:00
2024-05-14 13:06:11 +00:00
- name: hashes
in: query
schema:
type: string
description: >
Comma-separated list of message hashes.
URL-base64-encoded string computed as a hash of messages.
Used to find messages by hash.
example: 'Gc4ACThW5t2QQO82huq3WnDv%2FapPPJpD%2FwJfxDxAnR0%3D'
2023-04-10 20:39:49 +00:00
2024-05-14 13:06:11 +00:00
- name: cursor
in: query
schema:
type: string
description: >
Cursor field intended for pagination purposes.
URL-base64-encoded string computed as a hash of a message.
It could be empty for retrieving the first page,
and will be returned from the GET response so that
it can be part of the next page request.
example: 'Gc4ACThW5t2QQO82huq3WnDv%2FapPPJpD%2FwJfxDxAnR0%3D'
2023-04-10 20:39:49 +00:00
2024-05-14 13:06:11 +00:00
- name: pageSize
in: query
schema:
type: string
description: >
Number of messages to retrieve per page
example: '5'
2023-04-10 20:39:49 +00:00
2024-05-14 13:06:11 +00:00
- name: ascending
in: query
schema:
type: string
description: >
"true" for paging forward, "false" for paging backward.
If not specified or if specified with an invalid value, the default is "true".
example: "true"
2023-04-10 20:39:49 +00:00
2024-05-14 13:06:11 +00:00
responses:
'200':
description: Waku message history.
content:
application/json:
2023-04-10 20:39:49 +00:00
schema:
2024-05-14 13:06:11 +00:00
$ref: '#/components/schemas/StoreQueryResponse'
'400':
description: Bad request error.
content:
text/plain:
2023-04-10 20:39:49 +00:00
type: string
2024-05-14 13:06:11 +00:00
'412':
description: Precondition failed.
content:
text/plain:
2023-04-10 20:39:49 +00:00
type: string
2024-05-14 13:06:11 +00:00
'500':
description: Internal server error.
content:
text/plain:
type: string