Send log using JS in web + API

Hi, im using a web html and JS file with API, Im looking to send a log to my farmbot. How is this done, the documentation is a bit confusing.

With python its as simple as request_id1 = bot.send_message("Hello, this is being controlled through the API ")

Thanks

PS: I can move my farmbot through the web and API, so my connections work.

1 Like

@RickCarlino replied in another post that FarmBotJS does not have a send_message helper yet. No one has requested it until now. He can add this to a future version of FBJS, though.

Thank you Rick for the support, I truly appreciate it!

2 Likes

UPDATE: It has been implemented now, here is the code:

<script>
function sendLogMessage() {
  var farmbot123 = new fbjs.Farmbot({ token: TOKEN });
  farmbot123
  .connect()
  .then(function () {
    return farmbot123.sendMessage("info", "Hello, world!");
  });
}
</script>
2 Likes