WebRTC call APIs

You can create a new RTC call with a few line of payload.

Properties

  • Name
    meta
    Type
    object
    Description

    The object property to identify the user. Example: id, name, etc.

  • Name
    participantName
    Type
    string
    Description

    The name of the participant which will be shown in call.

  • Name
    type
    Type
    enum
    Description

    The type of the user. Example: client.


POST/api/v1/rtc/connect

Connect a RTC call

This endpoint allows you to create a new RTC call. To start a new call, you must provide meta, participantName and type.

Required attributes

  • Name
    participantName
    Type
    string
    Description

    The participantName for the call.

  • Name
    type
    Type
    enum
    Description

    The type of the user. (can be provided as empty array)

Optional attributes

  • Name
    meta
    Type
    object
    Description

    To identify the user.

Request

POST
/api/v1/rtc/connect
curl https://api.klink.cloud/api/v1/rtc/connect \
  -H "Authorization: Bearer {token}" \
  -d meta={"id": "1232-34042-4123-41"} \
  -d participantName = "Frank"  \
  -d type="client"

Response

{
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXRhZGF0YSI6IntcInR5cGVcIjpcImNsaWVudFwiLFwicHJvamVjdFwiOlwiQVBJVG42TnM4UkRFWkQyXCJ9IiwidmlkZW8iOnsicm9vbUpvaW4iOnRydWUsInJvb20iOiI5ZGY1ZDAwZi1kNGQ5LTQ1YjUtYjBmYy02OGJjZjc5ODVlOTcifSwiaWF0IjoxNjkzMjg0NTQ4LCJuYmYiOjE2OTMyODQ1NDgsImV4cCI6MTY5MzMwNjE0OCwiaXNzIjoiQVBJVG42TnM4UkRFWkQyIiwic3ViIjoiQVRaTSIsImp0aSI6IkFUWk0ifQ.thNVfX2_JCaPJJUC-aKRCQ03NEKmctTYa5SqlT6h8e0",
    "room": {
        "sid": "RM_SWDkLiKY3dRF",
        "name": "9df5d00f-d4d9-45b5-b0fc-68bcf7985e97",
        "empty_timeout": 300,
        "max_participants": 2,
        "creation_time": "-62135596800",
        "turn_password": "4ICALf8CZJCp2rupQq+8Ifdfv+g=",
        "enabled_codecs": [
            {
                "mime": "video/H264",
                "fmtp_line": ""
            },
            {
                "mime": "video/VP8",
                "fmtp_line": ""
            },
            {
                "mime": "audio/red",
                "fmtp_line": ""
            },
            {
                "mime": "audio/opus",
                "fmtp_line": ""
            }
        ],
        "metadata": "{\"meta\":{\"id\":\"1232-34042-4123-41\"},\"participantName\":\"Frank\",\"type\":\"client\"}",
        "num_participants": 0,
        "num_publishers": 0,
        "active_recording": false,
        "playout_delay": null
    }
}