There should not be a hyphen in front of then:
or else:
… and endif
is not a valid key at all.
The appropriate way to setup a If/Then action in YAML is demonstrated in the docs.
Keep in mind that the script returning the response could also be configured improperly, but you have not shared that, so we have no way of knowing…
Also, please follow Community Guidlines #11 & 14 and post properly formatted code instead of screenshots of code.