postman-docs
postman-docs copied to clipboard
Incorrect content regarding webhooks
This page - https://learning.getpostman.com/docs/postman/monitors/integrations_for_alerts/ - mentions that globals.previousRequest can be used to retrieve data passed to the webhook when run via the Postman API.
This is incorrect - globals.previousRequest is only valid for cases where a webhook is fired using the monitor's slug (which is an internal-only feature). For webhooks triggered via the Postman API, globals.previousRequest isn't populated.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@abhijitkane should I just remove that whole section from the doc? Am not entirely sure how much of this page is still valid in general..
There is documentation for using the webhook here: https://documenter.getpostman.com/view/804329/71FWAgx?version=latest#create-a-postman-monitor
Create a Postman monitor There are currently 2 ways to run a Postman monitor on-demand. You can manually run a monitor from the Postman web dashboard, or you can use the Postman API to run a monitor, but these methods don't allow you to send a payload. This on-demand Postman monitor - which functions like a webhook - will receive the payload sent by Slack and start the "Librarian" collection run. Note: Postman webhooks are still under development, and not yet recommended for commercial use. Generate an API key from the integrations dashboard to access the Postman API. Retrieve all your collections by sending a GET request to https://api.getpostman.com/collections, and don't forget to add the x-api-key header using your Postman API key. Find (CMD/CTRL + F) the "Librarian" collection in the response and make a note of the uid field. This is your collection ID. Retrieve all of your environments by sending a GET request to https://api.getpostman.com/environments, and don't forget to add the x-api-key header using your Postman API key. Once again, find (CMD/CTRL + F) the "Librarian" collection in the response, and make a note of the uid field. This is your environment ID. Now, let's create a Postman webhook. Create a new POST request to https://api.getpostman.com/webhooks, again adding the x-api-key header. For the body, select raw, change the type to JSON, and add the example body below. Send the request, and copy the webhookUrl from the response. We will use this webhookUrl in the Slack app configuration as the Request URL, essentially telling Slack to run the Postman monitor when the Slack command is triggered.
Body of the POST request is in the screenshot from the Librarian documentation.
If you get this error (if you're not in workspace called MyWorkspace
):
"error": {
"name": "notInWorkspaceError",
"message": "The entity is not in the specified workspace"
}
}
Try creating the webhook by passing the workspace ID in a X-Workspace-Id
header or in the request body via workspace
property inside webhook?
Documentation should also show how to debug using the Monitors console in the web dashboard.
Hi @abhijitkane @jkonrath-postman I would like to work on this issue. Kindly assign it to me.