waku-rest-api/api-spec/relayapi_messages.yaml

52 lines
1.7 KiB
YAML

# /relay/v1/messages/{pubsubTopic}: # Note the plural in messages
get: # get_waku_v2_relay_v1_messages
summary: Get the latest messages on the polled topic
description: Get a list of messages that were received on a subscribed PubSub topic after the last time this method was called. By default, messages are selected from the last 30 messages received by the node. You can modify the number of cached messages with the --rest-relay-cache-capacity CLI argument.
operationId: getMessagesByTopic
tags:
- relay
parameters:
- in: path
name: pubsubTopic # Note the name is the same as in the path
required: true
schema:
type: string
description: The user ID
responses:
'200':
description: The latest messages on the polled topic.
content:
application/json:
schema:
$ref: './schemas/apitypes.yaml#/RelayGetMessagesResponse'
'4XX':
description: Bad request.
'5XX':
description: Unexpected error.
post: # post_waku_v2_relay_v1_message
summary: Publish a message to be relayed
description: Publishes a message to be relayed on a PubSub topic.
operationId: postMessagesToTopic
tags:
- relay
parameters:
- in: path
name: pubsubTopic # Note the name is the same as in the path
description: The messages content topic
required: true
schema:
$ref: './schemas/apitypes.yaml#/RelayPostMessagesRequest'
requestBody:
content:
application/json:
schema:
$ref: './schemas/apitypes.yaml#/RelayPostMessagesRequest'
responses:
'200':
description: OK
'4XX':
description: Bad request.
'5XX':
description: Unexpected error.