Now in Beta: Callbacks are available for /ping, /pingDevice, and /actionBatches!

ana_nennig
Meraki Employee
Meraki Employee

Now in Beta: Callbacks are available for /ping, /pingDevice, and /actionBatches!

LiveTools and Action Batches... now with Callbacks!

 

Find the original post in @DexterLaBora's API Early Access Announcement Community here

 

This snazzy update was made possible as a result of our recent OpenAPI v3 adoption, which has enabled us to improve the way we handle long-running tasks.

 

With the addition of "callbacks", async API requests can now be configured to deliver results via a webhook when they are ready. This is particularly useful in scenarios such as pinging a device for an extended period of time, or running an asynchronous Action Batch to deploy configurations at scale.

 

What's New?

Check out these Dashboard API endpoints, where this feature is now available in beta:

 

 

Imagine not having to constantly check the status of your tasks. This new feature will significantly increase the efficiency of working with liveTools, avoiding the need to make an additional GET request to pull the status for the ping or action batch results.



Example of /ping with the new callback property as well as a section to understand what Callbacks you will receive via a webhook.

 

ana_nennig_0-1690566517566.png

 

/ping with callback

CALLBACKS (NEW SECTION)

 

ana_nennig_1-1690566517575.png

 

Callback schema (the webhook body)

Quick Start

 

  • Use a callback with the Ping live tool

POST /devices/:serial/liveTools/ping

 

 

{
     "target": "8.8.8.8",
     "count": "5",
     "callback": {
          "url": "https://webexapis.com/v1/webhooks/incoming/<some-dynamic-url>"
     }
}

 

 

Webhook.site test results

ana_nennig_2-1690566517573.png

 

OTHER THINGS TO TRY

  • Use a callback with Action Batches
    • Create an asynchronous action batch to deploy changes and receive the callback with the results. 

POST /organizations/:organizationId/actionBatches

 

{
    "actions": [
        {
            "resource": "/networks/{{networkId}}/clients",
            "operation": "provision",
            "body": {
            "clients": [
                {
                    "mac": "00:11:22:33:44:55",
                    "clientId": "k74272e",
                    "name": "Miles's phone"
                }
            ],
            "devicePolicy": "Group policy",
            "groupPolicyId": "101"
        }
        }
    ],
    "confirmed": true,
    "synchronous": false,
        "callback": {
        "url": "https://webhook.site/f58fec85-xxxx"
    }
}

 

 

webhook.site results

ana_nennig_3-1690566517574.png

 

Note: The Callback (included) and custom webhook payload template support is still under development, so mileage may vary. 


We believe that this new feature will make a significant difference in your work and we can't wait for you to try it out. 

As always, your feedback is invaluable to us. Please feel free to share your experiences, thoughts, and suggestions with us in the comments below.

 

Learn more about Meraki Webhooks

Ana Nennig
0 Replies 0
Get notified when there are additional replies to this discussion.