Receiving JSON from other API to control


Hello everyone.
My goal is implementation of RPC mechanism. I have the MONGOOSE OS firmware, which I could control by RPC with JSON.
And I have the working API from another source which send me JSON, too.
So is there any solutions to combine this? I want to control it via another API, not by myself.


Maybe RPC - Remote Procedure Calls can help?


Or maybe


@dsmyalkovskiy also, if you sketch a simple example, that would help.


Thanks, I’ve user this function tto receive JSON. But is there a function which call some URL to receive JSON? For instance every minute.


Thank you, but the main thought is using mongoose os without some back end.


So I have this function in my main
mg_rpc_add_handler(mgos_rpc_get_global(), “RPC_PWM”, “{R: %d, G: %d, B: %d, NUM: %d FREQ: %d}”, rpc_pwm_control, NULL);

Which controlling the light dimming and fading. And with
mos --port ws:// call RPC_PWM {’“R”: 255, “G”: 1, “B”: 1, “NUM”: 100, “FREQ”: 10}’
I could control my system.
Also there is an working API, which send JSON. And the question is : could mongoose call this API (like curl https://blala) from another source and process it without my intervention?


If you use, then you could use curl / HTTPS to call any RPC function. See


Thank you, I’ll try it tomorrow.