Your question may already have an answer on the community forum. Please search for related topics, and then read through the guidelines before creating a new topic.
Here’s an outline with best practices for making your inquiry.
My question: POSTMAN: How to delete multiple Resource IDs in one go?
Details (like screenshots):
I have a list of 30 resources IDs and would like to use {{url}}/resource_delete on Postman adding this list of IDs
How I found the problem:
N/A
I’ve already tried:
{
“id”: “{{id}}”
}
let resources = pm.collectionVariables.get(“resources”);
if(!resources || resources.length == 0)
{
resources = [“ba08971c-83de-777c-beb2-2dbe91e727e6”,
“c6ec9412-e19e-999-bcc8-0a9900f3c0ba”,
“268e8bd9-3381-0000-81d3-38fd4fa11110”
];
}
let currentResources = resources.shift();
pm.collectionVariables.set(“id”, currentResources);
pm.collectionVariables.set(“resources”, resources);
const resources = pm.collectionVariables.get(“resources”);
if (resources && resources.length > 0){
postman.setNextRequest(“multiple_resources_delete_inonego”);
} else {
postman.setNextRequest(null);
}
pm.test(“Status code is 200”, function () {
pm.response.to.have.status(200);
});
But it doesnt loop. I have to run (pushing the button SEND) 3 times to delete these 3 resources