What’s the unique identifier of a message object?

The unique identifier is the message.messageUId property. For details, check the documentation.