Using rasa-webchat to send intent and entities using a button?

I’d like to send a payload from a button clicked using rasa-webchat, the payload should contain the intent and entities (here programme_name and programme_date).

I’ve tried like this

butt_dict2['payload'] = '/get_a_tracklist{/"programme_name/":/"Benji B/", /"programme_date/":/"2015-12-17/"}'

The intent is sent correctly, but the entities ignored, rasa receives:

{'text': '/get_a_tracklist{/"programme_name/":/"Benji B/", /"programme_date/":/"2015-12-17/"}', 'intent': {'name': 'get_a_tracklist', 'confidence': 1.0}, 'intent_ranking': [{'name': 'get_a_tracklist', 'confidence': 1.0}], 'entities': []}

Is there a way to send entities as a payload, or alternatively directly sending an action?

In the rasa-webchat documentation it implies that the format /intent{"entity":"value"} , can be used, but I’m unable to recreate that from the python action server.

I’m doing this:

value = getValue()
title = getTitle()
pl = "/intent{\"entity\": \"" + value + "\"}"
buttons.append( {"title": title, "payload": pl}  )

value, title and pl are strings.

Thanks, this worked. Main issue was that I had my escapes the wrong way around!

butt_dict2['payload'] = '/get_a_tracklist_from_pid{\"pid\":\"'+ e['EPISODE_PID'] + '\"}'