When a player send a message from his in-game phone, your server need to inform iPear that a new message has been sent. You can send a message from the server with the websocket.
You need to emit an event with the following name and data:
Event name: messages@new
| Key | Type | Extra | Description |
|---|---|---|---|
sender_id | string | required | Unique identifier (custom_id) of the sender (1-64 characters) |
sender_number | string | required | Phone number of the sender (1-32 characters) |
recipient_id | string | required | Unique identifier (custom_id) of the recipient (1-64 characters) |
recipient_number | string | required | Phone number of the recipient (1-32 characters) |
recipient_online | boolean | required | Tell us if the recipient is online. If he's not, we send a notification to the recipient |
content | string | required | Content of the message (1-1024 characters) |
Important
Response object must respect every type rule. If any structure isn't respected, your request will be rejected for "bad-request".
{
"sender_id": "1234",
"sender_number": "555-9876",
"recipient_id": "8524",
"recipient_number": "555-4567",
"recipient_online": true,
"content": "Hey! Can we meet in 2 hours?"
}
Unfortunately, there is no response in this version.
Incoming events
Powered by Doctave