Html Code not able to found


I have created the project thorugh both js and html
it works with js bu this error shows up for HTML
please help me out in this.

@shubham11gupta10 make sure that you have linked this product to the current device. You can find the same in https://docs.boltiot.com/docs/link-device-to-a-product .

I guess if you are saying that you have ran the same program with the js code and you are facing this issue with the html code. The reason is that there are some errors in the script tag. Folllow any of the two mentioned ways to rectify that:

First Way:
In the script tag, you have to write the API_KEY in single quotes only, no need of { } is there. FIrst of all, make sure that the API_KEY and the device name are correct because I think you have written the wrong device name. The default device_name must be like BOLTXXXXX unless you manually changed the device’s name.
If your device name and API-KEY are correct then change the script tag as:

image

This will work fine, only make sure that the API_KEY and device name are correct.

Second Way:
It is mentioned in the training itself that you don’t have to manually specify the API key and the Device Name in the setKey function because this hampers your privacy of the API key. You just have to write the script tag in this fashion:

Note: API key and Device name will be auto-initialized by Bolt cloud. You don’t have to replace the device name and API key in the above code.

Do follow any of the way and your code will work fine :slight_smile: (But I prefer that use the second way as it minimizes the security thread and also human error while typing the same).

Also as you have now exposed your API Key so I recommend you to re-generate the API_Key by visiting https://cloud.boltiot.com/api_credentials and then use the newly generated API_key for all the projects.

@shubham11gupta10 also I am able to see that you have configured the Hardware Configuration for this project! There is no need for the hardware configuration because you are only giving outputs in this project.

I suggest you to form a new product and don’t do the above stated mistakes, it will work fine

Thank You sir to help me solve the problem.

1 Like

@shubham11gupta10 I am glad that I helped you. By the way buddy, I am also a student like you :slight_smile:

Buddy, is there any personal group so that we can get together to work together over bigger things?

Nope buddy. This forum is sufficient for that I guess