Cloud Newman me (Run your collection as an API)

I’m working on two projects for the hackathon. https://www.cloudnewman.me/postman is one of my projects and hopefully developers will find it helpful. It’s probably too late for people to use, but if you are interested after the hack I’d love your feedback. Between now and tomorrow at 5PM I’m mostly focused on my second project (CoinStop) but I can answer any questions after 5PM. CoinStop is going to host a web page (on github.io) that makes calls to CloudNewman and renders the results from the collection on the web site. We are also going to do some cool Vonage integration so you can get a link from your phone, but that probably won’t happen until after the hack is over (we have Discord working so that’s good enough for now.)

Users of CloudNewman are likely people building apps that want a JSON response back from their collection & want to call their collection passing specific query parameters. Or basically whenever you don’t want to use Newman API/CLI directly in your environment. Or some webhook that you want to integrate into your collection.

CloudNewman is easy to use… (be sure you are passing the UID values for your collections and environment and not the ID value. get those from https://api.getpostman.com/environments?apikey={key} and https://api.getpostman.com/collections?apikey={key}. if you don’t know your apikey, you can make generate one at https://go.postman.co/integrations/services/pm_pro_api)

Cloud Newman me documentation

Sample call…

POST /v1?foo=testing123 HTTP/1.1
Host: www.cloudnewman.me
Content-Length: 154

{
“collectionuid”: “{{collection_uid}}”,
“environmentuid”: “{{environment_uid}}”,
“environmentoverlayuid”: “{{environment_overlay_uid}}”
}

Sample response…

{
“m”: “hello”,
“r”: {
“args”: {
“msg”: “hello”
},
“headers”: {
“x-forwarded-proto”: “https”,
“x-forwarded-port”: “443”,
“host”: “postman-echo.com”,
“x-amzn-trace-id”: “Root=1-something”,
“user-agent”: “PostmanRuntime/7.26.10”,
“accept”: “/”,
“cache-control”: “no-cache”,
“postman-token”: “something”,
“accept-encoding”: “gzip, deflate, br”,
“cookie”: “sails.sid=something”
},
“url”: “https://postman-echo.com/get?msg=hello
},
“f”: “foo is set to testing123”
}

The code in my Collection that I passed the collection_uid for ends with this…

if (pm.response.status === “OK”) {
const response = pm.response.json();
const message = response.args.msg;
const answer = {
“m”: message,
“r”: pm.response.json(),
“f”: pm.variables.has(‘foo’) ? foo is set to ${pm.variables.get("foo")} : ‘no foo defined’
};
console.log(JSON.stringify(answer));
} else {
console.log(Error!!! Status code was ${pm.response.status});
}

Hopefully that makes sense. You console.log(JSON.stringify(myVariableName)); in your scripts and whatever that object is will be the JSON response you get back from the CloudNewman API.