POST Audio/Video Files

Learn how to upload Audio/Video Files and URL

Now that you have generated the accessToken this page will guide you upload Audio/Video Files or URLs to get a unique Transaction ID txnId.

What is a Transaction ID txnID?

A Transaction ID txnId is a unique ID given to each conversation file that has been uploaded. A conversation can be an audio or a video file or downloable URL.

Upon submitting an audio/video file a unique Transaction ID txnId is returned. This can be used to refer to this particular Conversation to invoke other API calls in the Speech Analytics API.

Uploading a conversation

The source of the audio/video file can be either a local file or a URL. Depending on the source there are two different endpoints given below.

Supported Format: .mp4 .m4a .avi .mp3 .wav

Uploading a Local File

POST https://api.marsview.ai/cb/v1/conversation/save_file

Headers

NameTypeDescription

Content-Type

string

application/json

Authorization

string

API token with type(Bearer)

Request Body

NameTypeDescription

file

string

The Bitstream of the audio/video file.

title

string

Title of the conversation.

description

string

Description of the conversation.

{
    "status": true,
    "data": {
        "txnId": "txn-1c6q61s0kpidmxy9-1622814136928"
    }
}

Uploading via URL

POST https://api.marsview.ai/cb/v1/conversation/save_file_link

Headers

NameTypeDescription

Authorization

string

API token with type(Bearer)

application-type

string

application/json

Request Body

NameTypeDescription

title

string

Title of the conversation

description

string

Description of the conversation

link

string

Publicly accessible URL link to the conversation

{
    "status": true,
    "data": {
        "txnId": "txn-1c6q61s0kpidmxy9-1622814136928"
    }
}

Deleting a conversation

Use this API to permanently delete a conversation along with all of its metadata from the Marsview Cloud.

Delete Conversation

DELETE https://api.marsview.ai/cb/v1/conversation/delete_file/:txnId

Path Parameters

NameTypeDescription

txnId

string

Transaction Id

Headers

NameTypeDescription

Content-Type

string

application-json

Authorization

string

API token with type(bearer)

{
    "status": true,
    "data": "Delete Successful"
}

NOTE: Once deleted the conversation and its metadata will be permanently deleted and cannot be recovered.

Example: How to upload a local Audio/Video File?

Step 1: Get the authentication token accessToken.

Using yourapiKeyand apiSecretyou can generate the accessToken as shown below.

curl --location --request POST 'https://api.marsview.ai/cb/v1/auth/create_access_token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "apiKey":    "{{Insert API Key}}",
    "apiSecret": "{{Insert API Secret}}",
	  "userId":    "demo@marsview.ai"
}'

Step 2: Upload a local audio/video file.

Upload a local audio/video file as shown below. Fill in the FILE_PATH , TITLE and DESCRIPTION for the audio/video file.

curl --location --request POST 'https://api.marsview.ai/cb/v1/conversation/save_file' \
--header 'Content-Type: multipart/form-data' \
--header 'authorization: {{Insert authToken with type}}' \
--form 'file=@"/Videos/test_api/ppt_tips.mp3"' \
--form 'title="Sample Meeting"' \
--form 'description="A Sample local file"' \

Example: How to upload a public URL or an s3 Presigned URL?

Step 1: Get the authentication token.

Using your apiKey and apiSecretyou can generate the accessToken as shown below.

curl --location --request POST 'https://api.marsview.ai/cb/v1/auth/create_access_token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "apiKey":    "{{Insert API Key}}",
    "apiSecret": "{{Insert API Secret}}",
	  "userId":    "demo@marsview.ai"
}'

Step 2: Create an s3 pre-signed URL or use a public URL.

In this example, we will use a public URL and upload it to Marsview Conversation intelligence APIs

For more information on how to create an s3 pre-signed URL refer to AWS Documentation

Please keep a minimum 20 minutes expiry on the pre-signed URL for ensuring a higher success rate of processing. In case the URL has already expired by the time Marsview picks up the request the compute API will return a Failure status with status code AIRDOW002

curl --location --request POST 'https://api.marsview.ai/cb/v1/conversation/save_file_link' \
--header 'Content-Type: application/json' \
--header 'authorization: {{Authentication Token}}' \
--data-raw '{
	"title":"Recruitment Meeting",
	"description":"A sample interview meeting",
	"link": "https://d1sv72xa22bi8g.cloudfront.net/api-samples/Recruitment+Meeting.mp4"
}'

Last updated