Documentation

PlugNmeet
in package

The main class for interacting with the plugNmeet API.

Table of Contents

Properties

$algo  : string
The hashing algorithm used to sign requests.
$apiKey  : string
The API key for the plugNmeet server.
$apiSecret  : string
The API secret for the plugNmeet server.
$defaultPath  : string
The default path for API requests.
$httpClient  : HttpClientInterface
The HTTP client used to make requests to the plugNmeet server.
$serverUrl  : string
The URL of the plugNmeet server.

Methods

__construct()  : mixed
Constructs a new PlugNmeet instance.
broadcastToRoom()  : CommonResponse
Broadcast messages or notifications directly into an active Plug-N-Meet session in real-time
createPoll()  : CreatePollRes
Allows your backend server to push a complete poll into an active Plug-N-Meet session in real time
createRoom()  : CreateRoomRes
Creates a new room.
decodeJWTData()  : stdClass
Decodes a JWT.
deleteAnalytics()  : DeleteAnalyticsRes
Deletes analytics data.
deleteArtifact()  : DeleteArtifactRes
Deletes an artifact.
deleteRecordings()  : DeleteRecordingRes
Deletes a recording.
endRoom()  : RoomEndRes
Ends an active session.
fetchAnalytics()  : FetchAnalyticsRes
Retrieves analytics data.
fetchArtifacts()  : FetchArtifactsRes
Retrieves a list of artifacts.
fetchPastRoomsInfo()  : FetchPastRoomsRes
Retrieves a list of past rooms.
fetchRecordings()  : FetchRecordingsRes
Retrieves a list of recordings.
generateUuid4()  : string
Generates a UUID v4 random string.
getActiveRoomInfo()  : GetActiveRoomInfoRes
Retrieves information about an active room.
getActiveRoomsInfo()  : GetActiveRoomsInfoRes
Retrieves information about all active rooms.
getAnalyticsDownloadToken()  : GetAnalyticsDownloadTokenRes
Generates a download token for analytics data.
getArtifactDownloadToken()  : GetArtifactDownloadTokenRes
Generates a download token for an artifact.
getArtifactInfo()  : ArtifactInfoRes
Retrieves information about a specific artifact.
getClientFiles()  : GetClientFilesRes
Retrieves the client files needed to build the plugNmeet interface.
getJoinToken()  : GenerateTokenRes
Generates a token for a user to join a room.
getJWTencodedData()  : string
Encodes a payload into a JWT.
getRecordingDownloadToken()  : GetDownloadTokenRes
Generates a download link for a recording.
getRecordingInfo()  : RecordingInfoRes
Retrieves information about a specific recording.
getUUID()  : string
Generates a UUID v4 random string.
isRoomActive()  : IsRoomActiveRes
Checks if a room is currently active.
mergeRecordings()  : CommonResponse
Merge multiple parts of a session's recording into a single new recording.
updateRecordingMetadata()  : UpdateRecordingMetadataRes
Updates the metadata of a recording.
uploadWhiteboardFile()  : CommonResponse
Upload a file to the whiteboard.
sendRequest()  : stdClass
Sends a request to the plugNmeet server.
sendUploadFileRequest()  : stdClass
buildUrl()  : string
Builds the full URL for an API endpoint.
handleException()  : void
Extracts a meaningful error response from a Exception.

Properties

$algo

The hashing algorithm used to sign requests.

protected string $algo = "sha256"

$apiKey

The API key for the plugNmeet server.

protected string $apiKey

$apiSecret

The API secret for the plugNmeet server.

protected string $apiSecret

$defaultPath

The default path for API requests.

protected string $defaultPath = "/auth"

$serverUrl

The URL of the plugNmeet server.

protected string $serverUrl

Methods

__construct()

Constructs a new PlugNmeet instance.

public __construct(string $serverUrl, string $apiKey, string $apiSecret[, int $timeout = 60 ][, bool $verifySSL = true ][, HttpClientInterface|null $httpClient = null ]) : mixed
Parameters
$serverUrl : string

The URL of the plugNmeet server.

$apiKey : string

The API key for the plugNmeet server.

$apiSecret : string

The API secret for the plugNmeet server.

$timeout : int = 60

The timeout for API requests in seconds.

$verifySSL : bool = true

Whether to verify the SSL certificate.

$httpClient : HttpClientInterface|null = null

An optional custom HTTP client.

broadcastToRoom()

Broadcast messages or notifications directly into an active Plug-N-Meet session in real-time

public broadcastToRoom(BroadcastToRoomReq $broadcastToRoomReq) : CommonResponse
Parameters
$broadcastToRoomReq : BroadcastToRoomReq

The request object for broadcasting to room.

Tags
throws
Exception
Return values
CommonResponse —

The response from the API call.

createPoll()

Allows your backend server to push a complete poll into an active Plug-N-Meet session in real time

public createPoll(CreatePollReq $createPollReq) : CreatePollRes
Parameters
$createPollReq : CreatePollReq

The request object for creating poll to room.

Tags
throws
Exception
Return values
CreatePollRes —

The response from the API call.

decodeJWTData()

Decodes a JWT.

public decodeJWTData(string $raw[, string $algo = "HS256" ]) : stdClass
Parameters
$raw : string

The JWT to decode.

$algo : string = "HS256"

The hashing algorithm used to encode the JWT.

Return values
stdClass —

The decoded payload.

deleteAnalytics()

Deletes analytics data.

public deleteAnalytics(DeleteAnalyticsReq $deleteAnalyticsReq) : DeleteAnalyticsRes

This method is deprecated and will be removed in a future version. Use deleteArtifact instead.

Parameters
$deleteAnalyticsReq : DeleteAnalyticsReq

The request object for deleting analytics.

Tags
throws
Exception
Return values
DeleteAnalyticsRes —

The response from the deleteAnalytics API call.

endRoom()

Ends an active session.

public endRoom(RoomEndReq $roomEndReq) : RoomEndRes
Parameters
$roomEndReq : RoomEndReq

The request object for ending a room.

Tags
throws
Exception
Return values
RoomEndRes —

The response from the endRoom API call.

fetchAnalytics()

Retrieves analytics data.

public fetchAnalytics(FetchAnalyticsReq $fetchAnalyticsReq) : FetchAnalyticsRes

This method is deprecated and will be removed in a future version. Use fetchArtifacts instead.

Parameters
$fetchAnalyticsReq : FetchAnalyticsReq

The request object for fetching analytics.

Tags
throws
Exception
Return values
FetchAnalyticsRes —

The response from the fetchAnalytics API call.

generateUuid4()

Generates a UUID v4 random string.

public static generateUuid4() : string
Return values
string —

The generated UUID v4.

getAnalyticsDownloadToken()

Generates a download token for analytics data.

public getAnalyticsDownloadToken(GetAnalyticsDownloadTokenReq $getAnalyticsDownloadTokenReq) : GetAnalyticsDownloadTokenRes

This method is deprecated and will be removed in a future version. Use getArtifactDownloadToken instead.

Parameters
$getAnalyticsDownloadTokenReq : GetAnalyticsDownloadTokenReq

The request object for getting an analytics download token.

Tags
throws
Exception
Return values
GetAnalyticsDownloadTokenRes —

The response from the getAnalyticsDownloadToken API call.

getArtifactInfo()

Retrieves information about a specific artifact.

public getArtifactInfo(ArtifactInfoReq $artifactDetailsReq) : ArtifactInfoRes
Parameters
$artifactDetailsReq : ArtifactInfoReq

The request object for getting artifact information.

Tags
throws
Exception
Return values
ArtifactInfoRes —

The response from the getArtifactInfo API call.

getClientFiles()

Retrieves the client files needed to build the plugNmeet interface.

public getClientFiles() : GetClientFilesRes
Tags
throws
Exception
Return values
GetClientFilesRes —

The response from the getClientFiles API call.

getJWTencodedData()

Encodes a payload into a JWT.

public getJWTencodedData(array<string|int, mixed> $payload, int $validity[, string $algo = "HS256" ][, array<string|int, mixed> $head = [] ]) : string
Parameters
$payload : array<string|int, mixed>

The payload to encode.

$validity : int

The validity of the token in seconds.

$algo : string = "HS256"

The hashing algorithm to use.

$head : array<string|int, mixed> = []

Optional headers for the JWT.

Return values
string —

The encoded JWT.

getUUID()

Generates a UUID v4 random string.

public getUUID() : string
Return values
string —

The generated UUID v4.

uploadWhiteboardFile()

Upload a file to the whiteboard.

public uploadWhiteboardFile(string $roomId, array<string|int, mixed> $options) : CommonResponse
Parameters
$roomId : string

The ID of the room to upload the file to.

$options : array<string|int, mixed>

An array containing either a 'document' (local full file path) or 'document_link' (URL).

Tags
throws
Exception
Return values
CommonResponse —

The response from the server.

sendRequest()

Sends a request to the plugNmeet server.

protected sendRequest(string $path, string $body) : stdClass
Parameters
$path : string

The API endpoint to call.

$body : string

The body of the request.

Return values
stdClass —

The response from the server.

sendUploadFileRequest()

protected sendUploadFileRequest(string $roomId, array<string|int, mixed> $multipart) : stdClass
Parameters
$roomId : string

The ID of the room to upload the file to.

$multipart : array<string|int, mixed>

The multipart data to send.

Return values
stdClass

buildUrl()

Builds the full URL for an API endpoint.

private buildUrl(string $path) : string
Parameters
$path : string

The API endpoint path.

Return values
string —

The full URL.

handleException()

Extracts a meaningful error response from a Exception.

private handleException(string $message, mixed &$output) : void
Parameters
$message : string
$output : mixed
On this page

Search results