# Robot Web Services Websocket examples

**URL:** <https://tech-community.robotics.abb.com/t/robot-web-services-websocket-examples/9279>\
**Category:** Developer Tools\
**Tags:** socket, web-service\
**Created:** [January 20, 2020, 4:23am UTC](https://tech-community.robotics.abb.com/t/robot-web-services-websocket-examples/9279 "2020-01-20T04:23:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![clow0003](https://avatars.discourse-cdn.com/v4/letter/c/b77776/32.png) [@clow0003](https://tech-community.robotics.abb.com/u/clow0003)\
**Post date:** [January 20, 2020, 4:23am UTC](https://tech-community.robotics.abb.com/t/robot-web-services-websocket-examples/9279/1 "2020-01-20T04:23:36Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![sanlop](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@sanlop](https://tech-community.robotics.abb.com/u/sanlop)\
**Post date:** [February 6, 2020, 12:49pm UTC](https://tech-community.robotics.abb.com/t/robot-web-services-websocket-examples/9279/2 "2020-02-06T12:49:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sanlop](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@sanlop](https://tech-community.robotics.abb.com/u/sanlop)\
**Post date:** [February 6, 2020, 12:49pm UTC](https://tech-community.robotics.abb.com/t/robot-web-services-websocket-examples/9279/3 "2020-02-06T12:49:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![YuGo](https://avatars.discourse-cdn.com/v4/letter/y/76d3ee/32.png) [@YuGo](https://tech-community.robotics.abb.com/u/YuGo)\
**Post date:** [February 11, 2020, 10:20am UTC](https://tech-community.robotics.abb.com/t/robot-web-services-websocket-examples/9279/4 "2020-02-11T10:20:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![clow0003](https://avatars.discourse-cdn.com/v4/letter/c/b77776/32.png) [@clow0003](https://tech-community.robotics.abb.com/u/clow0003)\
**Post date:** [February 14, 2020, 4:18am UTC](https://tech-community.robotics.abb.com/t/robot-web-services-websocket-examples/9279/5 "2020-02-14T04:18:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![YuGo](https://avatars.discourse-cdn.com/v4/letter/y/76d3ee/32.png) [@YuGo](https://tech-community.robotics.abb.com/u/YuGo)\
**Post date:** [February 14, 2020, 7:52am UTC](https://tech-community.robotics.abb.com/t/robot-web-services-websocket-examples/9279/6 "2020-02-14T07:52:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![clow0003](https://avatars.discourse-cdn.com/v4/letter/c/b77776/32.png) [@clow0003](https://tech-community.robotics.abb.com/u/clow0003)\
**Post date:** [February 14, 2020, 8:17am UTC](https://tech-community.robotics.abb.com/t/robot-web-services-websocket-examples/9279/7 "2020-02-14T08:17:04Z")

</div>

Ok thanks for the info! I will try using these other languages.
