Storage Service
On this page
Operations on storage service resources. 4 endpoints, each relative to https://api.nxgen.cloud/api/v1 and authenticated as described under Authentication.
POST /storage-service/clip
Upload Cip to Cloud Storage
Parameters
Name | In | Type | Required | Description |
|---|---|---|---|---|
file | formData | file | yes | File to upload. |
sensorId | formData | string | no | Sensor ID |
deviceId | formData | string | no | Device ID |
Responses
Status | Description | Body |
|---|---|---|
200 | Success | |
400 | Invalid Input | |
401 | Unauthorized | |
403 | Forbidden | |
412 | No Content | |
500 | Internal Server Error |
Example 200 response:
{
"id": "string",
"filepath": "string"
}POST /storage-service/clip/filter
Gets Files list with filtering, sorting and pagination. It allows hierarchical level searching. It can be filtered using specified hierarchy or it uses the logged in user hierarchy. This gives the option to get additional entity fields in the response. Also provides configuration meta data about entity.
Request body
Files filtering and sorting
{
"filters": [
{
"columnName": "string (required)",
"type": "distinctList | date | number | StringConditionFilter (required)",
"filter": "object (required)"
}
],
"sortOrder": [
{
"columnName": "string",
"isAscending": "boolean"
}
],
"primaryColumns": [
"string"
],
"hierarchyLevel": "string",
"hierarchyId": "string",
"nPerPage": "number",
"pageNumber": "number",
"isConfigDetailRequired": "boolean",
"getConfig": "boolean",
"getChildOrParent": "boolean"
}Responses
Status | Description | Body |
|---|---|---|
200 | Success | object |
204 | No Content | |
400 | Invalid input | |
401 | Unauthorized | |
403 | Forbidden |
Example 200 response:
{
"config": {
"columns": [
{
"visibility": true,
"columnName": "commercialName",
"DisplayName": "Device",
"isFilterable": true,
"filterType": "stringCondition",
"sticky": true,
"isRightBorder": true,
"isMandatory": true,
"isNotDraggable": true
}
],
"defaultNPerPage": 50,
"defaultFilterCondition": [],
"defaultSortingOrder": [
{
"columnName": "dateTime",
"isAscending": false
}
],
"maxVisibleColumnCount": 6,
"exportLimitNPerPage": 500
},
"dataResult": [
{
"_id": "65b8ae63dc4355286864f6bc",
"timeStamp": 1706602076710,
"userEmail": "admin@web02.io",
"fileName": "Screenshot 2023-11-20 115021 - Copy (2).png",
"mimetype": "image/png",
"size": 1219944,
"folder": "dc79cb2b0907bea776a3fa437b96e53a",
"signedUrl": "https://events-snapshots.s3-eu-central-1.amazonaws.com/event-clips/dc79cb2b0907bea776a3fa437b96e53a/Screenshot%202023-11-20%20115021%20-%20Copy%20%282%29.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA2B4BNPFBH2CVMGRH%2F20240202%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20240202T072929Z&X-Amz-Expires=3600&X-Amz-Signature=6e0cb0744cd378c74ac2d0bd9199eb82ef278a9d93b4c110b4091efa174df021&X-Amz-SignedHeaders=host"
},
{
"_id": "65bb437ec8c2e356b822beed",
"timeStamp": 1706771321894,
"userEmail": "dinesh@nxgen.io",
"fileName": "vlc-record-2023-12-14-16h34m44s-In The End.mp4",
"mimetype": "video/mp4",
"size": 6478,
"folder": "c206997e6fb05b1ecd131305eb6fa371",
"signedUrl": "https://events-snapshots.s3-eu-central-1.amazonaws.com/event-clips/c206997e6fb05b1ecd131305eb6fa371/vlc-record-2023-12-14-16h34m44s-In%20The%20End.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA2B4BNPFBH2CVMGRH%2F20240202%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20240202T072929Z&X-Amz-Expires=3600&X-Amz-Signature=1680e057f9ec11ca787888859df6ef52863c924c81dc94b9c8e5b016c563ddc8&X-Amz-SignedHeaders=host"
}
],
"totalRecordsCount": 2,
"totalConsumedStorage": 1226422,
"filteredBy": [],
"sortedBy": [
{
"columnName": "dateTime",
"isAscending": false
}
],
"dispatchedAll": false,
"isDefaultProjectionMutated": false,
"isDefaultFilterMutated": false,
"isDefaultSortingMutated": false
}DELETE /storage-service/clip/{id}
Delete Cip from AWS S3
Parameters
Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes |
Responses
Status | Description | Body |
|---|---|---|
200 | Success | |
204 | No Content | |
401 | Unauthorized | |
403 | Forbidden | |
404 | Not Found |
Example 200 response:
{
"message": "File deleted successfully"
}GET /storage-service/clip?folderId={folderId}&hierarchyLevel={hierarchyLevel}&hierarchyId={hierarchyId}
Download Clip from S3
Parameters
Name | In | Type | Required | Description |
|---|---|---|---|---|
folderId | query | string | yes | FileUpload folder id |
path | query | string | no | Local path to save dowanload |
hierarchyLevel | query | string | yes | hierarchyLevel |
hierarchyId | query | string | yes | hierarchyId |
Responses
Status | Description | Body |
|---|---|---|
200 | Success | |
400 | Invalid input | |
401 | Unauthorized | |
403 | Forbidden | |
404 | Not Found |
Example 200 response:
{
"externalUrl": "https://events-snapshots.s3-eu-central-1.amazonaws.com/event-clips/331ba86e5cbfaa6addf8c3ca369e48/Untitled%20design.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA2B4BNPFBH2CVMGRH%2F20240122%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20240122T142622Z&X-Amz-Expires=3600&X-Amz-Signature=b4d134981420b682e17e452662c2ba7bd781371fe0bbfb94f22d39cd240b904f&X-Amz-SignedHeaders=host"
}Thank you — your feedback goes to the team that owns this page.