Brian and I came up with the idea of a game that you can play in Postman!

The game is composed of three parts:
1) Register for API keys for various services. While registering you will hopefully learn a little bit about what the API offers.
2) Configure your environment correctly. This includes setting environment and collection variables. Some variables need the API keys you obtained, while others might have an initial value of "What is 6+5+4+3+2+1?" and you have to put 21 as the final value.
3) Order the requests in the proper sequence.

When you run the collection, you can reorder the requests, here you can see us moving George Washington to the top of the list. You can also unselect an entry (for example Benjamin Franklin.)
Each request recomputes a hash based on status code and some expected content...
var hash = pm.variables.get('gameHash');
let json = pm.response.json(); hash += pm.response.code;
if (json.environment && json.environment.id) { hash += 'id'; // The id value is not deterministic, so we just use a string. }
hash = cryptojs.SHA256(hash).toString();
pm.variables.set('gameHash', hash);
The last request checks to see if the game hash matches, and if so it shows HTML with audio.
if (actualGameHash === expectedGameHash) { pm.visualizer.set( `<b>You win!</b> <audio controls autoplay> <source src='https://www.soundboard.com/handler/DownLoadTrack.ashx?cliptitle=Never+Gonna+Give+You+Up-+Original&filename=mz/Mzg1ODMxNTIzMzg1ODM3_JzthsfvUY24.MP3' type='audio/mp3'> Your browser does not support the audio tag. </audio>...
It was fun putting together a game for Postman. Sadly, this entry didn't win any prize.
You can check out the video and the Postman workspace here:
Comments