Skip to main contentIBM Video Streaming Developers

Chat Export

List export tasks for a channel

GET https://api.video.ibm.com/channels/{channelId}/chat/exports.json

Query Parameters

PARAMETERTYPEIMPORTANCEDESCRIPTION
pagenumberOPTIONALPage number. The first page’s index is 1
pagesizenumberOPTIONALSize of a page.

Success response

Upon success, a response with HTTP status “200 OK” is returned with the following key-value pairs inside the exports root array. Timestamp ares Unix timestamps in seconds.

KEYTYPEDESCRIPTION
idnumberTask ID
statusstringValues: init, pending, completed, failed
requested_attimestampExport init date
expires_attimestampExport expiration
is_expiredbooleanAn export lives up 24 hours, after expiration it will expire, and needs to be deleted manually
start_datetimestampExport starting time
end_datetimestampExport ending time
part_countnumberAn export can contain up to 25 rooms (including direct and room conversations). If the requested export contains more, there will be multiple parts (tasks) created.
partnumberPart number
file_sizenumberExport size in bytes if the export is completed
download_urlstringUrl where the export json file can be downloaded

Additionally there is a paging element in the response with the following values:

KEYTYPEDESCRIPTION
previousstringLink to the previous page (if exists)
nextstringLink to the next page (if exists)
page_countnumberNumber of available pages
item_countnumberTotal number of items

Example of a success response:

{
"exports": [
{
"id": 123,
"status": "init",
"requested_at": 1622111094,
"expires_at": 1622311094,
"is_expired": false,
"start_date": 1622111094,

Error responses

Possible error responses:

HTTP RESPONSE CODEERROR VALUEERROR CONDITIONS
401 Unauthorizedinvalid_tokenThe provided access token is missing, revoked, expired or malformed
402 Payment Requiredinvalid_requestThe user does not have the streamchat benefit
403 Forbiddenlack_of_ownershipThe API user is not allowed to manage the given channel
404 Not Foundnot_foundChannel not found
503 Service UnavailableThere is a temporary error on the server which makes it impossible to serve the request

Initialize an export

POST https://api.video.ibm.com/channels/{channelId}/chat/exports.json

Parameters

KEYTYPEIMPORTANCEDESCRIPTION
start_datetimestampREQUIREDStart date of the export
end_datetimestampREQUIREDEnd date of the export
include_mainbooleanOPTIONALExport should contain the General room. Default: true
include_privatebooleanOPTIONALExport should include direct/group conversations. Default: false
roomsstring[]OPTIONALList of the rooms to be included in the export request

The Content-Type of the request should be application/x-www-form-urlencoded.

Example of the request:

POST /channels/1234/chat/exports.json HTTP/1.1
Host: api.video.ibm.com
Authorization: Bearer 3c2573673b782f6544405a22636f3d5d3b6f3950
Content-Type: application/x-www-form-urlencoded
start_date=1622111094&end_date=1623111094&include_main=true&include_private=false&rooms[]=room_7dce3a5c-4ecd-4275-a4f9-c39aba521f02

Success response

Upon success, a response with HTTP status “200 OK” is returned with the following key-value pairs inside the exports root array. Timestamps are Unix timestamps in seconds.

KEYTYPEDESCRIPTION
idnumberTask ID
statusstringValues: init, pending, completed, failed
requested_attimestampExport init date
expires_attimestampExport expiration
is_expiredbooleanAn export lives up 24 hours, after expiration it will expire, and needs to be deleted manually
start_datetimestampExport starting time
end_datetimestampExport ending time
part_countnumberAn export can contain up to 25 rooms (including direct and room conversations). If the requested export contains more, there will be multiple parts (tasks) created.
partnumberPart number
file_sizenumberExport size in bytes if the export is completed
download_urlstringUrl where the export json file can be downloaded

Example of a success response:

{
"exports": [
{
"id": 123,
"status": "init",
"requested_at": 1622111094,
"expires_at": 1622311094,
"is_expired": false,
"start_date": 1622111094,

Error responses

Possible error responses:

HTTP RESPONSE CODEERROR VALUEERROR CONDITIONS
400 Bad Requestbad_requestInvalid value was supplied
401 Unauthorizedinvalid_tokenThe provided access token is missing, revoked, expired or malformed
402 Payment Requiredinvalid_requestThe user does not have the streamchat benefit
403 Forbiddenlack_of_ownershipThe API user is not allowed to manage the given channel
404 Not Foundnot_foundChannel not found
503 Service UnavailableThere is a temporary error on the server which makes it impossible to serve the request

Get an export task on a channel

GET https://api.video.ibm.com/channels/{channelId}/chat/exports/{taskId}.json

Success response

Upon success, a response with HTTP status “200 OK” is returned with the following key-value pairs inside the export root object. Timestamps are Unix timestamps in seconds.

KEYTYPEDESCRIPTION
idnumberTask ID
statusstringValues: init, pending, completed, failed
requested_attimestampExport init date
expires_attimestampExport expiration
is_expiredbooleanAn export lives up 24 hours, after expiration it will expire, and needs to be deleted manually
start_datetimestampExport starting time
end_datetimestampExport ending time
part_countnumberAn export can contain up to 25 rooms (including direct and room conversations). If the requested export contains more, there will be multiple parts (tasks) created.
partnumberPart number
file_sizenumberExport size in bytes if the export is completed
download_urlstringUrl where the export json file can be downloaded

Example of a success response:

{
"export": {
"id": 123,
"status": "init",
"requested_at": 1622111094,
"expires_at": 1622311094,
"is_expired": false,
"start_date": 1622111094,
"end_date": 1632111094,

Possible error responses:

HTTP RESPONSE CODEERROR VALUEERROR CONDITIONS
401 Unauthorizedinvalid_tokenThe provided access token is missing, revoked, expired or malformed
402 Payment Requiredinvalid_requestThe user does not have the streamchat benefit
403 Forbiddenlack_of_ownershipThe API user is not allowed to manage the given channel
404 Not Foundnot_foundChannel not found
503 Service UnavailableThere is a temporary error on the server which makes it impossible to serve the request

Delete an export task

DELETE https://api.video.ibm.com/channels/{channelId}/chat/exports/{taskId}.json

Success response

Upon success, a response with HTTP status ““204” No content” is returned.

Error responses

Possible error responses:

HTTP RESPONSE CODEERROR VALUEERROR CONDITIONS
401 Unauthorizedinvalid_tokenThe provided access token is missing, revoked, expired or malformed
402 Payment Requiredinvalid_requestThe user does not have the streamchat benefit
403 Forbiddenlack_of_ownershipThe API user is not allowed to manage the given channel
404 Not Foundnot_foundChannel not found
503 Service UnavailableThere is a temporary error on the server which makes it impossible to serve the request

Restart an export task

POST https://api.video.ibm.com/channels/{channelId}/chat/exports/{taskId}/restart.json

Upon success, a response with HTTP status “200 OK” is returned with the following key-value pairs inside the export root object. Timestamps are Unix timestamps in seconds.

KEYTYPEDESCRIPTION
idnumberTask ID
statusstringValues: init, pending, completed, failed
requested_attimestampExport init date
expires_attimestampExport expiration
is_expiredbooleanAn export lives up 24 hours, after expiration it will expire, and needs to be deleted manually
start_datetimestampExport starting time
end_datetimestampExport ending time
part_countnumberAn export can contain up to 25 rooms (including direct and room conversations). If the requested export contains more, there will be multiple parts (tasks) created.
partnumberPart number
file_sizenumberExport size in bytes if the export is completed
download_urlstringUrl where the export json file can be downloaded

Example of a success response:

{
"export": {
"id": 123,
"status": "init",
"requested_at": 1622111094,
"expires_at": 1622311094,
"is_expired": false,
"start_date": 1622111094,
"end_date": 1632111094,

Error responses

Possible error responses:

HTTP RESPONSE CODEERROR VALUEERROR CONDITIONS
401 Unauthorizedinvalid_tokenThe provided access token is missing, revoked, expired or malformed
402 Payment Requiredinvalid_requestThe user does not have the streamchat benefit
403 Forbiddenlack_of_ownershipThe API user is not allowed to manage the given channel
404 Not Foundnot_foundChannel not found
503 Service UnavailableThere is a temporary error on the server which makes it impossible to serve the request