Difference between revisions of "Room creation"
Ashley DeBon (talk | contribs) (→Create Video Message Room) |
Ashley DeBon (talk | contribs) (→Successful Response (200)) |
||
| Line 37: | Line 37: | ||
| toId || integer/string || Yes || Unique identifier of the other user to open a room with (must not be the authenticated user’s own ID) | | toId || integer/string || Yes || Unique identifier of the other user to open a room with (must not be the authenticated user’s own ID) | ||
|} | |} | ||
| + | |||
| + | === cURL Example for Android === | ||
| + | |||
| + | <pre> curl --location 'https://apimobile.callproof.com/api/create-room' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "toId": "YOUR_RECIPIENT_USER_ID" }' </pre> | ||
| + | |||
| + | === cURL Example for iOS === | ||
| + | |||
| + | <pre> curl --location 'https://apimobile.callproof.com/api/create-room' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "toId": "YOUR_RECIPIENT_USER_ID" }' </pre> | ||
=== Successful Response (200) === | === Successful Response (200) === | ||
Latest revision as of 13:34, 21 July 2026
Mobile_API »Create Video Message Room
Base URL
https://apimobile.callproof.com
Endpoint
/api/create-room
Purpose
Creates a one-to-one video message room between the authenticated user and another user. If a room already exists between those two users, the existing room ID is returned instead of creating a duplicate.
HTTP Method
POST
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer access token |
Security
- Yes – Requires Bearer Token authentication.
Parameters
Path Parameters
None.
Query Parameters
None.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| toId | integer/string | Yes | Unique identifier of the other user to open a room with (must not be the authenticated user’s own ID) |
cURL Example for Android
curl --location 'https://apimobile.callproof.com/api/create-room' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "toId": "YOUR_RECIPIENT_USER_ID" }'
cURL Example for iOS
curl --location 'https://apimobile.callproof.com/api/create-room' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "toId": "YOUR_RECIPIENT_USER_ID" }'
Successful Response (200)
Indicates that a room was created, or an existing room was found.
| Field | Type | Description |
|---|---|---|
| clientStatusCode | integer | Status indicator for the client (for example, 200) |
| user_id | integer | Identifier of the authenticated user |
| company_id | integer | Identifier of the authenticated user’s company |
| message | string | Confirmation message (for example, "Room created successfully") |
| room_id | string | Unique room identifier |
| uri | string | Requested resource URI |
Error Responses
| Status Code | Meaning |
|---|---|
| 200 | Validation / business-rule failed – response body uses clientStatusCode 401 with an error message
|
| 400 | Bad Request – the room could not be created |
| 401 | Unauthorized – missing, invalid, or expired Bearer token |
- Validation / rule (HTTP 200, clientStatusCode 401) – Missing
toId, ortoIdmatches the logged-in user (for example, "Provided user matched with login users! please try some other users"). - 400 – Room creation failed (for example, cross-company messaging not allowed, or "Error while creating room").
- 401 – Authentication failed or the access token is missing/expired.