Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IDataMessage

interface IDataMessage
Extends com.amazon.apmf.IStandard Interface used by client applications to process the data message. Data messages are defined by custom key-value pairs. Client applications configure the data message on cloud and handle it on the device.

Methods

getKeys()

string[] getKeys()
Get an array of all the keys in this data message. All keys are strings.

Returns

string[] An array of keys.

getValue()

string getValue(string key)
Get the value for the given key. All values are strings.

Parameters

key
string — Required The key to get.

Returns

string The value for the given key

Throws

  • InvalidArgumentError — if the given key doesn’t have any value associated with it in data message.

hasKey()

bool hasKey(string key)
Check if this data message contains the given key.

Parameters

key
string — Required The key to look for.

Returns

bool True if the key is present, false if not.
Last modified on October 29, 2026