Auth is not added correctly, Day4 Submit your solution

environment=18582358-813ac972-d9e7-499c-b318-062ff72f6307

this is my workspace link above is there anyone take a look the failure.
I have added collection-level aut for the requests under Authorisation package but but I could not add Vault variable the request for submit collection under Submit your collection package ? how I can fix it ?
Really appreciate if you have chance to take a look?
I am receiving this error message
Auth added correctly | AssertionError: check the api key: expected '{{postman_api_key}} ’ to contain one of [ β€˜X-api-key’, …(1) ]

First of all, you need to remove the postman_api_key header you have added and also deleted that token as it was in plain text in your Public Workspace.

We use Postman Vault so data like that is not exposed. Please don’t hardcode any sensitive data in your Workspace.

The Collection Auth should be using {{vault:postman_api_key}} and reading that from your Postman Vault.

Hi @danny-dainton
I have updated but this time Day04 All Collections - header request gives this error below

    "error": {
        "name": "AuthenticationError",
        "message": "Invalid API Key. Every request requires a valid API Key to be sent."
    }
}```

This is my [WorkSpace link](https://www.postman.com/zehraie/workspace/zehranewlasttr/request/18582358-a0cbb961-7369-4256-9128-4b6eabd86940?action=share&creator=18582358&ctx=documentation&active-environment=18582358-813ac972-d9e7-499c-b318-062ff72f6307) what can be the reason ?

Have you added the API key to your vault?

On the web platform, Are you using the desktop agent? Or the Cloud Agent?

yes I have added Api key to my vault.
I am using desktop agent.

You have a duplicate variable in there, one of those might be invalid.

I would delete all of them and create a brand new vault variable which contains a newly created Postman API Key. That way you will know that it’s the only one and it’s valid.

I did deleted all and I created the brand new as you mentioned but still same result under Day4 package only All Collections - header request is not working and I am receiving same error as it is below

    "error": {
        "name": "AuthenticationError",
        "message": "Invalid API Key. Every request requires a valid API Key to be sent."
    }```
![Screenshot 2024-07-25 at 23.02.41|690x429](upload://ltPXD5ZcrZ1CTNjErG7jrzOwbaZ.jpeg)

The screen-shot

why only All Collections - header is not getting respond , am I missing something

Is the Auth set to inherit from parent?

Do the set the Auth at the Collection level again?

https://www.postman.com/zehraie/workspace/zehranewlasttr/collection/18582358-66acb108-ddc6-484e-91f6-920b841b4a3c?tab=authorization

Awesome @danny-dainton thank you very much indeed it is worked now, t

1 Like