[2023 kcdc] 10 things about postman everyone should know

Speaker: Pooja Mistry

Twitter: @poojamakes

Public workspace- https://www.postman.com/devrel/workspace/2023-10-postman-features-everyone-should-know/overview

For more, see the table of contents.


Notes

  • Moving towards an API first world
  • Postman started in 2012 with a Chrome extension. Evolved into full API platform
  • More than just sending requests – ex: collections, documentation, servers
  • Web and app versions
  • Newman – CLI for postman
  • Collections, env vars, queries, etc have own id
  • Different life cycle for two personnas: producer of APIs (define, design, developer, test, secure, deploy, observe, distribute) an consumer of APIs (discover, evaluate, integrate, test, deploy, observe)
  • Test tab to test the API. Example – pm.test(“assert text”, function () {}
  • Protocols – graphql, websocket, grpc, socket io, etc
  • Scripts – can run before and after graphql
  • Pre-request script – ex: debugging
  • Can pass in $randomXXX of various types in your postman call

Postman API

  • Sign in and fork workspace if want to play with the public workspace for this talk
  • Postman has own API. ex: CRUD for collections, envs etc
  • Some clients use collection as the deliverable and then get metrics on it.

Postman echo

  • Sends back whatever you send in.
  • When pass in get params sends back json with args map being your params.
  • Post sends the text back as the data key in json.
  • Always echos headers as well

Postman visualizer

  • Can build UI in postman
  • Visualize tab on result. Put pm.visualizer.set(template, response: pm.response.json() in test tab.
  • Can use to make charts, maps, csv, etc
  • The template is HTML (which can contain JavaScript)
  • Postman provides a library of templates that you an copy/paste
  • Also see https://learning.postman.com/docs/sending-requests/visualizer/ and https://www.postman.com/postman/workspace/more-visualizer-examples/overview

Built in Libraries

  • Can automatically use faker,js, lodash, moment.js, chai.js and cryto-js
  • Ex: lodash.functionName()

Workflow Control

  • Scripting allows oops and conditionals
  • postman.setNextRequest() lets you change the order of requests in a collection
  • pm.sendRequest() allows sending multiple APIs at once
  • Collection and environment variables let you communicate between APIs

Mock Servers

  • Create a mock server in UI
  • This gives you a URL
  • Can deactivate mock server
  • Set data to return

Code Generation

  • Includes Java, curl, Node.JS, etc for requests
  • For providers, less choices but still a number

Test Automation

  • Bread and butter of postman
  • Can run manually
  • Can schedule API runs
  • Can report on results of API over time – ex: monitoring
  • Can use Newman and generate how to run CLI on other CICD: ex: Jenkins, CircleCI, GitHub Actions, Gitlab, etc
  • New: June 15 – can do performance testing using desktop client. Gives response time graph

Flows

  • Visual diagram showing order/connection/variables.
  • Can include dashboards in flow

Docs

  • Markdown syntax: https://daringfireball.net/projects/markdown/syntax
  • Can embed images
  • If documented well, can share with others
  • Explore tab shows all public APIs across Postman. Best ones are well documented.
  • Can include link to show what person/company created.
  • Can have creator workspace and aggregate your collections
  • Get help at – community.postman.com

Can try most for free. CLI not free

My take

I like that she used Postman (a public collection) and demos for most of the presentation. A lot of the features described were new to me. Excellent start to the morning.