Complete the code to create a new collection in Postman.
const collection = new pm.[1]('My API Collection');
In Postman scripting, pm.Collection is used to create a new collection object.
Complete the code to add a folder named 'User Endpoints' to an existing collection.
const folder = collection.[1]('User Endpoints');
The add method is used to add a folder to a collection in Postman scripting.
Fix the error in the code to retrieve all folders from a collection.
const folders = collection.[1]();In Postman scripting, collection.folders is a property that holds all folders; it is not a method.
Fill both blanks to add a request named 'Get User' to a folder.
const request = new pm.Request('[1]', 'https://api.example.com/user'); folder.[2](request);
The request name should be 'Get User' and the method to add a request to a folder is addRequest.
Fill all three blanks to create a collection with a folder and add a request to that folder.
const collection = new pm.[1]('My Collection'); const folder = collection.[2]('API Folder'); const request = new pm.Request('List Items', 'https://api.example.com/items'); folder.[3](request);
Use Collection to create the collection, add to add a folder, and addRequest to add a request to the folder.