trying to run with ioBroker.rest-api I'm not able to receive any message.
/rest-api/v1/sendto/javascript.0?message=toScript&data={script:"script.js.dev.Test-js","message":"Testmessage","data":{msg:"FROM REST-API"}}&timeout=600&noResponse=false
it result in timeout.
Expected behavior
I would expect to receive the message. However, onMessage gets not executed.
Versions:
Adapter version: v2.0.3
JS-Controller version: v8.8.3
Node version: v20.18.0
Additional context
The provided example from https://github.com/ioBroker/ioBroker.rest-api, I guess implemented with issues #18 does not make sense to me as it references to scriptName but does not use it and required parameter script from toScript is not specified at all.
http://ipaddress:8093/v1/sendto/javascript.0?message=toScript&data={"message":"MESSAGE","data":"FROM REST-API"} - send a message to javascript.0 in script scriptName
Additional using Swagger UI I'm always getting "No message provided"
Describe the bug
It is not possible to send messages to a dedicated script. Maybe just missing documentation but I guess its a bug.
To Reproduce
Steps to reproduce the behavior:
I'm running this script with no error:
Script
``` sendTo( 'javascript.0', 'toScript', { script: 'script.js.dev.Test-js', message: 'Testmessage', data: {msg: 'Test MSG' } }, (res) => { console.log(JSON.stringify(res)); } ); onMessage('Testmessage', (messagedata, callback) => { console.log('recive'); const myData = { input: messagedata, output: { name: 'Test' } }; callback(myData); }); ```trying to run with ioBroker.rest-api I'm not able to receive any message.
/rest-api/v1/sendto/javascript.0?message=toScript&data={script:"script.js.dev.Test-js","message":"Testmessage","data":{msg:"FROM REST-API"}}&timeout=600&noResponse=false
it result in timeout.Expected behavior
I would expect to receive the message. However,
onMessage
gets not executed.Versions:
Additional context
The provided example from https://github.com/ioBroker/ioBroker.rest-api, I guess implemented with issues #18 does not make sense to me as it references to
scriptName
but does not use it and required parameterscript
from toScript is not specified at all.http://ipaddress:8093/v1/sendto/javascript.0?message=toScript&data={"message":"MESSAGE","data":"FROM REST-API"} - send a message to javascript.0 in script scriptName
Additional using Swagger UI I'm always getting "No message provided"