This repository has been archived by the owner on Dec 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Receive MAM Message
Yang Hau edited this page Jul 20, 2020
·
4 revisions
In this API, tangle-accelerator provides user ability to fetch all messages under a unique channel. This API will return the ID of next channel (chid1). Header of Content-Type with application/json
is required.
POST /mam/recv
Name | Type | Required or Optional | Description |
---|---|---|---|
chid | string | Required | The channel ID the message exist in. It is an 81-trytes long string. |
protocol | string | Required | The protocol the current request used. Now we support only MAM_v1 . |
{
"data_id": {
"chid": "JVYTMGBIWU9NMUKUOVBAVBVW9QMSOOGUK9SB9OMILKMEVHWMPFALZBGPEBRAXESZZKEUGK9QEHAABTOIJ"
},
"protocol": "MAM_V1"
}
Name | Type | Description |
---|---|---|
payload | array | A array which is composed of several messages. Each element in this array is the message in the query Channel |
chid1 | string | Channel ID of next Channel. It would be returned when the current fetched channel is full of Messages |
{
"payload": ["This is message No1", "This is message No2"]
}
{
"payload": ["This is message No1", "This is message No2", "This is message No3"],
"chid1": "THIS9IS9AN9ADDRESS9USED9BY9TAGNLEACCELERATOR9999999999999999999999999999999999999"
}
$ curl http://node.deviceproof.org:5566/mam/recv \
-X POST \
-H 'Content-Type: application/json' \
-d '{"data_id": {"chid": "JVYTMGBIWU9NMUKUOVBAVBVW9QMSOOGUK9SB9OMILKMEVHWMPFALZBGPEBRAXESZZKEUGK9QEHAABTOIJ"},"protocol": "MAM_V1"
}'
In the following conditions that a client who send a request will receive an HTTP error code 400
and JSON object in response body.
- The absence of any required field
-
chid
field is less than 81 trytes
Copyright (C) 2018-2020 BiiLabs Co., Ltd. and Contributors.
- Address
- Tag
- Transaction
- Tips (deprecated)