Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Receive MAM Message

Yang Hau edited this page Jun 24, 2020 · 4 revisions

Receive Masked Authenticated Message

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

Parameters

All inputs are optional, tangle-accelerator would still send a transaction even with some inputs are not provided.

Name Type Description
chid string The channel ID the message exist in. It is 81 trytes long string.
protocol string The protocol the current request used. Now we support only MAM_v1.

Sample Input

{
	"data_id": {
		"chid": "9UISEXBYMDSXOHRRWBHAFOI9TLEZZCOQXTQO9KVBDGGHCP9ITEOQRAGUKXWFTEWLWMUKFLN9IWFFYCXZM"
	},
	"protocol": "MAM_V1"
}

Sample Response

Channel is still available
{
	"payload": ["This is message No1", "This is message No2"]
}
Run out channel capacity
{
	"payload": ["This is message No1", "This is message No2", "This is message No3"],
	"chid1": "THIS9IS9AN9ADDRESS9USED9BY9TAGNLEACCELERATOR9999999999999999999999999999999999999"
}

curl Example

$ curl http://node.deviceproof.org:5566/mam/recv \
    -X POST \
    -H 'Content-Type: application/json' \
    -d '{"data_id": {"chid": "9UISEXBYMDSXOHRRWBHAFOI9TLEZZCOQXTQO9KVBDGGHCP9ITEOQRAGUKXWFTEWLWMUKFLN9IWFFYCXZM"},"protocol": "MAM_V1"
}'

Clone this wiki locally