obniz
Version:
obniz sdk for javascript
91 lines (45 loc) • 1.5 kB
Markdown
# <a name="message">message</a>
send/receive with other obniz or WebHook
## request: <a name="-request-message-send">send</a>
Related item
- [/response/message/receive](#-response-message-receive)
| path | type | conditions | description |
|:---- |:---- |:---- |:---- |
| `message.data` | anyType | <ul><li>required</li></ul> | All type of data is pass. |
| `message.to[]` | [obnizId](#obnizid) | <ul><li>required</li></ul> | |
```
// Json Example
[
{
"message": {
"data": "button pressed",
"to": [
"1234-5678"
]
}
}
]
```
## response: <a name="-response-message-receive">receive</a>
Related item
- [/request/message/send](#-request-message-send)
| path | type | conditions | description |
|:---- |:---- |:---- |:---- |
| `message.data` | anyType | <ul><li>required</li></ul> | All type of data is pass. |
| `message.from` | string,null | | From obniz id. Null is used when WebHook message. |
```
//Response Example
[
{
"message": {
"data": "button pressed",
"from": "1234-5678"
}
}
]
```
# type defines
## <a name="obnizid">obnizId</a>
| type | conditions | examples | description |
|:----|:----|:----|:----|
| string,integer | <ul><li>0 ≤ value ≤ 99999999</li></ul> | <ul><li>`"1234-5678"`</li><li>`12345678`</li></ul> | Obniz id. It can contain '-' or not. |