Howdy out there in Automation land!!! And a belated Happy 2017 to you all as well. Hopefully the near year has brought you a renewed vigor and you are ready to buckle down and automation more. Today's blog and video are an example of the framework and some of the things I do when making API calls to other applications with CPO. Today we are going to highlight SmartSheet and their API. Smartsheet is an excel/project/general sheet software in the cloud and we are going to look at how we can write a great API call for that API and use it!
A couple of key points when writing a smart API call...
Understand that just because your process (in CPO) succeeds does not mean your API call was successful or returned the data you needed.
Know how to handle output from your API calls properly and what to (and what to not) give back to an end user who is using your calls
Do your best to cloak information and non-archive as much as possible
Try to use custom target types to separate your API set/calls from the generic Web Target
Use cool icons to show off your API! :)
So how do we do some of the above??? For error handling we must be able to take the output of the API in and determine whether the call was successful (from an API standpoint) or not. Then alert the end user to that fact. If the API call fails due to authorization or maybe due to an incorrect input, the call will return bad data... however CPO would take that data and pass it on and mark the process as succeeded. Which is technically true, but not what you wanted! So you have to put error handling/exception handling into your code/API framework to be able to deal with this and alert you to that fact. You will see the framework I have setup to handle this. Personally I use a process event trigger setup coupled with my Content Logger.
What about cloaking data?? Let's make good use of the encrypted string variable type! It keeps things hidden from the end-user in the GUI. Also, do not archive your API calls (process archival). It just creates more "bulk" in the DB and is unneeded. Normally I create a global variable and call it "Debug" and when it's true, I archive, when it's false, I don't!
The TAP I have started on the tap emporium post, anyone is welcome to it, knowing it's not supported and opensource content in nature. It does require Content Logger, My Automation Toolkit, and my PO Rest API TAPs as well. All are the same... not supported and opensource in nature. If you have issues with them you can reach out to me or post in the comments.
The rest of the points above...well you are just going to have to watch the show! So... ONTO THE VIDEO!
Thanks as always to all my wonderful readers and those who continue to stick with and use CPO. Big things are on the horizon and I hope that you will continue to use CPO and find great uses for it! If you have a really exciting automation story, please email me it! (see below) I would love to compile some stories and feature customers or individual stories in an upcoming blog!!!
AUTOMATION BLOG DISCLAIMER: As always, this is a blog and my (Shaun Roberts) thoughts on CPO and automation, my thoughts on best practices, and my experiences with the product and customers. The above views are in no way representative of Cisco or any of it's partners, etc. None of these views, etc are supported and this is not a place to find standard product support. If you need standard product support please do so via the current call in numbers on Cisco.com or email email@example.com
Hello,we have a UCS mini implementation with a pair of FI6324s and we would like to acquire a pair of Nexus switches which will be strictly used for the interconnection between the FIs and 3 Netapp AFF C190 Storage Arrays. The blades (four actually) are B...
Hi All, Is there any CLI command available on Cisco ACI Leaf to check the live traffic statistics on particular interface...as like we are checking with IOS / NX-OS with "sh interface eth1/2" This command is working on Leaf But not showing...
I'm trying to find some documentation for the MDS9148S Switch that proves the support of the following port types: F_Port (Fabric), M_Port (Mirror Port) and E_Port (Switch-to-Switch). I easily found F_Port and E_Port:Fiber Channel standard port types...
I am trying to find out where zoning changes are logged to. For example, an admin creates a new zone, adds it to the active zoneset and commits the changes (we usually do this via CLI). A little while later we get a report of an issue and...
Hi Cisco experts, I need your help to understand why the VRFs have to be configured with a set of "route-target both auto" and "route-target both auto evpn" in a Fabric with VXLAN BGP EVPN. Knowing that the Fabric can work normally with a set of ...