Difference between revisions of "Roomcreation"

From docs
Jump to: navigation, search
(Created page with "== Create Video Message Room == === Base URL === https://apimobile.callproof.com === Endpoint === /api/create-room === Purpose === Creates a one-to-one video message room b...")
 
(Successful Response (200))
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== Create Video Message Room ==
+
== [[Mobile_API]] »Create Video Message Room ==
  
 
=== Base URL ===
 
=== Base URL ===
Line 37: Line 37:
 
| toId || integer/string || Yes || User ID of the other participant. Must not be the same as the authenticated user
 
| toId || integer/string || Yes || User ID of the other participant. Must not be the same as the authenticated user
 
|}
 
|}
 +
 +
=== 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:27, 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 between those two users already exists, 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 User ID of the other participant. Must not be the same as the authenticated user

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 the room was created successfully, or that an existing room between the users 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 identifier of the video message room
uri string Requested resource URI

Error Responses

Status Code Meaning
200 Validation / business-rule failure – 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, or toId matches the logged-in user (for example, "Provided user matched with login users! please try some other users").
  • 400 – Room creation failed (for example, "Error while creating room"), including cases where cross-company messaging is not allowed for the recipient.
  • 401 – Authentication failed or the access token is missing/expired.