I’m following the course instruction to use postman. However, after token is generated successfully, when use the genenrated token to call the API such as list asset, I got 401 "Unauthorized" error as follows
{
"error": {
"code": 401,
"message": "Unauthorized"
}
}
The following is my env and auth settings
Best answer by Wei Wu
Right I dont have api-key under Headers section.
I double checked the list request, and it seems it does not recognize “{{project}}” env for some reason although it is defined together with other envs such as {{baseUrl}}.
So I replaced the {{project}} with “publichdata”, and it then works.
We don’t use API-keys in postman anymore! But Wei, double check that you have selected the correct environment (upper right corner) and that there are no extra spaces in the variables or current values :)
Also, when you are in the Authorization (under Cognite API v1) and have got the token, you also need to click save (upper right corner). An indication that something is not saved, is this orange dot on the tab that you see in my picture below. Please click save (the orange dot will disappear and then try to list assets again :)
I double checked the list request, and it seems it does not recognize “{{project}}” env for some reason although it is defined together with other envs such as {{baseUrl}}.
So I replaced the {{project}} with “publichdata”, and it then works.
I have tried all the solutions above. Yet, I’m having the “401 unauthorize error” can anyone please help me resolve this issue. I have attached the error below.
@Muhammad can you please share screenshots of the authorization tab of the collection and the enviroment(please make sure to remove secrets when sharing).
@Muhammad It’s bit hard to troubleshoot your issue with the provided screenshots. I’ll create a support ticket for this issue and our support team will reach out and help you to resolve it.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.