I got “token ‘U’ at 1:1 Unauthorized request” when I use Newman to run my collection.
JSONError Unexpected token ‘U’ at 1:1
Details (like screenshots):
How I found the problem:
- Run collection via Newman
I’ve already tried:
- Run collection in Postman console
This may not completely resolve the issue but if you are going to use the “long notation” I think you are missing a - from “environment”.
Should be either
--environment (Note the 2x - for the latter)
More info here;
I’m not 100% sure if you can call variables from a file you are also trying to load at the same time… but if you try the dash thing above first and report back, I will look into this further if needed.
Thank you for the response!
Yes, I did use --environment in the command. I didn’t call variables from a file. I just set the environment variables and got the environment URI from:
When you run this command;
$ newman run “[https://api.getpostman.com/collections/$uid?apikey=$apiKey](https://api.getpostman.com/collections/%24uid?apikey=%24apiKey)”
Where are the values for
I got the uid for collections from https://api.getpostman.com/collections?apikey=$apiKey
I got the URI for environment from https://api.getpostman.com/environments?apikey=$apiKey
I created the apiKey in Postman.
I just passed the above value to the newman command line. Where these values should be stored?