Skip to main contentIBM Video Streaming Developers

QnA

Check QnA is enabled

GET https://api.video.ibm.com/channels/{channelId}/settings/qna.json

Success response

Upon success a response with HTTP status “200 OK” is returned with the following key-value pairs.

KEYTYPEDESCRIPTION
enabledbooleanQnA is enabled
is_default_interactive_modulebooleanQnA is the default interactive module on the channel page

Example of a success response:

{
"enabled": true,
"is_default_interactive_module": false
}

Error responses

Possible error responses:

HTTP RESPONSE CODEERROR VALUEERROR CONDITIONS
401 Unauthorizedinvalid_tokenThe provided access token is missing, revoked, expired or malformed
403 Unauthorizedlack_of_ownershipThe provided access token could not access the given channel
503 Service UnavailableThere is a temporary error on the server which makes it impossible to serve the request

Turn on/off QnA

PUT https://api.video.ibm.com/channels/{channelId}/settings/qna.json

Parameters

KEYTYPEIMPORTANCEDESCRIPTION
enablestringREQUIREDtrue/false

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

Example of the request:

POST /channels/1234/settings/qna.json HTTP/1.1
Host: api.video.ibm.com
Authorization: Bearer 3c2573673b782f6544405a22636f3d5d3b6f3950
Content-Type: application/x-www-form-urlencoded
enable=true

Success response

Upon success the response body is empty with an HTTP Status code of 204.

Error responses

Possible error responses:

HTTP RESPONSE CODEERROR VALUEERROR CONDITIONS
401 Unauthorizedinvalid_tokenThe provided access token is missing, revoked, expired or malformed
403 Unauthorizedlack_of_ownershipThe provided access token could not access the given channel
503 Service UnavailableThere is a temporary error on the server which makes it impossible to serve the request

Get a list of QnA questions on a channel

Returns the QnA questions on a channel

GET https://api.video.ibm.com/channels/{channelId}/qna/questions.json

Parameters

The query parameters for the GET request:

PARAMETERTYPEIMPORTANCEDESCRIPTION
fromintegerOPTIONALList start timestamp
tointegerOPTIONALList end timestamp
pageintegerOPTIONALRequested page number (value is 1 by default)
pagesizeintegerOPTIONALRequested page size (value is 100 by default, max. 100)

Success response

Upon success a response with HTTP status “200 OK” is returned with the following key-value pairs under an questions key.

KEYTYPEDESCRIPTION
user_display_namestringQuestioner’s display name
questionstringQuestion
answerstringAnswer (if the question has been answered)
user_emailstringQuestioner’s email
created_atintegerThe date and time when the question was asked (Unix timestamp)
is_editedbooleanTrue if the question has been edited
is_archivedbooleanTrue if the question has been archived
is_moderatedbooleanTrue if the question has been moderated
votesintegerNumber of votes the question got

Example of a success response:

{
"questions": [
{
"user_display_name": "john",
"question": "How is the weather where you are?",
"answer": "It's beautiful",
"user_email": "john@example.com",
"created_at": 1599852837,
"is_edited": false,

The paging information can be found under the paging key. Example:

{
"paging": {
"previous": "https://api.video.ibm.com/channels/CHANNEL_ID/qna/questions.json?page=1",
"next": "https://api.video.ibm.com/channels/CHANNEL_ID/qna/questions.json?page=3",
"page_count": 3,
"item_count": 272
}
}

Error responses

Possible error responses:

HTTP RESPONSE CODEERROR VALUEERROR CONDITIONS
401 Unauthorizedinvalid_tokenThe provided access token is missing, revoked, expired or malformed
403 Unauthorizedlack_of_ownershipThe provided access token could not access the given channel
503 Service UnavailableThere is a temporary error on the server which makes it impossible to serve the request