03-02-2022 04:20 PM
I'm trying to create a custom Config Template Webhook Payload Template.
I'm sending the following body to:
...but am getting "403 Forbidden". Sending bad body content results in 400, so I think that what I have below is OK.
Questions:
Body:
{ "name": "AlertMagic", "headers": "{\n \"Authorization\": \"Bearer {{sharedSecret}}\"\n}", "body": "{\n \"sourceSystem\": \"meraki\",\n \"alertData\": {{ alertData | jsonify }},\n \"alertId\": \"{{alertId}}\",\n \"alertLevel\": \"{{alertLevel}}\",\n \"alertType\": \"{{alertType}}\",\n \"alertTypeId\": \"{{alertTypeId}}\",\n \"deviceMac\": \"{{deviceMac}}\",\n \"deviceModel\": \"{{deviceModel}}\",\n \"deviceName\": \"{{deviceName}}\",\n \"deviceSerial\": \"{{deviceSerial}}\",\n \"deviceTags\": {{deviceTags | jsonify }},\n \"deviceUrl\": \"{{deviceUrl}}\",\n \"networkId\": \"\",\n \"networkName\": \"{{networkName}}\",\n \"networkTags\": {{networkTags | jsonify }},\n \"networkUrl\": \"{{networkUrl}}\",\n \"occurredAt\": \"{{occurredAt}}\",\n \"organizationId\": \"{{organizationId}}\",\n \"organizationName\": \"{{organizationName}}\",\n \"organizationUrl\": \"{{organizationUrl}}\",\n \"sentAt\": \"{{sentAt}}\",\n \"version\": \"{{version}}\"\n}" }
Solved! Go to Solution.
03-11-2022 06:45 AM
Since I wrote this, Meraki have fixed a bug.
The same POST now complains:
"Body Liquid error: undefined variable version"
Removing the final ",\n \"version\": \"{{version}}" from the post body then works.
03-03-2022 02:38 PM
Hi @david.bond ,
Webhook Payload Templates do support Network Config Templates. (I just tested again to verify)
FYI, If you are having issues uploading the templates using Postman, it sometimes gets in the way and will evaluate the {{variables}} before the content is sent to Meraki.
One easy way to avoid this is to create a *.liquid file for your template headers and one for your template body.
You can then use the other API parameters headersFile & bodyFile to upload the files without conflict.
You can find a list of example templates here as well as utilities to help create and manage them..
https://github.com/meraki/webhook-payload-templates
or you can read more on the webhook documentation site
https://developer.cisco.com/meraki/webhooks/#!template-examples-overview
03-11-2022 06:45 AM
Since I wrote this, Meraki have fixed a bug.
The same POST now complains:
"Body Liquid error: undefined variable version"
Removing the final ",\n \"version\": \"{{version}}" from the post body then works.
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