# How to register dummy device to get credentials

**URL:** <https://community.cumulocity.com/t/how-to-register-dummy-device-to-get-credentials/3772>\
**Category:** Forum\
**Tags:** device-connectivity, cumulocity\
**Created:** [August 14, 2023, 9:44am UTC](https://community.cumulocity.com/t/how-to-register-dummy-device-to-get-credentials/3772 "2023-08-14T09:44:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaibhavi\_ghumare](https://avatars.discourse-cdn.com/v4/letter/v/a587f6/32.png) [@vaibhavi\_ghumare](https://community.cumulocity.com/u/vaibhavi_ghumare)\
**Post date:** [August 14, 2023, 9:44am UTC](https://community.cumulocity.com/t/how-to-register-dummy-device-to-get-credentials/3772/1 "2023-08-14T09:44:41Z")

</div>

How to create dummy device that I can connect to cumulocity IOT platform with unique device Id?  
Also, how to get device credentials i.e., username and password of that device using postman or any other method.

---

<div class="post-metadata">

**Author:** ![Vachaspati\_Diwevedi2](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/vachaspati_diwevedi2/32/1256_2.png) [@Vachaspati\_Diwevedi2](https://community.cumulocity.com/u/Vachaspati_Diwevedi2)\
**Post date:** [August 14, 2023, 9:48am UTC](https://community.cumulocity.com/t/how-to-register-dummy-device-to-get-credentials/3772/2 "2023-08-14T09:48:38Z")

</div>

@vaibhavi_ghumare

Please try the the Cumulocity Bulk upload feature. you can achieve your requirements. please follow the steps shared in the Cumulocity standard documentation.  
[https://cumulocity.com/guides/users-guide/device-management/#bulk-registration](https://cumulocity.com/guides/users-guide/device-management/#bulk-registration)

  

* * *

Vachaspati Diwevedi

[Software AG Professional Services](https://www.softwareag.com/en_corporate/resources/services/professional-services.html)

[![](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/c/3/c3a93a2618e4708f51be40fe2e142061f7c4edc7.jpeg)](https://www.softwareag.com/en_corporate/resources/services/fast-track-services.html)

---

<div class="post-metadata">

**Author:** ![Hendrik\_Naether1](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/hendrik_naether1/32/17494_2.png) [@Hendrik\_Naether1](https://community.cumulocity.com/u/Hendrik_Naether1)\
**Post date:** [August 15, 2023, 7:48am UTC](https://community.cumulocity.com/t/how-to-register-dummy-device-to-get-credentials/3772/3 "2023-08-15T07:48:42Z")

</div>

If you just need a quick way to create a dummy device, you could as well just start a simulator under Devices \> Simulators in the Device management app. Running a simulator automatically create a new device on the tenant that you could then use to send measurements/alarms/events to.

  

* * *

Hendrik Naether

[Software AG Professional Services](https://www.softwareag.com/en_corporate/resources/services/professional-services.html)

[![](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/c/3/c3a93a2618e4708f51be40fe2e142061f7c4edc7.jpeg)](https://www.softwareag.com/en_corporate/resources/services/fast-track-services.html)

---

<div class="post-metadata">

**Author:** ![vaibhavi\_ghumare](https://avatars.discourse-cdn.com/v4/letter/v/a587f6/32.png) [@vaibhavi\_ghumare](https://community.cumulocity.com/u/vaibhavi_ghumare)\
**Post date:** [August 16, 2023, 1:14pm UTC](https://community.cumulocity.com/t/how-to-register-dummy-device-to-get-credentials/3772/4 "2023-08-16T13:14:38Z")

</div>

I don’t want to create simulator; I want to register device to cumulocity platform and access device credentials for that device.

Also, I am getting access forbidden error when I try to poll device credencials using external Id.  
Code:  
deviceCredentialsRepresentation = deviceCredentialsApi.pollCredentials(id);  
System.out.println(deviceCredentialsRepresentation);  
Error: {error=“security/Forbidden”,message=“Access is denied”,info=“[https://www.cumulocity.com/guides/reference/rest-implementation//#a-name-error-reporting-a-error-reporting",details="null](https://www.cumulocity.com/guides/reference/rest-implementation//#a-name-error-reporting-a-error-reporting%22,details=%22null)”}

---

<div class="post-metadata">

**Author:** ![brkngcn](https://avatars.discourse-cdn.com/v4/letter/b/b5e925/32.png) [@brkngcn](https://community.cumulocity.com/u/brkngcn)\
**Post date:** [August 16, 2023, 2:53pm UTC](https://community.cumulocity.com/t/how-to-register-dummy-device-to-get-credentials/3772/6 "2023-08-16T14:53:44Z")

</div>

Can you share the request you made in postman?

---

<div class="post-metadata">

**Author:** ![vaibhavi\_ghumare](https://avatars.discourse-cdn.com/v4/letter/v/a587f6/32.png) [@vaibhavi\_ghumare](https://community.cumulocity.com/u/vaibhavi_ghumare)\
**Post date:** [August 16, 2023, 3:22pm UTC](https://community.cumulocity.com/t/how-to-register-dummy-device-to-get-credentials/3772/7 "2023-08-16T15:22:31Z")

</div>

![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/2/0/20b39de2b256d60ce3501cf19a0561e41aa3d8ce.png)  
I have tried using externalId, Authorization : Basic / and   
 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/2/9/291097c78243f31dbe92c9691e7981a8391f09e0.png)

And also with the device ID.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/e/e/ee39e5b2a80d2c94f92af843e4a3d2c6a8d906cf.png)  
 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/2/8/28a5fa44050786533c7cf41945d9e654ed0e6b36.png)

Also I have tried the same using DeviceCredencialsApi

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/0/8/08577fc97bd582de2e8a14af2262560e228a288f.png)

---

<div class="post-metadata">

**Author:** ![Korbinian\_Butz](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/korbinian_butz/32/10473_2.png) [@Korbinian\_Butz](https://community.cumulocity.com/u/Korbinian_Butz)\
**Post date:** [August 16, 2023, 3:39pm UTC](https://community.cumulocity.com/t/how-to-register-dummy-device-to-get-credentials/3772/8 "2023-08-16T15:39:30Z")

</div>

The API description tells the "create device credentials” request requires role `ROLE_DEVICE_BOOTSTRAP ` ([link](https://cumulocity.com/api/core/#operation/postDeviceCredentialsCollectionResource))

Can you do a `GET /user/currentUser` ([open api link](https://cumulocity.com/api/core/#operation/getCurrentUserResource)) and copy over the “effectiveRoles” fragment from your reponse? This will list your users current permissions.

---

<div class="post-metadata">

**Author:** ![Korbinian\_Butz](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/korbinian_butz/32/10473_2.png) [@Korbinian\_Butz](https://community.cumulocity.com/u/Korbinian_Butz)\
**Post date:** [August 17, 2023, 6:17am UTC](https://community.cumulocity.com/t/how-to-register-dummy-device-to-get-credentials/3772/9 "2023-08-17T06:17:48Z")

</div>

I’ve did further investigation and found out the `ROLE_DEVICE_BOOTSTRAP` permission is a special one - you cannot grant it to your Tenant User. Instead you should use a pre-existing device bootstrapping user for this call.

To create Device Credentials programatically below steps are needed:

1. Create a device request with your personal/authenticated User. Make sure it has the permission `ROLE_DEVICE_CONTROL_ADMIN` ([api link](https://cumulocity.com/api/core/#operation/postNewDeviceRequestCollectionResource))
2. Try to request Device Credentials via [this](https://cumulocity.com/api/core/#operation/postDeviceCredentialsCollectionResource) endpoint. Important: do not use your credentials, you have to use the bootstrap credentials provided by the platform (see [here](https://community.cumulocity.com/t/cumulocity-mqtt-bootstrap-credentials/709/3) - but use the proper URL)
3. Update the Device Request to “status: ACCEPTED” with your User. ([api link](https://cumulocity.com/api/core/#operation/putNewDeviceRequestResource))
4. Repeat Step 2, this time the response will hold your Device Credentials.

See also the [Device Integration using REST](https://cumulocity.com/guides/device-integration/rest/#step-0-request-device-credentials) section in the docs for more info.

---

<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:** [February 13, 2024, 6:18am UTC](https://community.cumulocity.com/t/how-to-register-dummy-device-to-get-credentials/3772/10 "2024-02-13T06:18:11Z")

</div>

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