Bad request on path /api/sessions/my_room_name_here/connection

I am developing an Android app with video call feature using OpenVidu. Our server uses the 2.17.0 version.

In order to get a Token for a room (whose room name i have already from my server) i create a HttpRequest on the BASE_URL/openvidu/api/sessions/fd84f1d0-bdee-4344-800d-a3bab934d8c7/connection. In a previous version of the documentation i was informed that i need to pass a “session” String as a Body parameter. So the real request happening is the following

I: --> POST https://BASE_URL/openvidu/api/sessions/fd84f1d0-bdee-4344-800d-a3bab934d8c7/connection
I: Content-Length: 50
I: Authorization: Basic MY_AUTH_TOKEN
I: Content-Type: application/json;charset=utf-8
I: Accept: application/json;charset=utf-8
I: {"session":"fd84f1d0-bdee-4344-800d-a3bab934d8c7"}
I: --> END POST (50-byte body)

This request responses successfully with a valid token.

However, in the documentation 2.17.0 i can see that the object that need to be passed in the request does not include any “session” parameter. So when i delete this parameter and i dont send any Body then i get an Exception that says “Bad request”.

How is it possible that a request with wrong parameters work fine and a request with right parameters (as it suppose to handle the absent values as default values) not work at all…??

Thank you

Since Connection API was introduced back in OpenVidu 2.16.0, of course the session parameter of this operation lost all meaning. Connections are tied up to Sessions. And that is reflected in the URL of the POST method. To initialize a Connection you need the session identifier:

https://BASE_URL/openvidu/api/sessions/SESSION_ID/connection

As you can see in latest documentation of this POST method, actually it does not require any mandatory parameter in the body request. See the table for a complete description of all available parameters: REST API - OpenVidu Docs

So there must be some kind of confusion in your deployment or your API call.