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

Send MAM Message

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

Sending Masked Authenticated Message

Masked Authenticated Message let you create a channel and publish message stream within. In this API, tangle-accelerator provides user ability to create a unique channel stream and broadcast a message whose size can be bigger than one transaction. After the MAM bundle has been wrapped up, tangle-accelerator will broadcast it to the tangle and return the bundle hash and channel id back to users. Header of Content-Type with application/json is required.

POST /mam/send

Request

Parameters

Name Type Description
x-api-key string Optional. API token for Alfred.
seed string Channel root seed. It is an 81-trytes string.
message string Message payload of the MAM packet in ASCII. Arbitrary length string.
protocol string The protocol the current request used. Now only MAM_V1 is supported.

Sample Request

{
	"x-api-key": "3bff60110c9f0e40628031b16dfefe2eb45a6b0c2237b49ef5109f9aa8eb19a8",
	"data": {
		"seed": "QBFXQETKSHDYPFUDO9ILVCAVQIXOHXKCECZYFLPBNVIX9JUXQZJE9URQEEUWPWYZOIACTCGZX9IDIODCA",
		"message": "this is testing message"
	},
	"protocol": "MAM_V1"
}

Response

Result

Name Type Description
bundle_hash string The hash of IOTA transaction bundle. It is an 81-trytes string.
chid string Channel ID. It is an 81-trytes string.
msg_id string Message ID which is unique under a channel. It is an 21-trytes string.

Sample Response

{
	"bundle_hash": "KDDZYLEUAFQGNZRU9GIXCW9GDSVWQDEXYHEBUKPHNVGHTHIG9INQALJSBVPHSBLAOKAGYZHQEKKXDVINA",
	"chid": "9UISEXBYMDSXOHRRWBHAFOI9TLEZZCOQXTQO9KVBDGGHCP9ITEOQRAGUKXWFTEWLWMUKFLN9IWFFYCXZM",
	"msg_id": "IONONZOXVGTNGVEOCXPUI"
}

curl Example

$ curl node.deviceproof.org:5566/mam/send \
    -X POST \
    -H 'Content-Type: application/json' \
    -d '{"x-api-key": "3bff60110c9f0e40628031b16dfefe2eb45a6b0c2237b49ef5109f9aa8eb19a8","data": {"seed": "QBFXQETKSHDYPFUDO9ILVCAVQIXOHXKCECZYFLPBNVIX9JUXQZJE9URQEEUWPWYZOIACTCGZX9IDIODCA","message": "this is testing message"},"protocol": "MAM_V1"}'

Clone this wiki locally