File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -40,3 +40,36 @@ The message we send with this code then looks like this in our Webex space
4040client:
4141
4242.. image :: ../images/cards_sample.png
43+
44+
45+ Processing a card action
46+ =======================
47+
48+ Adaptive card interactions are treated as "attachment actions". Once user interacts
49+ with your card and submits an action, your app will receive a webhook from Webex. You
50+ must `setup a webhook <api.rst#webhooks >`_ in advance with ``resource = "attachmentActions" ``
51+ and ``event = "created" ``.
52+
53+ Webhook payload will contain a JSON:
54+
55+ .. code-block :: json
56+
57+ {
58+ "resource" : " attachmentActions" ,
59+ "event" : " created" ,
60+ "data" : {
61+ "id" : " XYXYXY" ,
62+ "type" : " submit"
63+ }
64+ }
65+
66+ Extract attachment action ID from ``['data']['id'] `` and
67+ use `attachment_actions.get() <api.rst#attachment_actions >`_ to get full information
68+ about user action and any submitted data.
69+
70+ .. code-block :: python
71+
72+ action = api.attachment_actions.get(webhookJson[' data' ][' id' ])
73+
74+ first_name = action.inputs[' first_name' ]
75+ age = action.inputs[' age' ]
You can’t perform that action at this time.
0 commit comments