Concatenate all bytes of transaction fields (for strings use utf8 encoding, for numbers such as nonce and timestamp - 8 bytes big-endian unsigned representation):
tags_bytes = concat(sort(tags))
data = concat(
space
key,
bytes(nonce), // 8 bytes big-endian
bytes(timestamp), // 8 bytes big-endian
memo,
tags_bytes, // concatenated array of tags
value
)
Call API method /api/events/add?event={encodedTransaction}
If transaction is constructed and signed properly this endpoint will return 200 OK HTTP response. It doesn't mean transaction is immediately add to blockchain as processing is asynchronous. In order to check if transaction succeeded use provided in documentation API methods.
Here is the reference implementation of transaction signing in NodeJS