2. • API Veteran, Hobbyist Coder, Hands-On Architect
• Building code samples & dev tools, provide feedback, fill gaps
• Manager of a WW team of Developer Advocates
• Application Development Practices (IoT, Collab, Cloud, DevOps)
• Technical lead for the Cisco « API Style Guide »
• What excites me? Providing great Developer eXperiences
About me: //Cisco/DevNet/SteveSfartz
webex: stsfartz@cisco.com
twitter: @SteveSfartz
github: @ObjectIsAdvantag
5. Terminology of a REST API query
GET /../repos?page=1 HTTP/1.1 accept: application/json
HTTP 200 OK
browser api.github.com:443
method path protocol
status code
https://api.github.com/users/CiscoDevNet/repos?page=1&per_page=2
headers
URL:
response body
HTTP
request
HTTP
response
api endpoint
JSON payload
parameters
7. HTTP Request : Methods
GET – retrieve contents from the server
HEAD – only get the HTTP headers & status code (don't GET the body)
PUT – update content
PATCH – partial update
POST – create content
DELETE – delete content
OPTIONS – retrieve contextual information before issuing a request
check W3C RFC 7230-7 to get an exhaustive list of HTTP/1.1 methods
31. Developer Resources
• Postman collections for Webex Teams REST API
• https://github.com/CiscoDevNet/postman-webex
• Postman collections for Webex Devices xAPI
• https://github.com/CiscoDevNet/postman-xapi
• Postman collection for Meraki
• https://communities.cisco.com/community/developer/meraki/blog/2
017/05/30/postman-collection-for-the-meraki-dashboard-api--
updated
• https://documenter.getpostman.com/view/897512/meraki-
dashboard-api/2To9xm
32. Join DevNet by scanning the QR code and becoming a member. Learn about what we have to offer in
the booth and why Cisco is atWeb Summit. Go to a specific demo pod based on interest, sign up for
mentoring, go to our web site to learn more.
Join Cisco DevNet sessions today!
33. Join DevNet and talk to our mentors available about how you can engage and get started with Cisco DevNet.
You can also attend a workshop on Wednesday or separate session for startups or design thinking or how to
build bridges from applications to infrastructure.
34. If you’re a customer or partner, book your visit at the Cisco Innovation Center closest to you
Learn more about the Innovation Center
in Italy:
Innovation Exchange
link: https://www.cisco.com/c/m/it_i
t/campaigns/digitaliani/innovazione
/innovation_exchange.html
Learn more about Innovation Center
Network:
IC network
Link: https://www.cisco.com/c/e
n/us/solutions/innovation-
centers.html
Hinweis der Redaktion
Advanced Postman for better APIs:
with 5 million developers, Postman is the defacto tool to design and test your APIs.
Join this session to learn about Postman more advanced features.
If you have not installed Postman, this is the last call.
Go to getpostman.com,
Click Chrome App for the purpose of this training
The same HTTP principles that apply to the Web (HTML page) - apply to Web APIs
Here ‘s what happens when you consume the github API,
More concretely :
you hit an Endpoint (here the host: github.com, port: 443), remember it is what HTTPS defaults to,
the connection is established and the HTTP protocol is used as specified by the scheme,
the resource path /CiscoDevNet is asked for, with a GET method,
the web browser adds an Accept Header to the request because an HTML page is what it expects the server to return
This is the request, now let’s look at the answer :
the github server returns on the same channel a response with the statuts code 200 to tell everything went OK
and it writes the JSON contents on the wire
Now, we got this HTTP intrinsics, we’re ready to place the call over the wire with POSTMAN.
-- ADVANCED
DO : open Chrome, go to github, open Dev Toolbar, show what’s happening
Several resources are being accessed
To different endpoints
And different types of Data are being sent and received.
That’s the way the Web works, we issue HTTP calls, asking for resources.
Then all you need to know to start building calls yourself.
Now let’s place our HTTP request to github.com
Leave the GET method as is.
Enter the URL of the resource.
Press the Send button
DO : open POSTMAN, issue the call https://github.com/CiscoDevNet
Postman issues the HTTP call on your behalf, and shows the response transmitted by the Github service :
statuts of 200 OK if everything went ok
If you get 404, the URL is malformed
The HTML page contents are placed in the Body
Note that the HTML content-type specified by the server is also displayed
If you encounter an issue, ask for assistance in the Spark room and sending a Snapshot of your work in Postman may be your best bet to get an hand from the team.
First, let’s start with the methods.
We’ve just experienced GET with the Postman calls.
The 4 major methods are GET / POST / PUT / DELETE
These methods enable HTTP Clients to create / read / update / delete Contents on the Web API Server.
Worth mentionning other methods exists : HEAD, PATCH, OPTIONS, though you probably won’t use them during your first interactions with Web APIS.
A Postman collection regroups a set of API requests
You can save any requests you forge manually into a collection, group several requests and share your collections with Postman
If you need to inject dynamic parameters such as API token you can inject them using the {{ variable }} notation.
Note that it is also possible to share environments with Postman
And enrich your environment on the way
[sudo] npm install newman -g
Export your collection
Run newman
> newman run "Postman_Tour.postman_collection.json"