I want to create a simple API with web dev module so each time it receive GET request with below parameters , the endpoint send a message to a specific perspective message hander and receive the status of that component.
Ajax request <-> web dev <-> perspective event handler
The problem the system.perspective.sendmessage() which is called from web dev endpoint doesn’t accept response from event handler and I don’t know how to send data back to web dev from event handler.
I don’t believe this is possible. Message Handlers have a scope that only refers to a session of Perspective. If a message is sent outside of a session, like a gateway script or Web Dev, there is no session scope for the message to be handled.
I think you can call system.util.sendMessage from WebDev, then handle that message in Perspective Session Events, then from there, use system.perspective.sendMessage to send a message to Perspective sessions.