Showing results for 
Search instead for 
Did you mean: 

Pondering Automation: No REST for the Weary

Cisco Employee

Howdy out there in Automation Land! I hope everyone is getting ready for summer and enjoying those last few weeks of school before the kids run home for their summer break. I had a great response from the python comparison blog before so I decided to take another stab at it and do a more "complex" version. This version is going to aim at making API calls. We are no longer looking at just some basic coding examples, we are wanting to make calls to servers and handle the responses from those calls... so speaking of lots of calls... how about this movie poster?




Little scary and a little exciting at the same time... right? Anyways, we are going to look at a couple of things and a couple of tools that will be vital to you writing API calls and handling them in both Python and Cisco Process Orchestrator.


So we will want to write an easy "GET" call and an easy "POST" call. I needed to fine something easy to execute against as well so I found this...


It is a great place to test some web calls against and make the most out of your testing. It is a fake web server that will return output to you. It is perfect for our demo here as you can copy exactly what I am doing and there is no authentication scheme needed to follow.


The other tools that I love for this are for your json path query needs and the XML Tools plugin for to deal with your XPath Query needs. This would both be useful, but more so if you are doing work in CPO.


Here is the "finished" code we will work on in the VOD:


import requests
## GET

parameters = {   'userId': '1'}
r = requests.get('', params=parameters)


body = {   'title':'my title',   'body': 'a small body',   'userId': 1}
r ='', data=body)





See... pretty simple stuff but makes it easy for us to do a comparison between Python and CPO. Just like it was done before, simple code, can grow into something much better and more complex and hopefully will allow you to see and understand more in the CPO space.


Having said that... ONTO THE VIDEO:


Recording password: 93QpFjUR


If you have any questions or want more information... please comment/post below!


Standard End-O-Blog Disclaimer:


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 or email


Thanks and Happy Automating!!!


--Shaun Roberts

Content for Community-Ad
This widget could not be displayed.