Start recording a meeting
client.RealtimeKit.Recordings.StartRecordings(ctx, appID, params) (*RecordingStartRecordingsResponse, error)
POST/accounts/{account_id}/realtime/kit/{app_id}/recordings
Starts recording a meeting. The meeting can be started by an App admin directly, or a participant with permissions to start a recording, based on the type of authorization used.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
Accepted Permissions (at least one required)
Start recording a meeting
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/realtime_kit"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
response, err := client.RealtimeKit.Recordings.StartRecordings(
context.TODO(),
"app_id",
realtime_kit.RecordingStartRecordingsParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
AudioConfig: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsAudioConfig{
Channel: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsAudioConfigChannelStereo),
Codec: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsAudioConfigCodecAac),
ExportFile: cloudflare.F(true),
}),
FileNamePrefix: cloudflare.F("string"),
InteractiveConfig: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsInteractiveConfig{
Type: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsInteractiveConfigTypeId3),
}),
MaxSeconds: cloudflare.F(int64(60)),
MeetingID: cloudflare.F("97440c6a-140b-40a9-9499-b23fd7a3868a"),
RealtimekitBucketConfig: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsRealtimekitBucketConfig{
Enabled: cloudflare.F(true),
}),
VideoConfig: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsVideoConfig{
Codec: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsVideoConfigCodecH264),
ExportFile: cloudflare.F(true),
Height: cloudflare.F(int64(720)),
Watermark: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsVideoConfigWatermark{
Position: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsVideoConfigWatermarkPositionLeftTop),
Size: cloudflare.F(realtime_kit.RecordingStartRecordingsParamsVideoConfigWatermarkSize{
Height: cloudflare.F(int64(1)),
Width: cloudflare.F(int64(1)),
}),
URL: cloudflare.F("http://example.com"),
}),
Width: cloudflare.F(int64(1280)),
}),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Success)
}
{
"success": true,
"data": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"audio_download_url": "https://example.com",
"download_url": "https://example.com",
"download_url_expiry": "2019-12-27T18:11:19.117Z",
"file_size": 0,
"invoked_time": "2019-12-27T18:11:19.117Z",
"output_file_name": "output_file_name",
"session_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"started_time": "2019-12-27T18:11:19.117Z",
"status": "INVOKED",
"stopped_time": "2019-12-27T18:11:19.117Z",
"recording_duration": 0,
"start_reason": {
"caller": {
"name": "RealtimeKit_test",
"type": "ORGANIZATION",
"user_Id": "d61f6956-e68f-4375-bf10-c38a704d1bec"
},
"reason": "API_CALL"
},
"stop_reason": {
"caller": {
"name": "RealtimeKit_test",
"type": "ORGANIZATION",
"user_Id": "d61f6956-e68f-4375-bf10-c38a704d1bec"
},
"reason": "API_CALL"
},
"storage_config": {
"type": "aws",
"auth_method": "KEY",
"bucket": "bucket",
"host": "host",
"password": "password",
"path": "path",
"port": 0,
"private_key": "private_key",
"region": "us-east-1",
"secret": "secret",
"username": "username"
}
}
}Returns Examples
{
"success": true,
"data": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"audio_download_url": "https://example.com",
"download_url": "https://example.com",
"download_url_expiry": "2019-12-27T18:11:19.117Z",
"file_size": 0,
"invoked_time": "2019-12-27T18:11:19.117Z",
"output_file_name": "output_file_name",
"session_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"started_time": "2019-12-27T18:11:19.117Z",
"status": "INVOKED",
"stopped_time": "2019-12-27T18:11:19.117Z",
"recording_duration": 0,
"start_reason": {
"caller": {
"name": "RealtimeKit_test",
"type": "ORGANIZATION",
"user_Id": "d61f6956-e68f-4375-bf10-c38a704d1bec"
},
"reason": "API_CALL"
},
"stop_reason": {
"caller": {
"name": "RealtimeKit_test",
"type": "ORGANIZATION",
"user_Id": "d61f6956-e68f-4375-bf10-c38a704d1bec"
},
"reason": "API_CALL"
},
"storage_config": {
"type": "aws",
"auth_method": "KEY",
"bucket": "bucket",
"host": "host",
"password": "password",
"path": "path",
"port": 0,
"private_key": "private_key",
"region": "us-east-1",
"secret": "secret",
"username": "username"
}
}
}