Digital Samba Embedded
  • Introduction
  • SDK
    • DigitalSambaEmbedded class
    • Methods
      • addCustomTile()
      • removeCustomTile()
      • addFrameEventListener()
      • addImageToWhiteboard()
      • addTileAction()
      • addUICallback()
      • allowBroadcast()
      • allowScreenshare()
      • changeBrandingOptions()
      • changeLayoutMode()
      • changeRole()
      • changeToolbarPosition()
      • closeLibraryFile()
      • closeWhiteboard()
      • createWhiteboard()
      • configureCaptions()
      • configureVirtualBackground()
      • disableAudio()
      • disableVideo()
      • disableVirtualBackground()
      • disallowBroadcast()
      • disallowScreenshare()
      • enableAudio()
      • enableVideo()
      • enableVirtualBackground()
      • endSession()
      • featureEnabled()
      • hideCaptions()
      • hideToolbar()
      • leaveSession()
      • listUsers()
      • load()
      • lowerHand()
      • muteFrame()
      • maximizeLocalTile()
      • maximizeUser()
      • minimizeLocalTile()
      • minimizeContent()
      • minimizeUser()
      • off()
      • on()
      • once()
      • openLibraryFile()
      • openWhiteboard()
      • pinUser()
      • raiseHand()
      • removeFrameEventListener()
      • removeTileAction()
      • removeUICallback()
      • removeUser()
      • requestMute()
      • requestToggleAudio()
      • requestUnmute()
      • showCaptions()
      • showToolbar()
      • startRecording()
      • startScreenshare()
      • stopRecording()
      • stopScreenshare()
      • toggleAudio()
      • toggleCaptions()
      • toggleMuteFrame()
      • toggleToolbar()
      • toggleVideo()
      • toggleWhiteboard()
      • toggleLibraryFile()
      • unmuteFrame()
      • unpinUser()
    • Events
      • activeSpeakerChanged
      • appError
      • appLanguageChanged
      • audioDisabled
      • audioEnabled
      • captionsDisabled
      • captionsEnabled
      • captionsFontSizeChanged
      • captionsSpokenLanguageChanged
      • chatMessageReceived
      • featureSetUpdated
      • frameLoaded
      • handRaised
      • handLowered
      • layoutModeChanged
      • mediaDeviceChanged
      • permissionsChanged
      • recordingFailed
      • recordingStarted
      • recordingStopped
      • roleChanged
      • roomStateUpdated
      • screenshareStarted
      • screenshareStopped
      • sessionEnded
      • speakerStoppedTalking
      • userJoined
      • userLeft
      • usersUpdated
      • videoDisabled
      • videoEnabled
      • virtualBackgroundChanged
      • virtualBackgroundDisabled
    • Properties
      • features
      • localUser
      • permissionManager
      • roomState
  • REST API
    • Rate limiting
    • Pagination
    • Default room settings
      • List
      • Edit
    • Rooms
      • Create
      • Edit
      • List
      • Delete
        • All resources
        • Concrete resource
      • Files
      • Chat
        • List
        • Export
      • Questions & Answers
        • List
        • Export
      • Transcription
        • List
        • Export
        • Start
        • Stop
    • Sessions
      • List
      • End
      • Delete resources
        • All resources
        • Concrete resource
      • Transcripts
      • Summary (AI)
    • Participants
      • List
    • Roles and permissions
      • Permissions
      • Create
      • Edit
      • List
      • Delete
    • Live usage
      • Rooms
      • Participants
    • Statistics
      • Current period
      • Team
      • Room
    • Tokens
      • Properties
      • Create
    • Recordings
      • List
      • Download
      • Start
      • Stop
      • Delete
      • Archive
      • Unarchive
    • Polls
      • Create
      • Edit
      • List
      • Delete
      • Export
      • Results
    • Content Library
      • Create
      • Edit
      • List
      • Delete
      • Folders
        • Create
        • Edit
        • List
        • Delete
      • Files
        • Upload
        • Webapps
        • Whiteboards
        • Edit
        • List
        • Delete
    • Telephony
      • Participant Join
      • Participant Leave
    • Webhooks
      • Payload structure
      • Create
      • Edit
      • List
      • Delete
    • Scribe / Postman docs
  • Dashboard docs
  • LTI docs
Powered by GitBook
On this page
  1. REST API
  2. Content Library

Create

To create a new content library you need to execute a POST request against the /libraries endpoint.

Two fields are available in the JSON body of the POST request, but none of them are required.

  • name - an optional text description of the library. If not set - a default one with the current date will be used - e.g. Library 07.10.2024 11:19. Please note that names cannot be duplicated.

  • external_id - an optional text field which you can use for cross referencing the library with some entity in your external integration.

In the response you will find the unique id which identifies the library and can later be used to upload files and create folders in the library.

1. Request (will auto-generate library name)

curl --request POST \
  --header "Content-Type: application/json" \
  --url https://api.digitalsamba.com/api/v1/libraries \
  --user YOUR_TEAM_ID:YOUR_DEVELOPER_KEY \
  --data '{}'
import com.fasterxml.jackson.databind.ObjectMapper;

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.util.Base64;
import java.util.Map;

String TEAM_ID = "YOUR_TEAM_ID";
String DEVELOPER_KEY = "YOUR_DEVELOPER_KEY";
String authorizationHeader = "Bearer " + Base64.getEncoder().encodeToString((TEAM_ID + ":" + DEVELOPER_KEY).getBytes());

String jsonData = "{}";

HttpRequest request = HttpRequest.newBuilder()
  .POST(HttpRequest.BodyPublishers.ofString(jsonData))
  .uri(new URI("https://api.digitalsamba.com/api/v1/libraries"))
  .header("Authorization", authorizationHeader)
  .header("Content-Type", "application/json")
  .build();

HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());

System.out.println("Status code: " + response.statusCode());
System.out.println("Body: " + response.body());

Response (200 OK)

{
    "id": "45d125d8-bac9-43a5-a6a8-311a5433239d",
    "external_id": null,
    "name": "Library 07.10.2024 11:24",
    "source": "api",
    "created_at": "2024-10-07T11:24:52Z"
}

As you can see a name was auto-generated based on the current date.

2. Request (will use the "name" you provided)

curl --request POST \
  --header "Content-Type: application/json" \
  --url https://api.digitalsamba.com/api/v1/rooms \
  --user YOUR_TEAM_ID:YOUR_DEVELOPER_KEY \
  --data '{"name": "Holiday in Greece"}'
import com.fasterxml.jackson.databind.ObjectMapper;

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.util.Base64;
import java.util.Map;

String TEAM_ID = "YOUR_TEAM_ID";
String DEVELOPER_KEY = "YOUR_DEVELOPER_KEY";
String authorizationHeader = "Bearer " + Base64.getEncoder().encodeToString((TEAM_ID + ":" + DEVELOPER_KEY).getBytes());

Map<String, String> data = Map.of(
  "name", "Holiday in Greece"
);
String jsonData = new ObjectMapper().writeValueAsString(data);

HttpRequest request = HttpRequest.newBuilder()
  .POST(HttpRequest.BodyPublishers.ofString(jsonData))
  .uri(new URI("https://api.digitalsamba.com/api/v1/libraries"))
  .header("Authorization", authorizationHeader)
  .header("Content-Type", "application/json")
  .build();

HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());

System.out.println("Status code: " + response.statusCode());
System.out.println("Body: " + response.body());

Response (200 OK)

{
    "id": "ec463c74-b227-4bec-9c95-b3eb515b6548",
    "external_id": null,
    "name": "Holiday in Greece",
    "source": "api",
    "created_at": "2024-10-07T11:32:56Z"
}
PreviousContent LibraryNextEdit

Last updated 7 months ago