All URIs are relative to https://api.waylay.io
Method | HTTP request | Description |
---|---|---|
delete_messages | DELETE /data/v1/messages/{resourceId} | Remove Messages For Resource |
get_latest_document | GET /data/v1/messages/{resourceId}/current | Retrieve Latest Message |
get_latest_messages | GET /data/v1/messages/{resourceId} | Retrieve Messages For Resource |
query_messages | POST /data/v1/messages/query | Query Messages |
delete_messages( resource_id: str, headers ) -> DeleteMessages200Response
Remove Messages For Resource
Removes all messages associated with a resource.
from pprint import pprint
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError
# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()
# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-data-types` is installed
from waylay.services.data.models.delete_messages200_response import DeleteMessages200Response
try:
# Remove Messages For Resource
# calls `DELETE /data/v1/messages/{resourceId}`
api_response = await waylay_client.data.messages.delete_messages(
'resource_id_example', # resource_id | path param "resourceId"
)
print("The response of data.messages.delete_messages:\n")
pprint(api_response)
except ApiError as e:
print("Exception when calling data.messages.delete_messages: %s\n" % e)
DELETE /data/v1/messages/{resourceId}
Name | Type | API binding | Description | Notes |
---|---|---|---|---|
resource_id | str | path parameter "resourceId" |
Uniquely identifies a resource. | |
headers | HeaderTypes | request headers |
Selected path param | Raw response param | Return Type | Description | Links |
---|---|---|---|---|
Literal[""] (default) | False (default) | DeleteMessages200Response |
DeleteMessages200Response | |
str | False (default) | Any |
If any other string value for the selected path is provided, the exact type of the response will only be known at runtime. | |
/ | True | Response |
The raw http response object. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_latest_document( resource_id: str, headers ) -> TimestampedEvent
Retrieve Latest Message
Retrieves the latest (i.e. most recent) message for a resource.
from pprint import pprint
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError
# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()
# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-data-types` is installed
from waylay.services.data.models.timestamped_event import TimestampedEvent
try:
# Retrieve Latest Message
# calls `GET /data/v1/messages/{resourceId}/current`
api_response = await waylay_client.data.messages.get_latest_document(
'resource_id_example', # resource_id | path param "resourceId"
)
print("The response of data.messages.get_latest_document:\n")
pprint(api_response)
except ApiError as e:
print("Exception when calling data.messages.get_latest_document: %s\n" % e)
GET /data/v1/messages/{resourceId}/current
Name | Type | API binding | Description | Notes |
---|---|---|---|---|
resource_id | str | path parameter "resourceId" |
Uniquely identifies a resource. | |
headers | HeaderTypes | request headers |
Selected path param | Raw response param | Return Type | Description | Links |
---|---|---|---|---|
Literal[""] (default) | False (default) | TimestampedEvent |
TimestampedEvent | |
str | False (default) | Any |
If any other string value for the selected path is provided, the exact type of the response will only be known at runtime. | |
/ | True | Response |
The raw http response object. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
404 | No Message Received Yet | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_latest_messages( resource_id: str, headers ) -> List[TimestampedEvent]
Retrieve Messages For Resource
Retrieves the last n messages for a resource.
from pprint import pprint
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError
# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()
# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-data-types` is installed
from waylay.services.data.models.timestamped_event import TimestampedEvent
try:
# Retrieve Messages For Resource
# calls `GET /data/v1/messages/{resourceId}`
api_response = await waylay_client.data.messages.get_latest_messages(
'resource_id_example', # resource_id | path param "resourceId"
)
print("The response of data.messages.get_latest_messages:\n")
pprint(api_response)
except ApiError as e:
print("Exception when calling data.messages.get_latest_messages: %s\n" % e)
GET /data/v1/messages/{resourceId}
Name | Type | API binding | Description | Notes |
---|---|---|---|---|
resource_id | str | path parameter "resourceId" |
Uniquely identifies a resource. | |
headers | HeaderTypes | request headers |
Selected path param | Raw response param | Return Type | Description | Links |
---|---|---|---|---|
Literal[""] (default) | False (default) | List[TimestampedEvent] |
List[TimestampedEvent] | |
str | False (default) | Any |
If any other string value for the selected path is provided, the exact type of the response will only be known at runtime. | |
/ | True | Response |
The raw http response object. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
query_messages( headers ) -> MessageQueryResult
Query Messages
Executes an ad-hoc messages query.
from pprint import pprint
# Import the waylay-client from the waylay-sdk-core package
from waylay.sdk.client import WaylayClient
from waylay.sdk.api.api_exceptions import ApiError
# Intialize a waylay client instance
waylay_client = WaylayClient.from_profile()
# Note that the typed model classes for responses/parameters/... are only available when `waylay-sdk-data-types` is installed
from waylay.services.data.models.message_query import MessageQuery
from waylay.services.data.models.message_query_result import MessageQueryResult
try:
# Query Messages
# calls `POST /data/v1/messages/query`
api_response = await waylay_client.data.messages.query_messages(
# json data: use a generated model or a json-serializable python data structure (dict, list)
json = waylay.services.data.MessageQuery() # MessageQuery | (optional)
)
print("The response of data.messages.query_messages:\n")
pprint(api_response)
except ApiError as e:
print("Exception when calling data.messages.query_messages: %s\n" % e)
POST /data/v1/messages/query
Name | Type | API binding | Description | Notes |
---|---|---|---|---|
json | MessageQuery | json request body | [optional] | |
headers | HeaderTypes | request headers |
Selected path param | Raw response param | Return Type | Description | Links |
---|---|---|---|---|
Literal[""] (default) | False (default) | MessageQueryResult |
MessageQueryResult | |
str | False (default) | Any |
If any other string value for the selected path is provided, the exact type of the response will only be known at runtime. | |
/ | True | Response |
The raw http response object. |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Query Result | - |
400 | Error Response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]