File Handling

post
Upload

https://api.marsview.ai/v1/conversation/upload
This route will upload the audio/video file to the Marsview Platform. Once the asset is sucessfully uploaded it returns back a file_id. This file_id can be used to compute/receive/delete the metadata for this file.
Request
Response
Request
Headers
appSecret
required
string
<sample-app-secret>
appId
required
string
<sample-app-Id>
Content-Type
optional
string
application/json
Body Parameters
title
optional
string
Title of the asset. This can be used to organize and search through the uploaded assets
description
optional
string
a brief description of the asset being uploaded. This can be used to organize and search through the uploaded assets
linkType
required
string
Type of asset being uploaded ("Video"/"Audio")
link
required
string
Publicly accessible URL for the Audio/Video asset
linkSource
optional
string
used to describe the source of the link, this is an optional field.
userId
required
string
userID of the account (email ID used to login to the account)
Response
200: OK
A File ID is returned in the JSON body once the processing job is launched successfully. This File ID can be used to check the status of the job or fetch the results of the job once the metadata is computed
{
"status":true,
"file_id":32dcef1a-5724-4df8-a4a5-fb43c047716b
}
400: Bad Request
Status code 400 is returned with the error code and the message. Usually happens when the uploaded audio/video file is corrupted (or) when the asset link is invalid
{
"status":false,
"error":{
"code":"FHU03",
"message":"Invalid Audio/Video link"
}
}

delete
Delete

https://api.marsview.ai/v1/conversation/delete
Request
Response
Request
Headers
Content-Type
optional
string
application/json
appId
optional
string
<sample-app-id>
appSecret
optional
string
<sample-app-secret>
Body Parameters
settings.file
optional
boolean
Delete the uploaded audio/video file.
settings.metadata
optional
boolean
Delete all generated metadata for this file.
fileID
optional
string
FileID of the asset.
userId
optional
string
userID of the account (email ID used to login to the account)
Response
200: OK
status is set to true when the requested file is deleted.
{
"status":true,
"deleted_data":{
"metadata":true,
"file":true
}
"message":"File with file-id: 32dcef1a-5724-4df8-a4a5-fb43c047716b is deleted sucessfully"
}
404: Not Found
When the requested fileID is not found or has already been deleted, status is set to false.
{
"status":false,
"message":"file-id: 32dcef1a-5724-4df8-a4a5-fb43c047716b not found"
}

‚Äč