How to deal with custom message in JSON format

Custom Message Subscribe

Request:

{"id": 11, "type":"CustomMessageSubscribe", "body": {}}

Response:

{"type": "CustomMessageSubscribe", "id":11, "body": {"is_subscribed": true}}

Get the list of customers that subscribed to custom message

Request:

curl --location 'http://localhost:8080/custom-message-subscribers'

Response (key:value): list of accounts and number of subscribers.

{
"87622":1
}

Send to customers custom message

Request:

curl --location 'http://localhost:8080/custom-message' \
--header 'Content-Type: text/plain' \
--data '{
    "accounts": ["87622"],
    "message_body": {"test": {"test_child": "value_child"}}
}

Response, if 200OK:

Receive the response in websocket

Last updated