In this guide, we will learn how to use the SquadCast API to get current sessions in a NodeJS application. The SquadCast API supports many languages, you can view different examples in your preferred language over at the API Reference Page. For this guide, we will use NodeJS Back end to listen to events and create a new session.

ℹ️  Heads Up In order to create a new API Key, you will need to be an Administrator of the Organization you wish to use in order to access the API requests and properly create an Auth Token.

πŸ” API Authentication

Before being able to access the API we need to register an API Key on our SquadCast Account.

  1. Login to https://app.squadcast.fm and navigate to https://app.squadcast.fm/account/developers. Create a new API Key.

    🚨 Be sure to keep this API key Secret.
    API Key Gen

  2. Authentication to the API is performed via bearer auth. Provide your API secret key as the Authorization header’s value, for example Bearer YOUR_API_KEY.
    curl –location –request GET 'https://api.squadcast.fm/v1/sessions' \
    –header 'Authorization: Bearer YOUR_API_KEY'

    Curl Example GET Sessions Request

    var request = require('request');
    var options = {
    'method': 'GET',
    'url': 'https://api.squadcast.fm/v1/sessions',
    'headers': {
    'Authorization': 'Bearer YOUR_API_KEY'
    }
    };
    request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
    });

    Curl Example GET Sessions Request

πŸͺ Webhooks

The SquadCast API supports custom Webhooks that allow users to receive and listen to different events provided by the API. These events include:
New Web Hook

Event Example Payload

recording_session.created

Returns a payload with detailed information on the new session scheduled.

{
"event": "recording_session.created",
"id": "sessionID",
"date": "2021-12-13",
"startTime": "12:00 PM",
"endTime": "1:00 PM",
"timeZone": "America/New_York",
"title": "Test Recording Session",
"links": {
"host": "https://app.squadcast.fm/hostLink"
"guest": "https://app.squadcast.fm/guestLink"
}
}

recording_session.deleted

Returns a payload when a session is deleted with the sessionID

{
"event": "recording_session.deleted",
"id": "sessionID"
}

recording_session.updated

Returns a payload with detailed information when a session’s information is updated.

{
"event": "recording_session.updated",
"id": "sessionID",
"date": "2021-12-13",
"startTime": "12:00 AM",
"endTime": "1:00 PM",
"timeZone": "America/New_York",
"title": "Test Recording Session",
"links": {
"host": "https://app.squadcast.fm/hostLink"
"guest": "https://app.squadcast.fm/guestLink"
}
}

audio.rendered

Returns a payload with audio rendered information

{
"event": "audio.rendered",
"wav": "https://storage/file_mastered.wav",
}

audio.mastered

Returns a payload with audio information of a mastered track

{
"event": "audio.mastered",
"wav": "https://storage/file_mastered.wav",
}

audio.mixed

Returns a payload with audio information of a mixed track

{
"event": "audio.mastered",
"wav": "https://storage/file_mastered.wav",
}

video.rendered

Returns a payload with video information of a rendered video recording

{
"event": "video.rendered",
"mp4": "https://storage/file_mastered.mp4",
}

In order to create a webhook we can follow these steps:

  1. Navigate to your Account page and select Developers within the left side navigation
  2. Click the Create Webhook button
  3. Input the Webhook URL that you would like to send your data to
    1. The URL must be accessible over HTTPS
    2. The URL cannot be served from localhost, we recommend Localtunnel for testing purposes
  4. Check the box to the left of one or more Webhook Events that you would like to send your data
  5. Click the Create button to save your Webhook

Delivery

  • If webhooks URLs do not respond with HTTP status code 200 or the request times out, we will retry the request
  • We will continue to retry the request for a few minutes with an exponential backoff strategy