How to check the device connection and thing id, is it connected to Arduino IoT Cloud or not?

Hi

My apologies, I misinterpret what you are looking for! I'm not aware of anything that allows you to check for the presence of the Arduino Thing Id?

See a post I made regarding an issue I had with the IoT cloud HERE where I have requested the same info from the IoT cloud team.

HTH?