Using the new /tellraw command.
Ex.
/tellraw @a {"text":"Do you want an apple? ", "extra": [{"text":"[OK]","color":"red","clickEvent": {"action":"run_command","value":"/give @p 260"}, "hoverEvent":{"action":"show_text","value":"I really do"}}]}
But return with "Invalid json: End of input at line 1 column 89"
This is because when I copy and paste this code in to the chat it cuts after column 89.
Confirmed, but works with a command block.
Commands like
tellraw
are probably not supposed to be used in chat line.