/proconfToken ⇒
POST
This API is used to fetch the ProCONF token to facilitate with ProCONF features. This token is mandatory to start/join meetings under the ProCONF server.
Your application server must provide a /proconfToken endpoint to Android/Web/IOS clients to get the ProCONF token.
API signature in your application server.
* ENDPOINT : '/proconfToken'
* METHOD : POST
* HEADERS : Content-type: application/json
* REQUEST BODY : { "role", "room", "participantName" }
* RESPONSE : { "error": null, "data" : <Jwt token> }
To implement the /proconfToken API under your application server use the following details.
* ADMIN BACKEND BASE URL : https://admin.<example.com>/api
* METHOD : POST
* API ENDPOINT : /proconf-token
* REQUEST BODY : { role, room, participantName }
* HEADERS : Content-type: application/json
code snippet
Sample implementation of /proconfToken API using nodejs technology.
const axios = require("axios");
const ADMIN_BACKEND_URL = "https://admin.<example.com>/api";
const endpoint = "/proconf-token";
const role = "owner";
const room = "testRoom";
const participantName = "Alex";
const response = await axios.post(
ADMIN_BACKEND_URL + endpoint,
{ role, room, participantName },
req,
{ headers: { "Content-type": "application/json" } }
);
return { error: null, data: response };
Sample response from Admin Control.
{
"error": null,
"data": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiIqIiwiaXNzIjoieHl6Iiwic3ViIjoieHl6LnByb2NvbmYuaW5mbyIsInJvb20iOiJ0ZXN0cm9vbSIsIm5iZiI6MTcxNzY0NjYyNiwiY29udGV4dCI6eyJ1c2VyIjp7InJvbGUiOiJvd25lciJ9fSwicGFydGljaXBhbnROYW1lIjoiQWxleCIsImlhdCI6MTcxNzY1MDIyNiwiZXhwIjoxNzE4MjU1MDI2fQ.wPc-AAwzX1rtMoUZnpyr31JTUfH6wPvlJewjjZNHDp8"
}
Response expected by Android/Web/IOS clients from Your Application Server.
{
"error": null,
"data": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiIqIiwiaXNzIjoieHl6Iiwic3ViIjoieHl6LnByb2NvbmYuaW5mbyIsInJvb20iOiJ0ZXN0cm9vbSIsIm5iZiI6MTcxNzY0NjYyNiwiY29udGV4dCI6eyJ1c2VyIjp7InJvbGUiOiJvd25lciJ9fSwicGFydGljaXBhbnROYW1lIjoiQWxleCIsImlhdCI6MTcxNzY1MDIyNiwiZXhwIjoxNzE4MjU1MDI2fQ.wPc-AAwzX1rtMoUZnpyr31JTUfH6wPvlJewjjZNHDp8"
}
Error Codes:
401 : Unauthorized (If authentication token is invalid or expired)
{
"data": null,
"error": {
"code": 401,
"message": "Unauthorized"
}
}
400 : Bad Request (If invalid or null body params are passed)
{
"data": null,
"error": {
"code": 400,
"message": "Invalid body in request."
}
}
404 : Not Found (If invalid url or wrong http method is used)
{
"error": {
"code": 404,
"message": "Not found"
},
"data": null
}
500 : Internal Server Error (If there is any exception on server side)
{
"error": {
"code": 500,
"message": "Internal server error"
},
"data": null
}
If your application server is built on Node.js technology, the ProCONF server SDK's getProconfToken(role, room, participantName) method can be used. To integrate proconf-server-sdk please click here.
Call the getProconfToken(role, room, participantName) server SDK method into your application server.
const { role, room, participantName } = req.body;
const proconfToken = await serverSDK.getProconfToken(
role,
room,
participantName
);