0
0
Postmantesting~10 mins

Custom documentation templates in Postman - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set a custom documentation template in Postman.

Postman
pm.documentation.setTemplate([1]);
Drag options to blanks, or click blank then click option'
AsetTemplate
BcustomTemplate.html
C'customTemplate.html'
Dtemplate
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put quotes around the template file name.
Passing a variable name without defining it.
2fill in blank
medium

Complete the code to add a variable to the documentation template context.

Postman
pm.documentation.addVariable([1], 'API Version');
Drag options to blanks, or click blank then click option'
A'version'
Bversion
CapiVersion
D'apiVersion'
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted variable names which may cause errors.
Using a wrong variable name.
3fill in blank
hard

Fix the error in the code to correctly set the documentation template.

Postman
pm.documentation.[1]('customTemplate.html');
Drag options to blanks, or click blank then click option'
AtemplateSet
Bsettemplate
Cset_doc_template
DsetTemplate
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect casing in method names.
Using method names that do not exist.
4fill in blank
hard

Fill both blanks to add title and description variables for the documentation template.

Postman
pm.documentation.addVariable([1], 'My API'); pm.documentation.addVariable([2], 'This API handles requests.');
Drag options to blanks, or click blank then click option'
A'title'
B'desc'
C'description'
D'summary'
Attempts:
3 left
💡 Hint
Common Mistakes
Using variable names that do not match the template placeholders.
Forgetting quotes around variable names.
5fill in blank
hard

Fill all three blanks to define a custom template with placeholders for name, version, and description.

Postman
const template = `<h1>[1]</h1><p>Version: [2]</p><p>[3]</p>`;
Drag options to blanks, or click blank then click option'
Aname
Bversion
Cdescription
Dtitle
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up placeholder names.
Using keys not defined in the context.