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.
KEY | TYPE | DESCRIPTION |
---|---|---|
enabled | boolean | QnA is enabled |
is_default_interactive_module | boolean | QnA 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 CODE | ERROR VALUE | ERROR CONDITIONS |
---|---|---|
401 Unauthorized | invalid_token | The provided access token is missing, revoked, expired or malformed |
403 Unauthorized | lack_of_ownership | The provided access token could not access the given channel |
503 Service Unavailable | There 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
KEY | TYPE | IMPORTANCE | DESCRIPTION |
---|---|---|---|
enable | string | REQUIRED | true/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.1Host: api.video.ibm.comAuthorization: Bearer 3c2573673b782f6544405a22636f3d5d3b6f3950Content-Type: application/x-www-form-urlencodedenable=true
Success response
Upon success the response body is empty with an HTTP Status code of 204.
Error responses
Possible error responses:
HTTP RESPONSE CODE | ERROR VALUE | ERROR CONDITIONS |
---|---|---|
401 Unauthorized | invalid_token | The provided access token is missing, revoked, expired or malformed |
403 Unauthorized | lack_of_ownership | The provided access token could not access the given channel |
503 Service Unavailable | There 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:
PARAMETER | TYPE | IMPORTANCE | DESCRIPTION |
---|---|---|---|
from | integer | OPTIONAL | List start timestamp |
to | integer | OPTIONAL | List end timestamp |
page | integer | OPTIONAL | Requested page number (value is 1 by default) |
pagesize | integer | OPTIONAL | Requested 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.
KEY | TYPE | DESCRIPTION |
---|---|---|
user_display_name | string | Questioner’s display name |
question | string | Question |
answer | string | Answer (if the question has been answered) |
user_email | string | Questioner’s email |
created_at | integer | The date and time when the question was asked (Unix timestamp) |
is_edited | boolean | True if the question has been edited |
is_archived | boolean | True if the question has been archived |
is_moderated | boolean | True if the question has been moderated |
votes | integer | Number 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 CODE | ERROR VALUE | ERROR CONDITIONS |
---|---|---|
401 Unauthorized | invalid_token | The provided access token is missing, revoked, expired or malformed |
403 Unauthorized | lack_of_ownership | The provided access token could not access the given channel |
503 Service Unavailable | There is a temporary error on the server which makes it impossible to serve the request |