const axios = require("axios");
const apiKey = "YOUR_API_KEY";
const mentor_user_id = "USER_ID_ASSIGNED_BY_YOUR_SERVICE";
const mentee_user_id = "USER_ID_ASSIGNED_BY_YOUR_SERVICE";
axios
.post(
"https://api.pagecall.com/v1/rooms",
{
name: "One-on-One Meeting, Ashley & Jayden",
type: "private", // Could be one of 'open', 'public' or 'private'
members: [
{ user_id: mentor_user_id, type: "host" },
{ user_id: mentee_user_id, type: "guest" },
],
},
{ headers: { Authorization: `Bearer ${apiKey}` } }
)
.then((response) => {
const { room } = response.data;
console.log(`Meeting room created with ID:`, room.id);
})
.catch((error) => {
console.error("Error creating meeting room:", error);
});