File

Maybe some Component needs to store files, or some Component needs files as inputs...the Files section is the correct place in these scenarios. For example, let's say you connect a camera that is pointing to the sky, and then you deploy an algorithm that every 10 seconds calculates the probability of a big cloud showing over your solar panels. Say this Component outputs such probability and the cloud picture with annotations. Then you will see that image in the Files section. You may also create a Dashboard to see how that image changes over time in real-time. Last but not least, when you upload a file in this section you can choose to encrypt it to keep your data secure. This works in case of VPN transferred files, for example.


Creating a Folder

To create a folder you only need to specify the name of the folder and the id of the parent folder. The id of the parent folder is optional, and if not specified, the folder will be created in the root directory.

curl --request POST \
  --url https://api.splight.com/v3/engine/file/folders/ \
  --header 'authorization: Splight <access_id> <secret_key>' \
  --header 'content-type: application/json' \
  --data '{
    "name": "<name>",
    "parent": "<parent_id>"
    }'

Reading a Folder

Listing all Folders

To list all folders, you can use the following endpoint. This will return a list of all folders in your account.

curl --request GET \
  --url https://api.splight.com/v3/engine/file/folders/ \
  --header 'authorization: Splight <access_id> <secret_key>' \

Retrive a single Folder

To retrieve a single folder, you can use the folder ID in the URL. This will return detailed information about that specific folder.

curl --request GET \
  --url https://api.splight.com/v3/engine/file/folders/<folder_id>/ \
  --header 'authorization: Splight <access_id> <secret_key>' \

Deleting a Folder

To delete a folder, you can use the following endpoint. This will remove the specified folder from your account.

curl --request DELETE \
  --url https://api.splight.com/v3/engine/file/folders/<folder_id>/ \
  --header 'authorization: Splight <access_id> <secret_key>' \

Reading a File

Listing all Files from a Folder

To list all files, you can use the following endpoint. This will return a list of all files in your account.

curl --request GET \
  --url https://api.splight.com/v3/engine/file/files/ \
  --header 'authorization: Splight <access_id> <secret_key>' \

Retrive a single File

To retrieve a single file, you can use the file ID in the URL. This will return detailed information about that specific file.

curl --request GET \
  --url https://api.splight.com/v3/engine/file/files/<file_id>/ \
  --header 'authorization: Splight <access_id> <secret_key>' \

Deleting a File

To delete a file, you can use the following endpoint. This will remove the specified file from your account.

curl --request DELETE \
  --url https://api.splight.com/v3/engine/file/files/<file_id>/ \
  --header 'authorization: Splight <access_id> <secret_key>' \

Last updated

Was this helpful?