Folders and Files
Apart from the web interface, edeXa's blockchain file and folder functionality is also accessible through an API. To gain access, please create an account.
tip
MAINNET BASEURL
https://api-edexagw.edexa.com/bshare
TESTNET BASEURL
https://api-edexagw.io-world.com/bshare
Create Folder
POST folders
- This API endpoint allows you to create a new folder to the system. To access this endpoint, you must include your
Bearer Token
in the Authorization header.
cURL
curl --location 'https://api-edexagw.io-world.com/bshare/api/folders' \
--header 'Authorization: Bearer <token>' \
--data '{
"folderName": "f5",
"folderType": "private",
"organizationId": "user_98t0xsbmis"
}'
Parameters
Key | Value | Type | Description |
---|---|---|---|
folderName | `f5` | String | Enter the folder name you want to add |
folderType | `private` | String | Enter the folder type: public or private |
organizationId | `user_98t0xsbmis` | File | Enter the userId |
Responses
200: Success
{
"status": 200,
"message": "Folder created successfully",
"data": {
"folderName": "f5",
"userId": "667a63************",
"parentFolderId": "667a6************",
"folderLevel": 1,
"isSign": false,
"isBin": false,
"defaultOptions": false,
"digitalTwinId": null,
"previousFolderId": null,
"folderType": "private",
"deletedAt": null,
"_id": "667a63************",
"createdAt": "2024-06-25T06:29:12.809Z",
"updatedAt": "2024-06-25T06:29:12.809Z"
}
}
400: Token not passed in headers
{
"status": 400,
"message": "Authorization Token Not Found"
}
401: Token passed in headers is not valid
{
"status": 401,
"message": "Invalid auth token"
}
500: Some technical issue occured
{
"status": 500,
"message": "Something went wrong, please try again"
}
Folders Listing
GET folders?page=1&limit=10
- This API endpoint can be fetch to get the detail of the folders in the system.
- To get the Folder, you can pass
organizationId
orpage
orlimit
as query parameter and required parameters are marked with *. - To access this endpoint, you must include your
Bearer Token
in the Authorization header.
cURL
curl --location 'https://api-edexagw.io-world.com/bshare/api/folders?page=1&limit=10&organizationId=user_98t0xsbmis' \
--header 'Authorization: Bearer <token>' \
Parameters
Key | Value | Type | Description |
---|---|---|---|
page* | `1` | Number | |
limit* | `10` | Number | To set number of data at requested page |
organizationId | `user_98t0xsbmis` | String | The ID of the organization to filter the folders |
Responses
200: Success
{
"status": 200,
"message": "Folder get successfully",
"data": {
"count": 1,
"data": [
{
"_id": "667a6********",
"folderName": "child folder",
"parentFolderId": "667a6********",
"folderLevel": 2,
"isBin": false,
"createdAt": "2024-06-25T06:29:58.485Z",
"userData": {
"id": "667a6********",
"name": null
}
}
]
}
}
401: Unauthorized
{
"status": 401,
"message": "Invalid auth token"
}
500: Internal Server Error
{
"status": 500,
"message": "Something went wrong, please try again"
}
Folder Details
GET folders/:parentFolderId/folder/:folderId?organizationId=organizationId
- This API endpoint can be fetch to get the details of the individual folders in the system.
- To access this endpoint, you must include your
Bearer Token
in the Authorization header.
cURL
curl --location -g 'https://api-edexagw.io-world.com/bshare/api/folders/{parentFolderId}/folder/{folderId}?organizationId=Enter%20the%20userId' \
--header 'Authorization: Bearer <token>' \
Parameters
Key | Value | Type | Description |
---|---|---|---|
organizationId | `user_98t0xsbmis` | String | Enter the userId |
Responses
200: Success
{
"status": 200,
"message": "Folder get successfully",
"data": {
"_id": "667a6********",
"folderName": "child folder",
"userId": "667a6********",
"parentFolderId": "667a6********",
"folderLevel": 2,
"isBin": false,
"previousFolderId": null,
"folderType": "private",
"createdAt": "2024-06-25T06:29:58.485Z",
"updatedAt": "2024-06-25T06:29:58.485Z"
}
}
401: Unauthorized
{
"status": 401,
"message": "Invalid auth token"
}
500: Internal Server Error
{
"status": 500,
"message": "Something went wrong, please try again"
}
Update Folder
PATCH folders/:parentFolderId?organizationId=organizationId
This API endpoint allows you to modify the folder name & folder Type of a specific folder.
To access this endpoint, you must include your
Bearer Token
in the Authorization header.
cURL
curl --location --request PATCH 'https://api-edexagw.io-world.com/bshare/api/folders/<folderId>' \
--header 'Authorization: Bearer <token>' \
--data '{
"organizationId" : "user_98t0xsbmis",
"folderName": "f5.update"
}'
Parameters
Key | Value | Type | Description |
---|---|---|---|
organizationId | `user_98t0xsbmis` | String | Enter the userId |
Responses
200: Success
{
"status": 200,
"message": "Folder updated successfully"
}
401: Unauthorized
{
"status": 401,
"message": "Invalid auth token"
}
500: Internal Server Error
{
"status": 500,
"message": "Something went wrong, please try again"
}
Delete Folder
DELETE folders/:folderId?organizationId=organizationId
- This API endpoint can be used to delete the folders from the system.
- To access this endpoint, you must include your
Bearer Token
in the Authorization header.
cURL
curl --location -g --request DELETE 'https://api-edexagw.io-world.com/bshare/api/folders/{folderId}?organizationId=Enter%20the%20userId' \
--header 'Authorization: Bearer <token>' \
Parameters
Key | Value | Type | Description |
---|---|---|---|
organizationId | `user_98t0xsbmis` | String | Enter the organization ID |
Responses
200: Success
{
"status": 200,
"message": "Folder deleted successfully"
}
401: Unauthorized
{
"status": 401,
"message": "Invalid auth token"
}
500: Internal Server Error
{
"status": 500,
"message": "Something went wrong, please try again"
}
Create new File
POST files
- This API endpoint allows you to create a new file within a specified folder. To access this endpoint, you must include your
Bearer Token
in the Authorization header.
cURL
curl --location 'https://api-edexagw.io-world.com/bshare/api/files' \
--header 'Authorization: Bearer token'
--form 'fileName="new file"' \
--form 'folderId="folder Id"' \
--form 'attachments=@"/path/to/your/Downloads/demo.png"' \
--form 'description="Hello-1"' \
--form 'organizationId="Enter the userId"'
Parameters
Key | Value | Type | Description |
---|---|---|---|
fileName | `new file` | String | Enter the file name whatever you want to add |
folderId | `16308d*****************` | String | Enter the folder ID |
attachments | `file` | File | Enter the file attachment |
description | `Hello world` | String | Enter the file description |
organizationId | `16308d*****************` | String | Enter the organization ID |
Responses
200: Success
{
"status": 200,
"message": "File created successfully",
"data": {
"fileId": "667a6ddee84484cad7934989",
"transactionId": "bc08****************************************",
"uniqueId": "de04**********************",
"thumbUrl": "**********************/demo.png"
}
}
400: Token not passed in headers
{
"status": 400,
"message": "Authorization Token Not Found"
}
401: Token passed in headers is not valid
{
"status": 401,
"message": "Invalid auth token"
}
500: Some technical issue occured
{
"status": 500,
"message": "Something went wrong, please try again"
}
Validate file
POST files/validate
- This API endpoint allows you to check the details of a uploaded file. You need to include your
Bearer Token
in the Authorization header.
cURL
curl --location 'https://api-edexagw.io-world.com/bshare/api/files/validate' \
--header 'Authorization: Bearer <token>' \
--form 'fileId="667a6ddee84484cad7934989"' \
--form 'organizationId="user_98t0xsbmis"' \
--form 'attachments=@"/path/to/your/Downloads/demo.png"'
Parameters
Key | Value | Type | Description |
---|---|---|---|
fileId | `66829f60728a0680ea553486` | String | Enter the file ID |
organizationId | `user_98t0xsbmis` | String | Enter the organization ID |
attachments | `file` | File | Enter the file attachment |
Responses
200: Success
{
"status": 200,
"message": "File validate successfully"
}
400: Token not passed in headers
{
"status": 400,
"message": "Authorization Token Not Found"
}
401: Token passed in headers is not valid
{
"status": 401,
"message": "Invalid auth token"
}
500: Some technical issue occured
{
"status": 500,
"message": "Something went wrong, please try again"
}
File Details
GET folders/:folderId/file/:fileId?organizationId=organizationId
- This API endpoint can be fetch to get the details of the individual files in the folder.
- To access this endpoint, you must include your
Bearer Token
in the Authorization header.
cURL
curl --location -g 'https://api-edexagw.io-world.com/bshare/api/folders/{folderId}/file/{fileId}?organizationId=Enter%20the%20userId' \
--header 'Authorization: Bearer <token>' \
Parameters
Key | Value | Type | Description |
---|---|---|---|
organizationId | `user_98t0xsbmis` | String | Enter the organization ID |
Responses
200: Success
{
"status": 200,
"message": "File get successfully",
"data": {
"_id": "667a6********",
"description": "Hello-1",
"fileName": "new file",
"lat": null,
"long": null,
"transactionId": "bc08a**************",
"attachmentHash": "",
"createdAt": "2024-06-25T07:12:29.000Z",
"uploadedBy": "",
"file": {
"fileName": "demo.png",
"fileSize": 9104,
"fileType": "png",
"url": "******/demo.png",
"mimetype": "image/png",
"pageNumber": 0,
"height": 0,
"width": 0
},
"ownerInfo": {
"ownerId": "667a6********",
"name": "",
"userName": "",
"email": "j.****@gmail.com",
"profilePicture": "",
"thumbProfilePicture": ""
},
"isVersion": false,
"isFavourite": false,
"isDateUpdated": false,
"durationChangedDate": "",
"fileType": "private",
"encryptedBuffer": "",
"webEncryptedBuffer": "",
"versionId": null,
"type": "file"
}
}
401: Unauthorized
{
"status": 401,
"message": "Invalid auth token"
}
500: Internal Server Error
{
"status": 500,
"message": "Something went wrong, please try again"
}
Update file
PATCH files/:fileId
- This API endpoint allows you to update the details of a specific file using its fileId. You need to include your
Bearer Token
in the Authorization header.
cURL
curl --location --request PATCH 'https://api-edexagw.io-world.com/bshare/api/files/{fileId}' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"organizationId": "user_98t0xsbmis",
"description": "This is to check update description working again"
}'
Parameters
Key | Value | Type | Description |
---|---|---|---|
organizationId | `user_98t0xsbmis` | String | Enter the userId |
fileName | `16308d*****************` | String | Enter the new file name |
description | `This is the update description` | String | Enter the new updated description |
Responses
200: Success
{
"status": 200,
"message": "File updated successfully"
}
400: Token not passed in headers
{
"status": 400,
"message": "Authorization Token Not Found"
}
401: Token passed in headers is not valid
{
"status": 401,
"message": "Invalid auth token"
}
500: Some technical issue occured
{
"status": 500,
"message": "Something went wrong, please try again"
}