Process video
This page provides basic code samples that you can use to start processing your videos with the Async API.
Submit a video file
To submit an .mp4 file to the Async API, use the following operation:
POST https://api.symbl.ai/v1/process/video
Try our interactive examples!
We provide interactive versions of these code samples: curl, Node.js, Python
To get started with our code samples, see Set Up Your Test Environment.
ACCESS_TOKEN="<ACCESS_TOKEN>"
CONVERSATION_NAME="<NAME>"
FILE_PATH="<FILE>"
curl \
--url "https://api.symbl.ai/v1/process/video?name=$CONVERSATION_NAME" \
--header "Content-Type: video/mp4" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--data-binary "@$FILE_PATH"
import fetch from 'node-fetch';
import fs from 'fs';
import qs from 'qs';
const accessToken = '<ACCESS_TOKEN>';
const filePath = '<FILE>';
const symblaiParams = {
'name': '<NAME>'
}
const fetchResponse = await fetch(`https://api.symbl.ai/v1/process/video?${qs.stringify(symblaiParams)}`, {
method: 'post',
body: fs.createReadStream(filePath),
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': "video/mp4",
}
});
const responseBody = await fetchResponse.json();
console.log(responseBody);
import requests
access_token = "<ACCESS_TOKEN>"
file_path = "<FILE>"
symblai_params = {
"name": "<NAME>"
}
headers = {
"Authorization": "Bearer " + access_token,
"Content-Type": "video/mp4"
}
with open(file_path, "rb") as file:
request_body = file.read()
response = requests.request(
method="POST",
url="https://api.symbl.ai/v1/process/video",
params=symblai_params,
headers=headers,
data=request_body
)
print(response.json())
Where:
<ACCESS_TOKEN>
is a valid API access token.<NAME>
is the name of the conversation. If no name is provided, the Async API sets the name to the conversation ID. Forcurl
, because the name is a query parameter, this value must be URL encoded. For example, the URL-encoded format ofBusiness Meeting 2022-01-01
isBusiness%20Meeting%202022-01-01
.<FILE>
is the local path to the video file that you want to submit to the Async API.
For additional reference information, see Submit video (File).
To learn more about the optional parameters that you can apply to your request, see Async Feature Reference.
Submit a video URL
To submit a video URL to the Async API, use the following operation:
POST https://api.symbl.ai/v1/process/video/url
Try our interactive examples!
We provide interactive versions of these code samples: curl, Node.js, Python
To get started with our code samples, see Set Up Your Test Environment.
ACCESS_TOKEN="<ACCESS_TOKEN>"
CONVERSATION_NAME="<NAME>"
FILE_URL="<URL>"
curl \
--url "https://api.symbl.ai/v1/process/video/url" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--data '{
"name": "'"$CONVERSATION_NAME"'",
"url": "'"$FILE_URL"'"
}'
import fetch from 'node-fetch';
const accessToken = '<ACCESS_TOKEN>';
const symblaiParams = {
'name': '<NAME>',
'url': '<URL>'
}
const fetchResponse = await fetch('https://api.symbl.ai/v1/process/video/url', {
method: 'post',
body: JSON.stringify(symblaiParams),
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
const responseBody = await fetchResponse.json();
console.log(responseBody);
import os
import requests
access_token = "<ACCESS_TOKEN>"
symblai_params = {
"name": "<NAME>",
"url": "<URL>"
}
headers = {
"Authorization": "Bearer " + access_token,
"Content-Type": "application/json"
}
response = requests.request(
method="POST",
url="https://api.symbl.ai/v1/process/video/url",
headers=headers,
json=symblai_params
)
print(response.json())
Where:
<ACCESS_TOKEN>
is a valid API access token.<NAME>
is the name of the conversation. For example,Business Meeting 2022-01-01
. If no name is provided, the Async API sets the name to the conversation ID.<URL>
is a direct URL to a supported video file. For example:
https://www.example.com/files/example_video.mp4
For additional reference information, see Submit video (URL).
To learn more about the optional parameters that you can apply to your request, see Async Feature Reference.
Append a video file
After you process a conversation with the Symbl.ai APIs, you can use the Async API to add additional content to the conversation. For example, you can use the Async API to collect a series of recordings with one customer under one conversation ID.
Try our interactive examples!
We provide interactive versions of these code samples: curl, Node.js, Python
To get started with our code samples, see Set Up Your Test Environment.
ACCESS_TOKEN="<ACCESS_TOKEN>"
CONVERSATION_ID="<CONVERSATION_ID>"
CONVERSATION_NAME="<NAME>"
FILE_PATH="<FILE>"
curl --request PUT \
--url "https://api.symbl.ai/v1/process/video/$CONVERSATION_ID?name=$CONVERSATION_NAME" \
--header "Content-Type: video/mp4" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--data-binary "@$FILE_PATH"
import fetch from 'node-fetch';
import fs from 'fs';
import qs from 'qs';
const accessToken = '<ACCESS_TOKEN>';
const conversationId = '<CONVERSATION_ID>'
const filePath = '<FILE>';
const symblaiParams = {
'name': '<NAME>'
}
const fetchResponse = await fetch(`https://api.symbl.ai/v1/process/video/${conversationId}?${qs.stringify(symblaiParams)}`, {
method: 'put',
body: fs.createReadStream(filePath),
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': "video/mp4",
}
});
const responseBody = await fetchResponse.json();
console.log(responseBody);
import requests
access_token = "<ACCESS_TOKEN>"
conversation_id = "<CONVERSATION_ID>"
file_path = "<FILE>"
symblai_params = {
"name": "<NAME>"
}
headers = {
"Authorization": "Bearer " + access_token,
"Content-Type": "video/mp4"
}
with open(file_path, "rb") as file:
request_body = file.read()
response = requests.request(
method="PUT",
url="https://api.symbl.ai/v1/process/video/" + conversation_id,
params=symblai_params,
headers=headers,
data=request_body
)
print(response.json())
Where:
<ACCESS_TOKEN>
is a valid API access token.<CONVERSATION_ID>
is the ID of a conversation that you previously processed.<FILE>
is the local path to the video file that you want to submit to the Async API.<NAME>
is the name of the conversation. If no name is provided, the Async API sets the name to the conversation ID. Forcurl
, because the name is a query parameter, this value must be URL encoded. For example, the URL-encoded format ofBusiness Meeting 2022-01-01
isBusiness%20Meeting%202022-01-01
.
For additional reference information, see Append video (File).
To learn more about the optional parameters that you can apply to your request, see Async Feature Reference.
Append a video URL
Try our interactive examples!
We provide interactive versions of these code samples: curl, Node.js, Python
To get started with our code samples, see Set Up Your Test Environment.
ACCESS_TOKEN="<ACCESS_TOKEN>"
CONVERSATION_ID="<CONVERSATION_ID>"
CONVERSATION_NAME="<NAME>"
FILE_URL="<URL>"
curl --request PUT \
--url "https://api.symbl.ai/v1/process/video/url/$CONVERSATION_ID" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--data '{
"name": "'"$CONVERSATION_NAME"'",
"url": "'"$FILE_URL"'"
}'
import fetch from 'node-fetch';
const accessToken = '<ACCESS_TOKEN>';
const conversationId = '<CONVERSATION_ID>';
const symblaiParams = {
'name': '<NAME>',
'url': '<URL>'
}
const fetchResponse = await fetch(`https://api.symbl.ai/v1/process/video/url/${conversationId}`, {
method: 'put',
body: JSON.stringify(symblaiParams),
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
const responseBody = await fetchResponse.json();
console.log(responseBody);
import os
import requests
access_token = "<ACCESS_TOKEN>"
conversation_id = "<CONVERSATION_ID>"
symblai_params = {
"name": "<NAME>",
"url": "<URL>"
}
headers = {
"Authorization": "Bearer " + access_token,
"Content-Type": "application/json"
}
response = requests.request(
method="PUT",
url="https://api.symbl.ai/v1/process/video/url/" + conversation_id,
headers=headers,
json=symblai_params
)
print(response.json())
Where:
<ACCESS_TOKEN>
is a valid API access token.<CONVERSATION_ID>
is the ID of a conversation that you previously processed.<NAME>
is the name of the conversation. If no name is provided, the Async API sets the name to the conversation ID. Forcurl
, because the name is a query parameter, this value must be URL encoded. For example, the URL-encoded format ofBusiness Meeting 2022-01-01
isBusiness%20Meeting%202022-01-01
.<URL>
is a direct URL to a supported video file. For example:
https://www.example.com/files/example_video.mp4
For additional reference information, see Append video (URL).
To learn more about the optional parameters that you can apply to your request, see Async Feature Reference.
Response
The Async API returns a common response for all submit and append requests. The following table describes the fields in the response.
Field | Description |
---|---|
conversationId | The unique identifier of a conversation that is submitted to the Async API. The conversation ID is critical for generating Conversation Intelligence. |
jobId | The unique identifier of the processing job. The job ID can be used to get the status of the job. |
Example response
The following is an example of the common response for submit and append requests to the Async API.
{
conversationId: '5784375198220288',
jobId: 'cf4a68fe-225a-4946-9819-d961d7a31058'
}
Updated almost 2 years ago