How to save example with auth headers?

My request uses bearer token for authorization.

Especially for the postman documentation, I created a perpetual token and saved it in variables.

I run the request, get the response, click the “save as example” button, enter a name for the example and click save button.

Then I click “view documentation” link, click “generate documentation” and in a separate tab I see the result - the generated documentation along with example queries.

The problem

The problem is that the code samples in all languages ​​are missing authorization tokens in all examples.

Expected result

CURL for example:

curl --location --request GET 'https://foo.bar/api/v1/users' \
-H "Authorization: Bearer xxx" \
--data '{
    "per_page": 1,
    "ccode": "US"
}'

Actual result:

curl --location --request GET 'https://foo.bar/api/v1/users' \
--data '{
    "per_page": 1,
    "ccode": "US"
}'

Hi @c80609a. Welcome to the Postman Community.

I have raised this internally with the team to get some clarity on what could be going wrong here.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.