# Cumulocity rest API authorization issue

**URL:** <https://community.cumulocity.com/t/cumulocity-rest-api-authorization-issue/7789>\
**Category:** Forum\
**Tags:** cumulocity\
**Created:** [September 16, 2022, 12:50pm UTC](https://community.cumulocity.com/t/cumulocity-rest-api-authorization-issue/7789 "2022-09-16T12:50:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vitalii.galchenko](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@vitalii.galchenko](https://community.cumulocity.com/u/vitalii.galchenko)\
**Post date:** [September 16, 2022, 12:50pm UTC](https://community.cumulocity.com/t/cumulocity-rest-api-authorization-issue/7789/1 "2022-09-16T12:50:32Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Robert\_Neale](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/robert_neale/32/31965_2.png) [@Robert\_Neale](https://community.cumulocity.com/u/Robert_Neale)\
**Post date:** [September 16, 2022, 1:17pm UTC](https://community.cumulocity.com/t/cumulocity-rest-api-authorization-issue/7789/2 "2022-09-16T13:17:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vitalii.galchenko](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@vitalii.galchenko](https://community.cumulocity.com/u/vitalii.galchenko)\
**Post date:** [September 16, 2022, 3:16pm UTC](https://community.cumulocity.com/t/cumulocity-rest-api-authorization-issue/7789/3 "2022-09-16T15:16:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Robert\_Neale](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/robert_neale/32/31965_2.png) [@Robert\_Neale](https://community.cumulocity.com/u/Robert_Neale)\
**Post date:** [September 16, 2022, 3:30pm UTC](https://community.cumulocity.com/t/cumulocity-rest-api-authorization-issue/7789/4 "2022-09-16T15:30:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Christian\_Herzog](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/christian_herzog/32/32209_2.png) [@Christian\_Herzog](https://community.cumulocity.com/u/Christian_Herzog)\
**Post date:** [September 19, 2022, 8:23am UTC](https://community.cumulocity.com/t/cumulocity-rest-api-authorization-issue/7789/5 "2022-09-19T08:23:23Z")

</div>

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:

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/d/5/d59951ddd74ff84760accd63e9b0d01b14d39f71.png)  
Then paste this value into the Postman variable list:  
 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/f/b/fbaacfac207dc2f4d0f5bed781f152f77cced99d.png)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [March 18, 2023, 8:23am UTC](https://community.cumulocity.com/t/cumulocity-rest-api-authorization-issue/7789/6 "2023-03-18T08:23:40Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
