# Bad request on path /api/sessions/my\_room\_name\_here/connection

**URL:** https://openvidu.discourse.group/t/bad-request-on-path-api-sessions-my-room-name-here-connection/3468
**Category:** Issues developing apps
**Tags:** v2
**Created:** [October 8, 2021, 9:49am UTC](https://openvidu.discourse.group/t/bad-request-on-path-api-sessions-my-room-name-here-connection/3468 "2021-10-08T09:49:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![xkarydis](https://avatars.discourse-cdn.com/v4/letter/x/a8b319/32.png) [@xkarydis](https://openvidu.discourse.group/u/xkarydis)
#### Post date: [October 8, 2021, 9:49am UTC](https://openvidu.discourse.group/t/bad-request-on-path-api-sessions-my-room-name-here-connection/3468/1 "2021-10-08T09:49:44Z")

</div>

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

```auto
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

---

<div class="post-metadata">

### Author: ![pabloFuente](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/pablofuente/32/2536_2.png) [@pabloFuente](https://openvidu.discourse.group/u/pabloFuente)
#### Post date: [October 8, 2021, 11:01am UTC](https://openvidu.discourse.group/t/bad-request-on-path-api-sessions-my-room-name-here-connection/3468/2 "2021-10-08T11:01:29Z")

</div>

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](https://docs.openvidu.io/en/stable/reference-docs/REST-API/#post-connection)

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