Help : error syntax script json

Good morning,
I’m having a problem with the syntax of a script.
I copied the command lines that work in configuration.yaml into a script, and I got errors.
Can you help me correct the syntax in the script?
THANKS

configuration.yaml:

rest:

alias: Test json to binary_sensor
sequence:
rest:

Please see section 11 here then edit your post accordingly: How to help us help you - or How to ask a good question