Upload File V1
Deprication Warning
This document is archived and will be maintained only until September 15. Please refer to the latest documentation here for updated information.
Important: Upload File V2 is mandatory for all new customers. Access to older versions is not supported
This document outlines the process of uploading media files to the Release Candidate (RC) environment via the /api/media/upload endpoint. This procedure is crucial for transferring media assets, such as images and videos, to the server for storage and processing.
Environments
Release candidate (RC)
Considerations
For each file size is being limited to 300 MB.
Prerequisites
Access Token: You must obtain a valid access token by authenticating with the service.
Authentication API Key: An API key is required to authenticate the request.
Media File: The file to be uploaded.
Data Payload: A base64 encoded JSON string containing metadata about the file, including tags.
Upload File Endpoint
This endpoint allows you to upload a media file to the respective environment.
End point - api/media/upload
Method - POST
Header -
Authorization: Bearer {{YOUR-ACCESS-TOKEN}}
Form Data -
file: The media file to be uploaded.
data: A base64 encoded string containing the metadata for the upload. The structure of the data is as follows:
{
"tags": {
"tag1": "value1",
"tag2": "value2"
}
}curl -
curl --location '{{BASE-URL}}/api/media/upload' \
--header 'Authorization: Bearer {{YOUR-ACCESS-TOKEN}}' \
--form 'file=@{{FILE}}' \
--form 'data={{DATA}}'Example curl Command
curl --location 'https://sdk-mobile-api.truvideo.com:443/api/media/upload' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDb3ggQXV0byIsImFjY291bnRJZCI6ImM0ZTRiOTA2LWUxMDktNDZiNC1iMThhLTQ0NmViZGNkNzI2ZSIsInN1YkFjY291bnRFeHRlcm5hbElkIjoiYzRlNGI5MDYtZTEwOS00NmI0LWIxOGEtNDQ2ZWJkY2Q3MjZlIiwic3ViQWNjb3VudElkIjoiYjQ0Njg5ZTctMzJmNS0xMWVmLWIyMzQtMDY2MGMzNzA2NjM3IiwiYXV0aCI6IkJBQ0tPRkZJQ0UiLCJleHAiOjE3MjY3NzczNjAsImlhdCI6MTcyNjY5MDk2MH0.3VzD3i7OhNsWSp3YrYccDoIQKQqauVmRDzY4fGV4_cg' \
--form 'file=@"postman-cloud:///1ef54350-aa72-4220-935e-98e7218d4654"' \
--form 'data="eyJ0YWdzIjogeyJERUFMRVJfQ09ERSI6ICJYVEdJUkNYWDEiLCAiQ09NUEFOWV9TVE9SRSI6ICIxMTEiLCAiUk9fTlVNQkVSIjogIjEyMzQ1Njc4IiwgIlZJTiI6ICI1WFlLVENBNjdGRzU3MTgwMiIsICJFWFRfQ1VTVF9JRCI6ICJjdXN0b21lci1pZCIsICJDT05GSVJNQVRJT05fSUQiOiAiWDExMzMyNDMyIiwgIlVQTE9BREVEX0JZX0lEIjogImRsLWFkdmlzb3IiLCAiVVBMT0FERURfQllfTkFNRSI6ICJEYXZpZCBMZWUiLCAiU09VUkNFX0FQUCI6ICJUV1QifX0="'Response -
{
"id": "cc655259-13b8-4392-a338-7e7578ee5642",
"url": "https://sdkmobile-5bb84749-4d69-4d3e-9155-1e0f86651785.s3.us-west-2.amazonaws.com/media/maxresdefault (1).jpg",
"tags": {
"tag1": "value1",
"tag2": "value2"
},
"type": "IMAGE",
"createdDate": "2024-08-21T17:34:10Z",
"title": "maxresdefault (1).jpg"
}If successful, the response will contain details about the uploaded media, including a unique ID and a URL where the media is accessible.
{
"tags": {
"tag1": "value1",
"tag2": "value2"
},
"duration": 120, //media duration in seconds
"includeInReport":true,
"isLibrary": true
}Last updated
Was this helpful?