Cumulocity rest API authorization issue

Hello,

I’m trying to get the list of devices from Cumulocity REST API,
I’ve created a separate user with all available roles to have the ability to make Basic auth through REST requests.
I’ve downloaded the Postman json file .
Set 2 environment variables in postman:
url =
auth = Basic <base64 encoded tenant, user, password>
Auth was generate by next request: echo -n env420917/vgalchenko: | base64

But when I tried to get list of devices from the endpoint:
{{url}}/inventory/managedObjects?fragmentType=c8y_IsDevice
I got error:
{
“error”: “security/Unauthorized”,
“message”: “Invalid credentials!”,
“info”: “/guides/reference-guide/#a-name-error-reporting-a-error-reporting
}

Could you advise what could be wrong with my request?

Thanks!

What happens if you don’t set auth but use Postmans Basic authentication input boxes and specify the userid and password there?

Yes, with the authorization tab it is ok, thanks!

So compare your Authorization header that works with the one that gave 401. Different?

Hi Vitalii,
you can also login into any UI mask with this user, open the browser developer tools and copy the value auf the Authorization from here:


Then paste this value into the Postman variable list:

1 Like