IFTTT experiment

hi before the line

data = json.loads(r.text)

Please add this line

print r.text

and tell me the output error again over screenshot

Hi,

In your line.

r = requests.get('http://cloud.boltiot.com/remote/api_key/digitalRead?pin=4&deviceName=BOLT259126)

There are two mistakes

  1. missing inverted comma before closing bracket
  2. api_key needs to be replaced with a API key you have generated from your dashboard

Done… but still the same error

Hi,

another spelling mistake is digialRead is typed which should be digitalRead

ohh yeah… thnx
now it is showing invalid api key

Hi,

Please check the API key you have used and if it has been enabled on your dashboard

It is already enabled , and i have checked the api key.

Also check if your bolt id is correct

i have checked it sir. it is correct

Sir it is working.
Thank you so much.

1 Like

You are welcome :slight_smile:

sir how to remove this error?

@priyankachikane95 i can you please share the code you are running?

I had received the same error while i ran the program.
Make sure that when you run the program you run it using the below command
sudo python3 temp_sys.py
I had simply typed in python instead of python3 and hence the error.

Python language is a very sensitive language for indentation, it has caused confusion for many beginners. Putting in an extra space or leaving one out where it is needed will surely generate an error message . Some common causes of this error include:

  • Forgetting to indent the statements within a compound statement
  • Forgetting to indent the statements of a user-defined function.

The error message IndentationError: expected an indented block would seem to indicate that you have an indentation error. It is probably caused by a mix of tabs and spaces. The indentation can be any consistent white space . It is recommended to use 4 spaces for indentation in Python, tabulation or a different number of spaces may work, but it is also known to cause trouble at times. Tabs are a bad idea because they may create different amount if spacing in different editors .