Skip to content
Last updated

Asset Upload API (POST)

Cincopa offers multiple ways to bring media into your account, giving you flexibility for different workflows and environments. You can upload directly from a browser using Cincopa’s upload and record widgets, post files from your frontend or backend using a simple HTTP request, handle large files through chunked and resumable uploads, or import assets from an external URL such as a cloud storage link.

Once uploaded, assets can be published individually, added to a gallery, attached as thumbnails, or used as CDN-delivered content, including m3u8 streams for video.

This guide focuses on three API-driven upload methods:

  1. Uploading a file from your local environment using a temporary upload URL.

  2. Import a file directly from an external URL so that Cincopa fetches it for you.

  3. Upload an attachment

Prerequisites

Before using this API, ensure that you have:

Creating an Upload API call

To get the upload URL to your Cincopa account, you will have to call the following API.

API Call URL:

https://api.cincopa.com/v2/asset.get_upload_url.json?api_token=1578842iolmzw0cub25jexk5pk4woqxjeyh&fid=A4KANh__rQ_m&rid=AAAAtAURG&type=subtitle-en-us&ttl=46&sourceip=192.168.1.100

This API CALL contains the API token which needs to be replaced with yours. You will have to add your API token

note
For more information you can refer the Cincopa API Documentation

Once you call this URL, you will get a response with the following information:

API Call Response Body

When you access the API call URL, the API will return a response with some data.

Success: This tells you if the API call was successful. If it returns the success as true then it means the API call was successful.

Upload URL: This returns the Upload URL for your Cincopa Account You can use this URL with an HTTP Post method to upload data to your assets sections. If you can see you will find your Cincopa uid mentioned in the upload URL to upload it to your Cincopa account.

Runtime: This is the amount of time it took for the API call to send a response.

This is an example of the response you can receive:

{    
  "success": true,    
  "upload_url": "https://media.cincopa.com/post.jpg?uid=1411253&d=AAAAcAQtIWBAAAAAAEJqhoA&hash=x521bdtt1lmc3rau4i4qxx4rj3oqhp4b&addtofid=0",    
  "runtime": 28 
} 

Import URL to Cincopa using Upload API

API Call URL

https://api.cincopa.com/v2/asset.upload_from_url.json?api_token=AAAAtAURG&input=https://example.com/image.jpg&fid=A4KANh__rQ_mA&rid=AAAAtAURG&type=thumb

In the above API call URL, you can see it requires two parameters:

api_token: This is the API Token from your Cincopa Account as mentioned above.

input: This is where you will add the external video URL that you want to be uploaded to your Cincopa account. In the above example, we have added a dropbox video link.

note
This method will not support videos hosted on popular consumer sites like YouTube. To migrate your YouTube channel to Cincopa please get in touch with our team. The following API will allow you to upload a video using an input URL and then add it to your Cincopa Account. For more information you can refer the Cincopa API Documentation

If you call this API, you will receive a similar response.

RESPONSE BODY

When you access the API call URL, the API will return a response with some data.

Success: This tells you if the API call was successful. If it returns the success as true then it means the API call was successful.

status_id: This returns the status id for the upload.

Runtime: This is the amount of time it took for the API call to send a response.

{     
  "success": true,     
  "status_id": "c77f5690-2624-4ab3-a87b-d273aa062eef",     
  "runtime": 35 
} 

Once you run the API call you can also check your Assets section to see if the video has been uploaded.

external video

Upload an attachment

API Call URL

https://api.cincopa.com/v2/asset.upload_from_url.json?api_token=1580893io31peuggncxwnvzb1f4nhn4tfve&input=https://raw.githubusercontent.com/Cincopa-com/cincopa-strapi/main/assets/cm-cincopa-strapi.png&rid=AoEDgzuU9S_Z&type=thumb

In the above API call URL, you can see it requires two parameters:

api_token: This is the API Token from your Cincopa Account as mentioned above.

input: This is where you will add the external video URL that you want to be uploaded to your Cincopa account. In the above example, we have added a dropbox video link.

rid: A unique identifier for an asset when attaching it to another existing asset. If an invalid or non-existent rid is provided, the request will be rejected, and the attachment will not be processed. If specified, a type must also be provided.

type: Defines the type of the attached asset. This is particularly important when associating an asset with another asset.

note
For more information you can refer the Cincopa API Documentation

RESPONSE BODY

When you access the API call URL, the API will return a response with some data.

Success: This tells you if the API call was successful. If it returns the success as true then it means the API call was successful.

status_id: This returns the status id for the upload.

Runtime: This is the amount of time it took for the API call to send a response.

{   
  "success": true,   
  "status_id": "bc5d1298-57fd-4cc3-9971-f5289a5918d6",   
  "runtime": 58 
} 

Get upload status

API Call URL

https://api.cincopa.com/v2/asset.upload_from_url_get_status.json?api_token=1580893io31peuggncxwnvzb1f4nhn4tfve&status_id=7fe54064-b54c-4eb9-8f8f-084cf89ef50c

In the above API call URL, you can see it requires two parameters:

api_token: A unique key used for authentication. Must be a valid API key provided by the system. Without the valid api_token, the request will be rejected with a 403 Unauthorized error.

status_id: A unique identifier assigned to each asset upload request. This ID is returned when an asset is uploaded. It is required to track the progress of the upload and retrieve its final status. If an incorrect or non-existent status_id is provided, the request will fail.

RESPONSE BODY

When you access the API call URL, the API will return a response with some data.

progress_bytes: Indicates the number of bytes that have been uploaded so far. This helps track the progress of the upload in real time.

more: Provides additional information related to the upload process. This field may contain messages or metadata relevant to the request.

resid: A unique identifier assigned to the uploaded asset. This ID is essential for referencing the asset in future API calls.

debug: Contains debugging information, including timestamps and details about the request, which can help diagnose issues during the upload process.

file_size_bytes: Indicates the total size of the uploaded file in bytes. This value helps verify the expected file size against the actual upload progress.

status: Represents the current upload status, which can be "inprogress" (ongoing), "completed" (successful), or "failed" (error occurred).

progress: Provides an upload progress indicator. The value can be used to determine how much of the upload is complete.

success: Indicates whether the request was successful. true for success, false for failure. Always true for a 200 response

runtime: Specifies the total time taken to process the request, measured in milliseconds.

{
  "progress_bytes": 0,
  "more": "string",
  "resid": "AAAAcAAJFOAAAAAAAAtAURG",
  "debug": "2025-02-24T09:16:14.8562610-06:00 started... _bytesRecievedTotal=0 _bytesSendTotal=0 url=https://media",
  "file_size_bytes": "62 byte",
  "status": "inprogress",
  "progress": 1,
  "success": true,
  "runtime": 77
}