Hi,
I am building a slack app that allows me to click buttons in a slack message, it will then send out HTTP Post requests to a url i have defined. Its currently setup with a pipedream webhook endpoint, but the package i receive from slack isnt correctly formatted, so essentially it is useless. What is the best way for me to parse out this body.payload below
?
{“type”:“block_actions”,“user”:{“id”:“U03FQTQLBE3”,“username”:“nate”,“name”:“nate”,“team_id”:“T03FQTJFM9D”},“api_app_id”:“A03LL77V3Q9”,“token”:“Bb01yDURztbH8M0cyQxwMILk”,“container”:{“type”:“message”,“message_ts”:“1655532250.286529”,“channel_id”:“D03GJ4PE3C1”,“is_ephemeral”:false},“trigger_id”:“3687547982195.3534936531319.4c2ed1d3fcadcf066b96cb796ff5b82d”,“team”:{“id”:“T03FQTJFM9D”,“domain”:“lucid-media-group”},“enterprise”:null,“is_enterprise_install”:false,“channel”:{“id”:“D03GJ4PE3C1”,“name”:“directmessage”},“message”:{“type”:“message”,“subtype”:“bot_message”,“text”:“This content can’t be displayed.”,“ts”:“1655532250.286529”,“bot_id”:“B03L4KJ4EP7”,“blocks”:[{“type”:“section”,“block_id”:“q22”,“text”:{“type”:“mrkdwn”,“text”:“Hello Nate, Adelita Professional Cleaning has viewed the demo site 5 times with no action. \n\n Please Note The Following:”,“verbatim”:false}},{“type”:“divider”,“block_id”:“rRu”},{“type”:“section”,“block_id”:“C1Ay”,“text”:{“type”:“mrkdwn”,“text”:“This is a section block with a button.”,“verbatim”:false},“accessory”:{“type”:“button”,“action_id”:“button-action”,“text”:{“type”:“plain_text”,“text”:“Send Follow Up”,“emoji”:true},“value”:“adelita-professional-cleaning12”}}]},“state”:{“values”:{}},“response_url”:“Slack API | Slack Follow Up”,“emoji”:true},“value”:“adelita-professional-cleaning12”,“type”:“button”,“action_ts”:“1655532848.749297”}]}
I would like to clean this up and then send a clean json structured webhook post from pipedream to my airtable base.
If I’m not using the proper terminology then please forgive me.