DBcloudApp - REST API
[ Base URL: http://dbcloud.space ]
curl -X POST http://dbcloud.space/api/ping -H "Content-Type: application/json" -d '{"key":"98c61bdef2beb57bc875b17fb2517957"}'
["ok"]
The function is designed to check the availability of the service.
Indexing project
curl -X POST http://dbcloud.space/api/user_accessible -H "Content-Type: application/json" -d '{"key":"98c61bdef2beb57bc875b17fb2517957","action":"info"}'
{"database":"archival_indexing","archive_table":"test_archival","statistic_table":"test_statistic"}
The function returns information about the tables available to the user and about the database.
curl -X POST http://dbcloud.space/api/get_table_data -H "Content-Type: application/json" -d '{"key":"98c61bdef2beb57bc875b17fb2517957","action":"info","table":"archive"}'
{"hm_date":"String","send_url":"String","json_body":"String","timestamp_indexing":"Int32","project_name":"String"}
The function returns information about the fields in the selected table.
curl -X POST http://dbcloud.space/api/record_statistics_table -H "Content-Type: application/json" -d '{"key":"98c61bdef2beb57bc875b17fb2517957","action":"record","base64_data":"dGVzdCBkYXRhIEJhc2U2NCBmb3JtYXQ=","hm_date":"30-11-2023","send_url":"1680807","timestamp_indexing":"1701377843","project_name":"test_project"}'
["ok"]
The function records data on the Indexing project statistics
Formation of variable base64_data:
$str = '{"data":"test information"}'; $base64_data = base64_encode($str);
Variable hm_date - date of creation of the statistical report
Variable timestamp_indexing - date of creation of the statistical report in Unix Timestamp format
curl -X POST http://dbcloud.space/api/record_arhiv_table -H "Content-Type: application/json" -d '{"key":"98c61bdef2beb57bc875b17fb2517957","action":"record","url_array":"dGVzdCBkYXRhIEJhc2U2NCBmb3JtYXQ=","project_name":"test_project"}'
["ok"]
Formation of variable url_array:
$url_data[] = "google.com/search?q=1"; $url_data[] = "google.com/search?q=2"; $url_data[] = "google.com/search?q=3"; $url_data[] = "google.com/search?q=4"; $url_data[] = "google.com/search?q=5"; $url_array = base64_encode($url_data);
curl -X POST http://dbcloud.space/api/get_data_table -H "Content-Type: application/json" -d '{"key":"98c61bdef2beb57bc875b17fb2517957","action":"reading", "project_name":"test_project", "table":"test_statistic", "sort":"DESC", "limit":"2", "between":"true", "start_data":"1701377843", "end_data":"1701377847"}'
[0]=> array(6) { ["recording_date"]=> string(10) "2023-12-05" ["hm_date"]=> string(10) "30-11-2023" ["send_url"]=> string(7) "1680807" ["json_body"]=> string(1884) "{"all_url_24hours":883979,"send_utl_24hours":883979, "info":[ "google.com/sitemaps/slug-factory-sitemap-306.xml@slug-factory-sitemap-306@48000@41100", "google.com/sitemaps/slug-factory-sitemap-461.xml@slug-factory-sitemap-461@48000@48000", "google.com/sitemaps/slug-factory-sitemap-465.xml@slug-factory-sitemap-465@48000@48000 "]}" ["timestamp_indexing"]=> int(1701377843) ["project_name"]=> string(12) "test_project" }
Retrieving data from database tables.
Variable table - name of the table from which we obtain information
Variable sort - variable value DESC / ASC
Variable between - the variable is optional. If the variable is true, then the start_data and end_data variables indicate the date in Unix Timestamp format
Variable limit - the variable is optional.
BotLog [logflare] project
curl -X POST http://dbcloud.space/api/log_user_accessible -H "Content-Type: application/json" -d '{"key":"98c61bdef2beb57bc875b17fb2517957","action":"info"}'
{"database":"archival_logflare","archive_table":"test_archiv_streaming","table_fields":["method: String","code: String","ip_adres: String","url: String","userAgent: String","timestamp_recording: Int","project_name: String"]}
The function returns information about the tables available to the user and about the database.
curl -X POST http://dbcloud.space/api/log_user_record -H "Content-Type: application/json" -d '{"key":"398c61bdef2beb57bc875b17fb2517957","action":"record","method":"GET","code":"200","ip_adres":"123.123.123.123","url":"www.google.com/search?q=test","userAgent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0","project_name":"test_project","timestamp_recording":"1701377843"}'
["ok"]
Writing streaming data from logflare tool to database
curl -X POST http://dbcloud.space/api/get_data_log_table -H "Content-Type: application/json" -d '{"key":"98c61bdef2beb57bc875b17fb2517957","action":"reading", "project_name":"test_project", "sort":"DESC", "limit":"2", "between":"true", "start_data":"1701377843", "end_data":"1701377847"}'
[0]=> array(8) { ["recording_date"]=> string(10) "2023-12-08" ["method"]=> string(4) "GET" ["code"]=> string(3) "200" ["ip_adres"]=> string(15) "123.123.123.123" ["url"]=> string(9) "www.google.com/search?q=test" ["userAgent"]=> string(28) "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0" ["timestamp_recording"]=> int(1701377843) ["project_name"]=> string(3) "test_project" }
Retrieving data from database tables.
Variable table - name of the table from which we obtain information
Variable sort - variable value DESC / ASC
Variable between - the variable is optional. If the variable is true, then the start_data and end_data variables indicate the date in Unix Timestamp format
Variable limit - the variable is optional.
Example
$url = "http://dbcloud.space/api/ping"; $curl = curl_init($url); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $headers = array( "Content-Type: application/json", ); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); $data = '{"key":"98c61bdef2beb57bc875b17fb2517957"}'; curl_setopt($curl, CURLOPT_POSTFIELDS, $data); $resp = curl_exec($curl); curl_close($curl);
["ok"]