how to log messages via mrl API?

Hello,

I'm trying to send a external message to mrl log via  API

something as:

http://localhost:8888/api/services/log/addinfo/test

but is not worky. 

Is it correct statement or  funcionality is possible ? 

GroG's picture

Hi Darek, Nice to see you

Hi Darek,
Nice to see you around again ..

It's case sensitive - your I in info needs to be capitalized :

try this :

http://localhost:8888/api/service/log/addInfo/HelloWorld 

Darek's picture

I also glad to be back and

I also glad to be back and nice to see you too.

I could not resist the new version of the mrl and new services. Good job! 

Related to my post, on WEB I received:

{"msgId":1475259852965,"name":"webgui","sender":"webgui","sendingMethod":"","historyList":[],"method":"onAddInfo"}

but on log file - witchout a message:

20:15:58.423 [New I/O worker #7] INFO  class org.myrobotlab.service.WebGui - POST Body [null]
 

 

 

GroG's picture

From latest build - top left

From latest build - top left corner of the shoutbox 
build 1701 - if you still have problems send a noWorky .. it Looks like your doing a POST when all you need to do is a GET  ... you could do a POST, but the data is formatted differently - you can find details 
here :

http://myrobotlab.org/content/myrobotlab-api 

Darek's picture

Thanks a lot  -  GET/POST is

Thanks a lot  -  GET/POST is working  for 1701

20:31:04.639 [New I/O worker #2] INFO c.m.s.WebGui [WebGui.java:494] POST /api/service/log/addInfo/HelloWorld1313123131313131313
20:31:31.156 [New I/O worker #3] INFO c.m.s.WebGui [WebGui.java:494] GET /api/service/log/addInfo/HelloWorld
 
 
GroG's picture

Great Darek, You should be

Great Darek,

You should be able to send data to any method in MRL via REST GET OR POST

A few other URLs which might be useful :

I use Chrome json formatter to make all the json pretty - and collapsable https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpa...

http://localhost:8888/api/services  - returns all the current running services

 

http://localhost:8888/api/services/{name}   will show you the state information of a service

http://localhost:8888/api/services/{name}/  <- notice the extra /   will show you all the methods, input parameters and return types of the service in question

from that you can find a method you like and call it with parameters ...

parameters can be either more slashes .. or you can switch to POSTing..

I believe this is covered in the api reference doc - http://myrobotlab.org/content/myrobotlab-api

I'm curious what your trying to to do ...  is it all working the way you want ?

Darek's picture

Hi GroG, In the near future

Hi GroG,

In the near future I would like to integrate mrl inmoov from my home IoT system "Domoticz." You know .. Inmoov as a  my personal assistant to let him do something more useful:  talking about states of sensors, weather forecasts, manages the blinds, turns on/off devices, make coffee (; etc ...  
To do this I will need working mrl  services such as httpclient, API, and mqtt. At the first steps I checked httpclient services - does not work. API is very promising and I'm going to send messages from domoticz to aiml via API inmoovWebKit service. Is it good idea?
MQTT .. I'll test later.
 
about httpclient problem is not workin on 1701 too.
 
GroG's picture

Is should be worky now ...

Is should be worky now ...  its a great idea 

please refer to your other post for details...