WebRTC

WebRTC is a feature that is an ideal solution when a client’s product is malfunctioning over a minor issue, where the API allows you to make audio and video calling. It is a very exciting, powerful, and highly disruptive cutting-edge technology and standard. WebRTC leverages a set of plugin-free APIs that can be used in both desktop and mobile browsers, and is progressively becoming supported by all major modern browser vendors.

Content

Overview

This API is used to initiate a video call for the given application id by sending an SMS with the video call link.

Method

The following REST methods are available:

  • InitCall API
  • CallMetaData API

Requirements

Authorization API Calls
All API call requests to ideabiz.lk require Authorization headers. Please refer the Token Management (http://docs.ideabiz.lk/Getting_Started/Token_Manegment) document for Authorization.

Request Header

Content-Type: application/json 
Authorization: Bearer [access token] 
Accept: application/json

Sample Request Header

Content-Type: application/json 
Authorization: Bearer a92ba8hjgjhgjh3fa1609cabcd79
Accept: application/json

InitCall API

URL

https://ideabiz.lk/apicall/rtc/v1/init

Method

POST

Body


{"deviceOs": "ANDROID",  
“initiator": "STRING",  
"receiver": "STRING",  
"srNumber": "STRING"}

Request Parameters

Parameter/Name Description Data Type Mandatory/Optional Example
deviceOs Device OS String Mandatory ANDROID
receiver receiver String Mandatory MOBILE
srNumber Reference Number String Mandatory 25327

Response

{ 
    "responseCode": "200", 
    "responseDesc": "SUCCESS", 
    "agentConnectURL": “https://meet.ideabiz.lk/ca/462693” 
}

Response parameters

Parameter Name Description Data Type Mandatory/Optional Example
responseCode Execution Code String Mandatory 200
responseDesc Execution Message. Returns success for success scenario and else returns error message. String Mandatory SUCCESS
agentConnectURL URL String Mandatory https://meet.ideabiz.lk/ca/462693

CallMetaData API

API Overview

This API is used to get the call meta-data for the given srNumber with respect to the application id.

URL

https://ideabiz.lk/apicall/rtc/v1/init/metadata/{SrNumber}/

Note: SrNumber mentioned here is the unique SrNumber you send in the initial API request

Method

GET

Body

NULL

Response

{
    "videoList": [
        {
            "status": "paused",
            "url": "sample video URL"
        }
    ],
    "screenshotList": [
        "Sample Image URL",
        "Sample Image URL"
    ],
    "archiveExpireTimeAfter": 4,
    "archiveExpireTimeAfterUnit": "HOURS",
    "responseCode": "200",
    "responseDescription": "Success"
}

Response parameters

Parameter Name Description Data Type Mandatory/Optional Example
videoList List of Videos with status and url String Mandatory [ { "status":"uploaded", "url":“https://s3. ap-southeast 1.amazonaws .com/meet.id eabiz.lk/4644 3662/c9879.. } ]
screenshotList List of screenshots String Mandatory […., …… ]
archiveExpireTimeAfter Archive expire time String Mandatory 4
archiveExpireTimeAfterUnit Archive expire time units String Mandatory HOURS
responseCode Execution Code String Mandatory 200
responseDescription Execution Message. Returns success for success scenario and else returns error message String Mandatory Success

Steps to Follow (Agent)

1. Initially the agent should call the 'InitCall API'.

curl -X POST \
  https://ideabiz.lk/apicall/rtc/v1/init \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: fb3823d9-9a03-4d3a-8890-3cf36f25399e' \
  -H 'accept: application/json' \
  -H 'authorization: Bearer 2c51302asc31c53f4b7c124gaa10d6cc' \
  -H 'cache-control: no-cache' \
  -d '{
  "deviceOs": "ANDROID",
  "initiator": "string",
  "receiver": "077xxxxxxx",
  "srNumber": "string"
}'

2. Capture the Response

{ 
    "responseCode": "200", 
    "responseDesc": "SUCCESS", 
    "agentConnectURL": “https://meet.ideabiz.lk/ca/462693” 
}

3. Click the link and you'll be redirected to the portal


alt text


Steps to Follow (Client)

1. The End-user will recieve an SMS from the shortcode "87798"

Please click on the below link to initiate the video call. Link will be expired in 10mins.
 https://meet.ideabiz.lk/cr/v/y452281

 Use of this service shall be subject to applicable data charges. By clicking on the above link,
 you acknowledge and agree to the terms and conditions listed at https://meet.techcrmpsi.tk/cr/tnc/452281

2. The User clicks on the link and will be redirected to the default browser.


alt text


Last updated on 18th Feb 2020