03-06-2024 12:26 PM
Hi All.
I am using the webhook payload template editor tool and for some reason unknown to me, I can not access the child object "uplink" I am using the same syntax as per the Meraki Docs.
LIQUID:
{
"alert":"{{alertData.uplink}}"
}The Error I get:
" Failed to load webhook payload template preview. Make sure you're using valid JSON format. ["Body Liquid error: undefined variable uplink"] "
The uplink value does exist:
LIQUID:
{
"alert" : {{alertData | jsonify }}
}JSON:
{
"alert": {
"uplink": "0"
}
}
Example from Meraki docs which I followed to the "T":
https://developer.cisco.com/meraki/webhooks/custom-payload-templates-overview/#overview
Child object properties can also be accessed using the {{foo.bar}} syntax.
LIQUID:
{
"port":"{{alertData.portNum}}"
}JSON:
{ "port": "3" }
Any suggestions would be appreciated, not sure if it is a bug or if I am doing something wrong.
Solved! Go to Solution.
03-07-2024 02:20 PM
This looks like it would work to me, and validates.
}
03-07-2024 02:20 PM
This looks like it would work to me, and validates.
}
03-07-2024 07:22 PM
@matt_ucthanks that worked 😊
03-08-2024 03:36 AM
as @matt_uc correctly suggested:
https://developer.cisco.com/meraki/webhooks/custom-payload-templates-overview/#dig
The alertData property is ... special. Since every alert contains different properties, its sort of a black box to the template language. So, using the "dig" filter runs a function to pull this info out at runtime. That being said, if the nested property is declared, then using the dot.notation works.
We can update the documentation to make this more clear.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide