Collection Bearer Authentication Works in Postman but not Newman webhook

My question: When I use Postman to run individual requests in a collection, they successfully authenticate using the same Bearer token stored in a global variable.

When I use my SaaS app to trigger the collection from a Newman webhook, I get a 401 response on the individual calls.

Any suggestions of where I might start looking?

Details: I created a Newman webhook URL (api.getpostman.com/webhooks?workspace) for my SaaS app to trigger a collection.

  • The first call parses the payload and assigns variables for later use.
    *The second call in the collection generates a Bearer token from the app and stores it as a global variable.
    *The third call uses the globally stored Bearer token to POST an update to the record from the original payload.
    *The fourth call uses the globally stored Bearer token to GET additional record information about the record from the original payload.

How I found the problem: Running the collection from Postman works as expected but running the collection by calling the Newman webhook URL returns a 401 response on the third and fourth calls.

I’ve already tried: I am logging the Bearer token and it displays in Postman console. In the Monitor console, the value shows blank.

Is there some nuance with Newman webhook and collections that I missed?

Hi @rmjonesjr

Are you specifying the global variable file when running Newman (using the -g option)?

Run options can be found here;

Sorry for the confusion…I am not running the collection from Newman CL.

I created a webhook URL that calls the postman API via newman-api.getposman.com/run. My app triggers this webhook and passes a payload back to the collection.

The first request in the collection, POST https://postman-echo.com/post, parses the payload correctly.

Is it possible to trigger the webhook URL from Newman CL to better represent the call from the app?