Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to export a Postman collection as a JSON file.
Postman
pm.collection.toJSON().[1]('my_collection.json');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'save' instead of 'download' which is not a valid method here.
Confusing 'export' with a method on the collection object.
✗ Incorrect
The download method saves the collection as a JSON file for sharing.
2fill in blank
mediumComplete the code to share a collection link with team members.
Postman
pm.collection.share([1]: 'team@example.com'});
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'to' or 'recipient' which are not recognized keys in this context.
Using 'address' which is too generic.
✗ Incorrect
The email key specifies the recipient's email address to share the collection.
3fill in blank
hardFix the error in the code to correctly import a shared collection JSON file.
Postman
pm.collection.import([1]: 'shared_collection.json'});
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'filePath' or 'path' which are not valid keys here.
Using 'file' which is ambiguous.
✗ Incorrect
The source key is used to specify the file or URL to import the collection from.
4fill in blank
hardFill both blanks to create a new shared workspace and add a collection to it.
Postman
pm.workspaces.[1]([2]: 'New Team Workspace'}).addCollection('My Collection');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'title' instead of 'name' which is not the correct key.
Using 'build' which is not a method here.
✗ Incorrect
The create method makes a new workspace, and name sets its name.
5fill in blank
hardFill all three blanks to update collection permissions for a user.
Postman
pm.collection.permissions.update([1]: 'collectionId123', [2]: 'user@example.com', [3]: 'read'});
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'permission' instead of 'accessLevel' which is not the correct key.
Mixing up the order of keys.
✗ Incorrect
collectionId identifies the collection, email specifies the user, and accessLevel sets the permission type.