We are removing support for the file storage platform as of March 29, 2020.
The NodeHost Storage Platform is a new system for hosting and serving files on any site. Files are uploaded and encoded into a database storage system so are not saved as files on disk to keep access to the files as fast as it can be.
The platform is made for site resource sharing. Designed for developers sharing JS or CSS files and other resources with many sites they manage.
Quick jump to call
GET / Folders
GET / Folders Search
GET / Files
GET / Files Search
GET / File Info
POST / Create Folder
POST / Create File
POST / Destroy Folder
POST / Destroy File
GET - Folders
Returns a list of all folders that a user has in the storage service.
Request URL
https://api.nodehost.cloud/get_services_storage_folders
Parameters
None
More info
None
Test URL
https://api.nodehost.cloud/get_services_storage_folders
Response
{
"data": [
{
"id": "q4qupszu6vqaanxo1fcvquyifepbvx0l2rg",
"date": 1553137474,
"name": "Just a sub folder",
"parent": "bwusmovwmpxj64onem3kypvvmy9cifhtbmm"
},
{
"id": "d1q9hexq0jed8fkwzbphdrnlutwazjudlkm",
"date": 1538867947,
"name": "Photos",
"parent": 0
},
{
"id": "bwusmovwmpxj64onem3kypvvmy9cifhtbmm",
"date": 1553137466,
"name": "Test folder",
"parent": 0
}
],
"system_connection": "true",
"system_version": "v2_25_0ee06381a649060a926035dad07a1f192a8a82b4",
"system_user_id": 1232,
"system_user_username": "apiuser",
"system_process_id": "false",
"system_process_command": "false"
}
GET - Folders Search
Returns a list of all folders that a user has in the storage service that have a name that matches or contains the query string.
Request URL
https://api.nodehost.cloud/get_services_storage_folders_search
Parameters
query - A search term to find folders using
More info
None
Test URL
https://api.nodehost.cloud/get_services_storage_folders_search?query=folder
Response
{
"data": [
{
"id": "q4qupszu6vqaanxo1fcvquyifepbvx0l2rg",
"date": 1553137474,
"name": "Just a sub folder",
"parent": "bwusmovwmpxj64onem3kypvvmy9cifhtbmm"
},
{
"id": "bwusmovwmpxj64onem3kypvvmy9cifhtbmm",
"date": 1553137466,
"name": "Test folder",
"parent": 0
}
],
"system_connection": "true",
"system_version": "v2_29_00237774f6e95fee5a6d69571c4b044ba9ddad8b",
"system_user_id": 1232,
"system_user_username": "apiuser",
"system_process_id": "false",
"system_process_command": "false"
}
GET - Files
Returns a list of all files that a user has in the storage service in a folder.
Request URL
https://api.nodehost.cloud/get_services_storage_files
Parameters
folder - The folder ID (optional)
foldername - The folder name if it's unique (optional and replacement to folder id)
More info
If no folder is provided will list the last 100 files uploaded. You can list the folder contents by providing the folder id like the example below or using the optional foldername parameter instead of the folder id if the name is unique.
Test URL
https://api.nodehost.cloud/get_services_storage_files?folder=d1q9hexq0jed8fkwzbphdrnlutwazjudlkm
Response
{
"data": {
"id": "ethohtdaoj5jhxoeztdvgmhvce56inixqqm8jzj8josqmqfvkjra686imbofy6dpxzyrzh0i6sjsjpodifeonk6kwu",
"date": "1538867966",
"tableid": "f",
"folder": "d1q9hexq0jed8fkwzbphdrnlutwazjudlkm",
"filename": "DWOduQtVAAEWva-.jpg",
"contenttype": "image/jpeg",
"filesize": "238226",
"description": "false",
"status": "online"
},
"system_connection": "true",
"system_version": "v_55_65418c9",
"system_user_id": "1232",
"system_user_username": "apiuser"
}
GET - Files Search
Returns a list of all files that a user has that matches the search results.
Request URL
https://api.nodehost.cloud/get_services_storage_files_search
Parameters
query - A search term to look for, this can be a file type, description or something in the file name
folder - The folder ID (optional)
foldername - The folder name if it's unique (optional and replacement to folder id)
More info
You can narrow the list by providing the folder id or using the optional foldername parameter instead of the folder id if the name is unique.
Test URL
https://api.nodehost.cloud/get_services_storage_files_search?query=unsplash
Response
{
"data": [
{
"id": "gyhdpzecsmhvtbcnjnj2ucvi5nrs0avhycuym9aevskp4wcnjmpeykm3iewjpr0odvmp4xe0zop3ksr4ogjm15qkkm",
"date": 1553138317,
"tableid": "c",
"folder": "cpb4eizkttliu59ft6ujyyoynxdy2pgeerj",
"filename": "jaanus-jagomagi-1446976-unsplash.jpg",
"contenttype": "image/jpeg",
"filesize": 13045773,
"description": "false",
"status": "online"
},
{
"id": "nsroax0tzbk9wcnupmjyiczbu27kz5imx9bxhc1golpkxdfnzzlrbkt6marmf9zdjkb0wchlyxvwkkjkj4clofsbfj",
"date": 1553138308,
"tableid": "b",
"folder": "cpb4eizkttliu59ft6ujyyoynxdy2pgeerj",
"filename": "niclas-illg-1443574-unsplash.jpg",
"contenttype": "image/jpeg",
"filesize": 2148969,
"description": "false",
"status": "online"
},
{
"id": "tj5rij80t8kcinvunl8lpkpwvpe76ip0burkd0lw9g9rufmh0v3qgtmbiaiptxpvrhp4ibbrrkjlpwdqrgq7zdiioq",
"date": 1553138306,
"tableid": "a",
"folder": "cpb4eizkttliu59ft6ujyyoynxdy2pgeerj",
"filename": "stefano-ghezzi-1441754-unsplash.jpg",
"contenttype": "image/jpeg",
"filesize": 797745,
"description": "false",
"status": "online"
},
{
"id": "wms94qkpnj3bpdrmofcelpqtdfkhtynqkfapwket3i5twwfubh9xhzrleb2ijp94ujt13iu71z1xwgr8yafga71pj4",
"date": 1553138313,
"tableid": "d",
"folder": "cpb4eizkttliu59ft6ujyyoynxdy2pgeerj",
"filename": "todd-turner-1444054-unsplash.jpg",
"contenttype": "image/jpeg",
"filesize": 3167478,
"description": "false",
"status": "online"
}
],
"system_connection": "true",
"system_version": "v2_29_00237774f6e95fee5a6d69571c4b044ba9ddad8b",
"system_user_id": 1232,
"system_user_username": "apiuser",
"system_process_id": "false",
"system_process_command": "false"
}
GET - File Info
Returns info on a file like its table, size, name, and more.
Request URL
https://api.nodehost.cloud/get_services_storage_file_info
Parameters
file - The id for the file
More info
You can use this information to generate the url for the resource. The public file URL path is generated like so.
https://storage.nodehost.cloud/[table]/[id]/[name]
This makes the url for the file requested in the example the following.
https://storage.nodehost.cloud/f/ethohtdaoj5jhxoeztdvgmhvce56inixqqm8jzj8josqmqfvkjra686imbofy6dpxzyrzh0i6sjsjpodifeonk6kwu/DWOduQtVAAEWva-.jpg
The file name is not important and can be anything you want like file.jpg. This is great if you want to hide the original file name when embedding.
Test URL
https://api.nodehost.cloud/get_services_storage_file_info?file=ethohtdaoj5jhxoeztdvgmhvce56inixqqm8jzj8josqmqfvkjra686imbofy6dpxzyrzh0i6sjsjpodifeonk6kwu
Response
{
"data": {
"id": "ethohtdaoj5jhxoeztdvgmhvce56inixqqm8jzj8josqmqfvkjra686imbofy6dpxzyrzh0i6sjsjpodifeonk6kwu",
"date": "1538867966",
"tableid": "f",
"folder": "d1q9hexq0jed8fkwzbphdrnlutwazjudlkm",
"filename": "DWOduQtVAAEWva-.jpg",
"contenttype": "image/jpeg",
"filesize": "238226",
"description": "false",
"status": "online"
},
"system_connection": "true",
"system_version": "v_55_65418c9",
"system_user_id": "1232",
"system_user_username": "apiuser"
}
POST - Create Folder
Creating a folder is as simple as giving a name, the system will give you a ID back that you can use after.
Request URL
https://api.nodehost.cloud/post_services_storage_create_folder
Parameters
name - The name for the new folder
folder - The parent folder ID (optional)
More info
You can also send in a folder parameter that will make it a child of the folder id you set.
Test URL
https://api.nodehost.cloud/post_services_storage_create_folder?name=Awesome Folder
Response
{
"data": {
"status": "created",
"id": "263j19ausj5zdv2ovylycycg68rk3ig5pjp"
},
"system_connection": "true",
"system_version": "v_55_65418c9",
"system_user_id": "1232",
"system_user_username": "apiuser"
}
POST - Create File
Once you post a file for upload you will get back data including a file ID that will be used once the file is processed.
Request URL
https://api.nodehost.cloud/post_services_storage_create_file
Parameters
folder - The ID for the folder web are uploading the file to
More info
Uploading a file can take some time as it moves from the API to the main system and gets processed. It will then be moved to the file storage server where it will be for all requests once the upload is finished.
Header needed for upload
Content-Type application/x-www-form-urlencoded
PHP CURL rules for file upload
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('/path/to/file')),
CURLOPT_HTTPHEADER => array("Content-Type: application/x-www-form-urlencoded"),
Test URL
https://api.nodehost.cloud/post_services_storage_create_file?folder=d1q9hexq0jed8fkwzbphdrnlutwazjudlkm
Response
{
"data": {
"status": "uploaded",
"id": "oig1arr8lqxfz1usdljqpcawwghnerv39m4kdwtznrfmsjog587vki2hyj4dazgkmluzhozepp1izpyey6ajocanve",
"filecode": "oig1arr8lqxfz1usdljqpcawwghnerv39m4kdwtznrfmsjog587vki2hyj4dazgkmluzhozepp1izpyey6ajocanve",
"filename": "pJ7KjeOY_400x400.jpg",
"filetype": "image/jpeg",
"directlink": "https://storage.nodehost.cloud/e/oig1arr8lqxfz1usdljqpcawwghnerv39m4kdwtznrfmsjog587vki2hyj4dazgkmluzhozepp1izpyey6ajocanve/pJ7KjeOY_400x400.jpg"
},
"system_connection": "true",
"system_version": "v_55_65418c9",
"system_user_id": "1232",
"system_user_username": "apiuser"
}
POST - Destroy Folder
Destroy a folder in the file platform with the ID.
Request URL
https://api.nodehost.cloud/post_services_storage_destroy_folder
Parameters
folder - The ID for the folder to be destroyed
More info
None
Test URL
https://api.nodehost.cloud/post_services_storage_destroy_folder?folder=d1q9hexq0jed8fkwzbphdrnlutwazjudlkm
Response
{
"data": "Folder destroyed",
"system_connection": "true",
"system_version": "v_55_65418c9",
"system_user_id": "1232",
"system_user_username": "apiuser"
}
POST - Destroy File
Destroy a file in the file platform with the ID.
Request URL
https://api.nodehost.cloud/post_services_storage_destroy_file
Parameters
file - The ID for the file to be destroyed
More info
None
Test URL
https://api.nodehost.cloud/post_services_storage_destroy_file?file=ethohtdaoj5jhxoeztdvgmhvce56inixqqm8jzj8josqmqfvkjra686imbofy6dpxzyrzh0i6sjsjpodifeonk6kwu
Response
{
"data": "File destroyed",
"system_connection": "true",
"system_version": "v_55_65418c9",
"system_user_id": "1232",
"system_user_username": "apiuser"
}
The NodeHost Storage Platform is a new system for hosting and serving files on any site. Files are uploaded and encoded into a database storage system so are not saved as files on disk to keep access to the files as fast as it can be.
The platform is made for site resource sharing. Designed for developers sharing JS or CSS files and other resources with many sites they manage.
Quick jump to call
GET / Folders
GET / Folders Search
GET / Files
GET / Files Search
GET / File Info
POST / Create Folder
POST / Create File
POST / Destroy Folder
POST / Destroy File
GET - Folders
Returns a list of all folders that a user has in the storage service.
Request URL
https://api.nodehost.cloud/get_services_storage_folders
Parameters
None
More info
None
Test URL
https://api.nodehost.cloud/get_services_storage_folders
Response
{
"data": [
{
"id": "q4qupszu6vqaanxo1fcvquyifepbvx0l2rg",
"date": 1553137474,
"name": "Just a sub folder",
"parent": "bwusmovwmpxj64onem3kypvvmy9cifhtbmm"
},
{
"id": "d1q9hexq0jed8fkwzbphdrnlutwazjudlkm",
"date": 1538867947,
"name": "Photos",
"parent": 0
},
{
"id": "bwusmovwmpxj64onem3kypvvmy9cifhtbmm",
"date": 1553137466,
"name": "Test folder",
"parent": 0
}
],
"system_connection": "true",
"system_version": "v2_25_0ee06381a649060a926035dad07a1f192a8a82b4",
"system_user_id": 1232,
"system_user_username": "apiuser",
"system_process_id": "false",
"system_process_command": "false"
}
GET - Folders Search
Returns a list of all folders that a user has in the storage service that have a name that matches or contains the query string.
Request URL
https://api.nodehost.cloud/get_services_storage_folders_search
Parameters
query - A search term to find folders using
More info
None
Test URL
https://api.nodehost.cloud/get_services_storage_folders_search?query=folder
Response
{
"data": [
{
"id": "q4qupszu6vqaanxo1fcvquyifepbvx0l2rg",
"date": 1553137474,
"name": "Just a sub folder",
"parent": "bwusmovwmpxj64onem3kypvvmy9cifhtbmm"
},
{
"id": "bwusmovwmpxj64onem3kypvvmy9cifhtbmm",
"date": 1553137466,
"name": "Test folder",
"parent": 0
}
],
"system_connection": "true",
"system_version": "v2_29_00237774f6e95fee5a6d69571c4b044ba9ddad8b",
"system_user_id": 1232,
"system_user_username": "apiuser",
"system_process_id": "false",
"system_process_command": "false"
}
GET - Files
Returns a list of all files that a user has in the storage service in a folder.
Request URL
https://api.nodehost.cloud/get_services_storage_files
Parameters
folder - The folder ID (optional)
foldername - The folder name if it's unique (optional and replacement to folder id)
More info
If no folder is provided will list the last 100 files uploaded. You can list the folder contents by providing the folder id like the example below or using the optional foldername parameter instead of the folder id if the name is unique.
Test URL
https://api.nodehost.cloud/get_services_storage_files?folder=d1q9hexq0jed8fkwzbphdrnlutwazjudlkm
Response
{
"data": {
"id": "ethohtdaoj5jhxoeztdvgmhvce56inixqqm8jzj8josqmqfvkjra686imbofy6dpxzyrzh0i6sjsjpodifeonk6kwu",
"date": "1538867966",
"tableid": "f",
"folder": "d1q9hexq0jed8fkwzbphdrnlutwazjudlkm",
"filename": "DWOduQtVAAEWva-.jpg",
"contenttype": "image/jpeg",
"filesize": "238226",
"description": "false",
"status": "online"
},
"system_connection": "true",
"system_version": "v_55_65418c9",
"system_user_id": "1232",
"system_user_username": "apiuser"
}
GET - Files Search
Returns a list of all files that a user has that matches the search results.
Request URL
https://api.nodehost.cloud/get_services_storage_files_search
Parameters
query - A search term to look for, this can be a file type, description or something in the file name
folder - The folder ID (optional)
foldername - The folder name if it's unique (optional and replacement to folder id)
More info
You can narrow the list by providing the folder id or using the optional foldername parameter instead of the folder id if the name is unique.
Test URL
https://api.nodehost.cloud/get_services_storage_files_search?query=unsplash
Response
{
"data": [
{
"id": "gyhdpzecsmhvtbcnjnj2ucvi5nrs0avhycuym9aevskp4wcnjmpeykm3iewjpr0odvmp4xe0zop3ksr4ogjm15qkkm",
"date": 1553138317,
"tableid": "c",
"folder": "cpb4eizkttliu59ft6ujyyoynxdy2pgeerj",
"filename": "jaanus-jagomagi-1446976-unsplash.jpg",
"contenttype": "image/jpeg",
"filesize": 13045773,
"description": "false",
"status": "online"
},
{
"id": "nsroax0tzbk9wcnupmjyiczbu27kz5imx9bxhc1golpkxdfnzzlrbkt6marmf9zdjkb0wchlyxvwkkjkj4clofsbfj",
"date": 1553138308,
"tableid": "b",
"folder": "cpb4eizkttliu59ft6ujyyoynxdy2pgeerj",
"filename": "niclas-illg-1443574-unsplash.jpg",
"contenttype": "image/jpeg",
"filesize": 2148969,
"description": "false",
"status": "online"
},
{
"id": "tj5rij80t8kcinvunl8lpkpwvpe76ip0burkd0lw9g9rufmh0v3qgtmbiaiptxpvrhp4ibbrrkjlpwdqrgq7zdiioq",
"date": 1553138306,
"tableid": "a",
"folder": "cpb4eizkttliu59ft6ujyyoynxdy2pgeerj",
"filename": "stefano-ghezzi-1441754-unsplash.jpg",
"contenttype": "image/jpeg",
"filesize": 797745,
"description": "false",
"status": "online"
},
{
"id": "wms94qkpnj3bpdrmofcelpqtdfkhtynqkfapwket3i5twwfubh9xhzrleb2ijp94ujt13iu71z1xwgr8yafga71pj4",
"date": 1553138313,
"tableid": "d",
"folder": "cpb4eizkttliu59ft6ujyyoynxdy2pgeerj",
"filename": "todd-turner-1444054-unsplash.jpg",
"contenttype": "image/jpeg",
"filesize": 3167478,
"description": "false",
"status": "online"
}
],
"system_connection": "true",
"system_version": "v2_29_00237774f6e95fee5a6d69571c4b044ba9ddad8b",
"system_user_id": 1232,
"system_user_username": "apiuser",
"system_process_id": "false",
"system_process_command": "false"
}
GET - File Info
Returns info on a file like its table, size, name, and more.
Request URL
https://api.nodehost.cloud/get_services_storage_file_info
Parameters
file - The id for the file
More info
You can use this information to generate the url for the resource. The public file URL path is generated like so.
https://storage.nodehost.cloud/[table]/[id]/[name]
This makes the url for the file requested in the example the following.
https://storage.nodehost.cloud/f/ethohtdaoj5jhxoeztdvgmhvce56inixqqm8jzj8josqmqfvkjra686imbofy6dpxzyrzh0i6sjsjpodifeonk6kwu/DWOduQtVAAEWva-.jpg
The file name is not important and can be anything you want like file.jpg. This is great if you want to hide the original file name when embedding.
Test URL
https://api.nodehost.cloud/get_services_storage_file_info?file=ethohtdaoj5jhxoeztdvgmhvce56inixqqm8jzj8josqmqfvkjra686imbofy6dpxzyrzh0i6sjsjpodifeonk6kwu
Response
{
"data": {
"id": "ethohtdaoj5jhxoeztdvgmhvce56inixqqm8jzj8josqmqfvkjra686imbofy6dpxzyrzh0i6sjsjpodifeonk6kwu",
"date": "1538867966",
"tableid": "f",
"folder": "d1q9hexq0jed8fkwzbphdrnlutwazjudlkm",
"filename": "DWOduQtVAAEWva-.jpg",
"contenttype": "image/jpeg",
"filesize": "238226",
"description": "false",
"status": "online"
},
"system_connection": "true",
"system_version": "v_55_65418c9",
"system_user_id": "1232",
"system_user_username": "apiuser"
}
POST - Create Folder
Creating a folder is as simple as giving a name, the system will give you a ID back that you can use after.
Request URL
https://api.nodehost.cloud/post_services_storage_create_folder
Parameters
name - The name for the new folder
folder - The parent folder ID (optional)
More info
You can also send in a folder parameter that will make it a child of the folder id you set.
Test URL
https://api.nodehost.cloud/post_services_storage_create_folder?name=Awesome Folder
Response
{
"data": {
"status": "created",
"id": "263j19ausj5zdv2ovylycycg68rk3ig5pjp"
},
"system_connection": "true",
"system_version": "v_55_65418c9",
"system_user_id": "1232",
"system_user_username": "apiuser"
}
POST - Create File
Once you post a file for upload you will get back data including a file ID that will be used once the file is processed.
Request URL
https://api.nodehost.cloud/post_services_storage_create_file
Parameters
folder - The ID for the folder web are uploading the file to
More info
Uploading a file can take some time as it moves from the API to the main system and gets processed. It will then be moved to the file storage server where it will be for all requests once the upload is finished.
Header needed for upload
Content-Type application/x-www-form-urlencoded
PHP CURL rules for file upload
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('/path/to/file')),
CURLOPT_HTTPHEADER => array("Content-Type: application/x-www-form-urlencoded"),
Test URL
https://api.nodehost.cloud/post_services_storage_create_file?folder=d1q9hexq0jed8fkwzbphdrnlutwazjudlkm
Response
{
"data": {
"status": "uploaded",
"id": "oig1arr8lqxfz1usdljqpcawwghnerv39m4kdwtznrfmsjog587vki2hyj4dazgkmluzhozepp1izpyey6ajocanve",
"filecode": "oig1arr8lqxfz1usdljqpcawwghnerv39m4kdwtznrfmsjog587vki2hyj4dazgkmluzhozepp1izpyey6ajocanve",
"filename": "pJ7KjeOY_400x400.jpg",
"filetype": "image/jpeg",
"directlink": "https://storage.nodehost.cloud/e/oig1arr8lqxfz1usdljqpcawwghnerv39m4kdwtznrfmsjog587vki2hyj4dazgkmluzhozepp1izpyey6ajocanve/pJ7KjeOY_400x400.jpg"
},
"system_connection": "true",
"system_version": "v_55_65418c9",
"system_user_id": "1232",
"system_user_username": "apiuser"
}
POST - Destroy Folder
Destroy a folder in the file platform with the ID.
Request URL
https://api.nodehost.cloud/post_services_storage_destroy_folder
Parameters
folder - The ID for the folder to be destroyed
More info
None
Test URL
https://api.nodehost.cloud/post_services_storage_destroy_folder?folder=d1q9hexq0jed8fkwzbphdrnlutwazjudlkm
Response
{
"data": "Folder destroyed",
"system_connection": "true",
"system_version": "v_55_65418c9",
"system_user_id": "1232",
"system_user_username": "apiuser"
}
POST - Destroy File
Destroy a file in the file platform with the ID.
Request URL
https://api.nodehost.cloud/post_services_storage_destroy_file
Parameters
file - The ID for the file to be destroyed
More info
None
Test URL
https://api.nodehost.cloud/post_services_storage_destroy_file?file=ethohtdaoj5jhxoeztdvgmhvce56inixqqm8jzj8josqmqfvkjra686imbofy6dpxzyrzh0i6sjsjpodifeonk6kwu
Response
{
"data": "File destroyed",
"system_connection": "true",
"system_version": "v_55_65418c9",
"system_user_id": "1232",
"system_user_username": "apiuser"
}
Published on: 11 / 03 / 2020