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 Team! Im trying to clear a endpoint from a L3out, but i couldn´t do it. I used this link:https://community.cisco.com/t5/application-centric/aci-how-to-clear-endpoint-manually/td-p/3062011And i used these commands: # vsh# clear system inter...
Hello, With ACI verion 4.2(i) and vCenter 6.7, I'm trying to install Cisco AVE in the vCenter. I followed the steps in the "Cisco ACI Virtual Edge Installation Guide, Release 2.2(x)", but when I get to "Cisco ACI Virtual Edge Installa...
Good day I am trying to figure out how i can get more information about traffic going through the SVI on NXOS."show interface x and show interface vlan x" on the IOS platfrom show "load-intervall".This is the same on the NXOS with the "show interface...
Folks,I recollect that we have some routing consideration to take care when we go with a VPC vs a port-channel configurations but I am unable to recollect what are those. Can someone help me take a look at the below configuration that we have in plac...