The sendwithmetadata API command has the syntax [address amount data-hex]. The working example provided by you ''[sendwithmetadata [the_address] 123456789abcde]" have the missing the amount field or the asset quantities json field. With presence of field it would like:
- sendwithmetadata [the_address] 0 123456789abcde
- sendwithmetadata [the_address] '{"some_asset_name":QTY}' 123456789abcde
Since the last argument required in Hex String, the API validation logic would fail to parse the "FirstName=Joe Lastname=Bloggs" as a hex string. Due to the space presence in between Joe and Lastname, parsing error is also encountered.
Now to send the example data, it is required to convert the string to hex string data. For example In Java we have String getbytes, the bytes could be converted to Hex String. Now converting "FirstName=Joe Lastname=Bloggs" would result in hex string with value of "46697273744e616d653d4a6f65204c6173746e616d653d426c6f676773". Now we can use the command like:
- sendwithmetadata [the_address] 0 46697273744e616d653d4a6f65204c6173746e616d653d426c6f676773
- or
- sendwithmetadata [the_address] '{"some_asset_name":QTY}' 46697273744e616d653d4a6f65204c6173746e616d653d426c6f676773
When reading the data back from blockchain, the hex string is needed to be reconverted to string in the application level (Hex String -> Byte Array --> String).