Help for Tuya POST command


#1

I’m trying to make a piston with switch command for a Tuya device but don’t know how to configure it .
Is there anybody who has a sample to share

Sofar I’ve managed to get a request thru Postman working but don’t know how to fix it in Webcore.
I’m getting warning that syntax is not right.

This is the URL I try to use as webrequest
https://openapi.tuyaeu.com/v1.0/iot-03/devices/13333211840d8e623985/commands/?{“code”: “switch_1”,“value”: true}

and this is the piston which I tried tot change in many ways but nothings working.


#2

Is that URL correct or just where you ended up?

I would typically expect the

{ "code": “switch_1”, "value”: true }

to be sent as the request body, not in the query string.

If I remember correctly one way you can do this in webCoRE is to define variables named code and value with the appropriate values and then select them under Send Variables. WebCoRE will figure out from your other settings that it needs to encode them as a JSON Object and send them as the body.

I believe there is also an option for a custom body where you would manually create the JSON object in a single variable and tell it to send that.


#3

Many thanks for your help
When I try this I get following as result