Introduction

Welcome to Pagecall! Our platform enables you to easily add real-time audio, video, and whiteboard interactions to your applications, making it easier than ever to connect with your users.

Throughout this guide, we’ll provide step-by-step instructions on how to get started with Pagecall. We’ll cover everything from setting up your account and creating your first project, to creating a meeting room and inviting users to join using our APIs.

Creating a Workspace

To get started with Pagecall, please fill out the form at https://www.pagecall.com/en/consult. Our team will assist you in setting up a testable workspace within 2 business days.

Generating an API Key

Before you can start using Pagecall’s APIs, you’ll need to generate an API key. An API key is a unique identifier that allows you to authenticate with Pagecall’s servers and access the API resources.

To generate an API key, log in to your Pagecall account and navigate to the workspace setting page. In API Key section, Click the Generate button to create your new API key. Once you’ve generated your key, you’ll be able to use it to authenticate the Pagecall API.

Creating a meeting room

Once you’ve created your workspace and generated your API key, you can start creating meeting rooms. A meeting room is a virtual space where you can host real-time audio, video, and whiteboard interactions with other users.

To create a meeting room, you’ll need to make a POST request to the Pagecall API with the appropriate parameters. You can use any HTTP client library to make the request, such as Axios or the built-in fetch API.

Here’s an example code snippet for creating a meeting room using JavaScript and Axios:

const axios = require("axios");

const apiKey = "YOUR_API_KEY";

axios
  .post(
    "https://api.pagecall.com/v1/rooms",
    {
      name: "My Meeting Room",
      type: "open", // Could be one of 'open', 'public' or 'private'
    },
    { headers: { Authorization: `Bearer ${apiKey}` } }
  )
  .then((response) => {
    const { room } = response.data;
    // Meeting room created with ID: 642bc31a0b4c622bea46c82f
    console.log(`Meeting room created with ID:`, room.id);
  })
  .catch((error) => {
    console.error("Error creating meeting room:", error);
  });

To learn more about this API, please refer to the API Reference.

Redirecting clients to the meeting room

Once you’ve created a meeting room, you’ll need to redirect clients to the room’s URL so they can join the meeting. The meeting URL is generated by the Pagecall API and returned as part of the response when you create the meeting room.

To redirect clients to the meeting room, simply construct a URL using the meeting ID and the Pagecall domain, like this:

return redirect(302, `https://app.pagecall.com/meet?room_id=${room.id}`);

To connect a user to the room in Replay mode, it is similar to entering the meeting room, but you need to connect to /replay instead of /meet in the URL. If necessary, you should also include the user’s access_token as shown below.

return redirect(
  302,
  `https://app.pagecall.com/replay?room_id=${room.id}&access_token=${user.access_token}`
);

However, please note that replay is not possible if there isn’t any period when two or more people are connected simultaneously.

The URL will remain valid until you remove the room.

Embedding the meeting room using an iframe

To seamlessly integrate the Pagecall meeting room within your application, you can utilize an iframe. This provides a more cohesive user experience by keeping participants within your app’s interface, rather than redirecting them to an external URL.

<iframe
  title="Pagecall Meeting Room"
  src="https://app.pagecall.com/meet?room_id={room.id}&access_token={user.access_token}"
  width="100%"
  height="100%"
  frameborder="0"
  allow="camera;microphone;fullscreen;display-capture"
  onerror="handleIframeError()"
></iframe>

Remember to define the handleIframeError() function in your JavaScript to handle any potential errors appropriately.

Further more

Congratulations! You’ve learned the basics of how to interact with Pagecall using our APIs. From here, you can explore the API documentation to learn more about the available resources and how to use them.

If you have any questions or need help getting started, please don’t hesitate to contact our support team. We’re always here to help!