Is the purpose of the messageId solely for the use of the sender?
Yes. Any replies to messages you send out will also include a messageId that will link the reply to your original message. The ID provided by your service is a string of up to 50 characters. If you are persisting this information to a database, that would be the field type to use. The current format is a hexidecimal string. However, this has changed in the past and may change again without notice in future, so simply recording it verbatim is the preferred course to take.