Parsing webhook data as x-www-form-urlencoded

I’m trying to set up an automation to take the incoming caller ID as per API References

It sends the POST request using application/x-www-form-urlencoded

Has anyone got an example of how this should be parsed?

From what I read it should use a filter and ‘urlencode’ but I’m not sure exactly what this means

This is the data

trigger:

platform: webhook

webhook_id: sipgate

data:

__type: <class 'multidict._multidict.MultiDictProxy'>

repr: >-

<MultiDictProxy('event': 'newCall', 'direction': 'in', 'from':

'447976002117', 'to': '441416111332', 'callId':

'54566B150B0C0D3A5D53435F57597E57525B575D535E515A785E515B45524252434747585A57',

'origCallId':

'54566B150B0C0D3A5D53435F57597E57525B575D535E515A785E515B45524252434747585A57',

'user[]': 'A8ree', 'userId[]': 'w0', 'fullUserId[]': '1631325w0',

'xcid': '92de953efcecfc7a')>

query:

__type: <class 'multidict._multidict.MultiDictProxy'>

repr: <MultiDictProxy()>

description: webhook

id: '0'

I want to use this in an automation to announce the incoming caller - ideally using a contacts lookup.

Can anyone help?

1 Like

I have the same problem. Even trying to show data as text in notification does now work. Tried trigger. data, trigger.data.repr :frowning: what is this mysterious __type and how we can use it?

2 Likes

I know this is an old thread, but it helped me figure out how to use trigger.data in my Webhook so in case it helps others - despite the trace for the automation looking like the data is under trigger.data.repr, it’s actually already keyed. So in the first post I would expect “trigger.data.event” to be “newCall”, “trigger.data.direction” to be “in”, etc.

I hope someone can help us with this