I want to set the authentication only for once and it should be used for all of my APIs that are there in my collection.
Please explain what kind of authentication method your API is using. Kindly through the below link and try to provide as much as details you could, so that we can help you the right way.
If I run the APIs individually its working fine and sending the response 200 OK, but when I run the same APIs in runner it says 401 Error.
I am using OAuth 2.0
Please try to save the token as a variable, like
under pre-request script and try using the variable in your subsequent requests.
Hope this solves the issue.
No, it didn’t worked.
@pranavNathcorp Can you please share more details/screenshot? So is the variable getting stored with the expected token value?
Scenario 1: When running the API alone
Scenario 2: When running the API in runner
Are you placing the token value manually? Or you are passing as variable and refreshing it every run?
Selected the collection -> Edit -> and then entered the authToken
@pranavNathcorp Can you please try storing in a variable as I mentioned above and to access in further requests?
It looks like you have the wrong Authorization type selected in your collection settings. You should select
Oauth 2.0 instead of
I’m making an assumption that you automatically want to renew the token when it expires? If so, you can refer to the following post on how we generally set that up within Postman.
I don’t want to automatic token ,
the problem is like when I run the API alone it shows 200 OK, but when I run it in runner it shows 401 Error and in the Authorization part null value is passed.
Authorization tab of the request you’re sending, is the selected option ‘Inherit from parent’?