RobotStudio event

Robot Web Services Websocket examples

clow0003
clow0003
edited January 2020 in Developer Tools
I am currently using Robot Web Services 1.0 with HTML/JS to get subscription on errors from the robot. I always get the error that the HTTP authentication failed. The documentation said to add the HTTP-session and ABBCX cookies into the request headers.
Can I ask for an example on this as the MDN documentation on WebSocket said it is not possible to add request header?

Comments

  • Hi, i have the same behavior, can not create subscriptions any more. 
    I m using the python example provided and i getting error 404.
    Can anyone help here?
    Thanks in advance
  • Hi,
    I am in the same condition, i do not if something change in the Web Services.
    Currently i m getting error 404.
    Can some one help?

    Thanks in advance
  • Hi @clow0003, are you developing an interface using HTML and JS? If yes you must have to host your pages iniside the HOME/docs folder of the robot.
    The first time the browser automatically will ask a login, enter the User and passwor (es. Defaul User, robotics) and after that you can create a subsription and create the websocket without any cookies or sessions.

    Let me know if you have more questions, U.
  • Thanks YuGo!. The issue is gone now but I had another issue where every time I call the API, I will open a new session (the ABBCX cookie increases). I was using a proxy server as I need the pages hosted out of the robot to be able to communicate with multiple robots. 
    Is there a better way to do this?
  • Hi @clow0003
    well, I'm actually work on it but is not easy to develop it in JS both because it doesn't native support the digest authentications and due to CORS restrictions of the web server and browser.
    The official documentation suggest to use HTML and JS inside the controller.
    Otherwise is better to use Python or C#.

    I'll let you know if I'll discover something!
    Ciao, U.
  • Ok thanks for the info! I will try using these other languages.