,dlc:;. .,;lkOx, .,,cxkd' ,c;cccl' ..',:ol;. .....,lko. '::'..,,;dxl. .';:;,'..,:;:dxl:,..... ,c,:c:,..,::;:odddoooddl. .;:oc,'':llclddd:',,cko. ';::,,:dkdl:,,,. .,. ':',;:oOOdo:.. :d,,:clddk00Odc, ,l,;:ccc:coxk00Od:, .;;;:cccc;.,::cldxxd, .:;,::ccc, ,:;;;cdd' ..,,,cc;;::;,. .,lxd' ..,c:,;ccclooc::c, .,:od, :dxoc:;;;;;;:cc;'. ';,co' ldoc:;''',..... .',cd, lll;. .;cxd,.. cl;. .:;cddddl. ::. .,,,,,,'
███████╗███████╗██████╗ ██╗ ██╗███████╗██████╗ █████╗ ██████╗ ██╗ ██╔════╝██╔════╝██╔══██╗██║ ██║██╔════╝██╔══██╗ ██╔══██╗██╔══██╗██║ ███████╗█████╗ ██████╔╝██║ ██║█████╗ ██████╔╝ ███████║██████╔╝██║ ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██╔══╝ ██╔══██╗ ██╔══██║██╔═══╝ ██║ ███████║███████╗██║ ██║ ╚████╔╝ ███████╗██║ ██║ ██║ ██║██║ ██║ ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝
████████████████████ Server API - v.0.6 (Production mode) | Made by Anatolii Ovcharuk - https://github.com/Anatolii-Ovcharuk ████████████████████
Use Browser URL for use Server API and press "ENTER". Navigation for documentation API: Documentation about use of Server API: 1. ------------------------------------ API Keys ------------------------------------ ⚠ Attention! In process to work with Server API, you must send API key in request for different operations. Some operations don't needed API Key. API Key - this is key with format string. Example data: { api: "xxx-xx-xxx-xx" }; Also API Key can be in request headers 'x-api-key'; RECOMMENDATION! Not use API Key in URL string. Make this Keys anonyms. Test URL for API Key: POST | ".../api ('.../testkey', '.../testkey?', '.../testkey/:api/:exception?')"; Keys: 1. api - Key for Backend API; 2. exception - Universal key in request object, where ignore cheking API Key. When if set key (exception key value) is exist in requesting object - ignore cheking API Key. 2. ------------------------------------ Authorization module ------------------------------------ METHOD URL AND DESCRIPTION GET, POST | ".../auth/test"; - URL for authorization test. PUT, POST | ".../auth/registration, .../auth/registration?, .../auth/registration/:data?"; - URL for register user. GET, POST | ".../auth/login, .../auth/login?, .../auth/login/:data?"; - URL for login user. GET, POST | ".../auth/logout, .../auth/logout?, .../auth/logout/:id?"; - URL for logout user. PATCH | ".../auth/update, .../auth/update?, .../auth/update/:data?"; - URL for Update user information. PATCH, DELETE | ".../auth/delete, .../auth/delete?, .../auth/delete/:id?"; - URL for Delete user information. URL for receive public (safe) information with using exception filter: GET, POST Method ------>>> ".../auth/getsafe, .../auth/getsafe?, .../auth/getsafe/:id?, .../auth/getsafe/:id/:search?, .../auth/getsafe/:id/:search/:data?, .../auth/getsafe/:id/:search/:data/:exception?"; URL for change password or other data on set: PATCH Method ------>>> ".../auth/repass, .../auth/repass?, .../auth/repass/:set?, .../auth/repass/:set/:valid?, .../auth/repass/:set/:valid/:search?"; Information about Keys with request: id - User id in database; data - Object with user data; search - Value with contain search params in object. Example: { key: "username", value: "Test", revers: true, sort: true } set - object with key and value for change in database, must be object; valid - object with keys for validation in database; filename - This is name file in database, value must be string; numberDatabaseType - This is option to choice database type. Values: 0 - JSON Database | 1 - MongoDB Database numberFormatData - This is option to choice format type data in database. Values: 0 - Use data in key "data" | 1 - Use data in {} EXAMPLE for authenticate (Token in header): GET, POST - ".../auth/test"; HEADER (Token): *KEYWORD* xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx KEYS: {}; EXAMPLE for registration: POST - ".../auth/registration"; KEYS: { data: {"email": "example@gmail.com", "user": "Test", "password": "123456789"}, filename: "users", numberDatabaseType: 0, numberFormatData: 0, }; EXAMPLE for login: GET, POST - ".../auth/login"; KEYS: { data: {"email": "example@gmail.com", "user": "Test", "password": "13579"} filename: "users", numberDatabaseType: 0, numberFormatData: 0, }; EXAMPLE for logout: GET, POST - ".../auth/logout"; KEYS: { id: "xxxxxxxxxxxxxxxx", filename: "users", numberDatabaseType: 0, numberFormatData: 0, }; EXAMPLE for update: PATCH - ".../auth/update"; KEYS: { id: "xxxxxxxxxxxxxxxx", data: {...}, filename: "users", numberDatabaseType: 0, numberFormatData: 0, }; EXAMPLE for delete: PATCH, DELETE - ".../auth/delete"; KEYS: { id: "xxxxxxxxxxxxxxxx", filename: "users", numberDatabaseType: 0, numberFormatData: 0, }; EXAMPLE for getsafe: GET, POST - ".../auth/getsafe"; KEYS: { id: "xxxxxxxxxxxxxxxx", search: { key: "user", value: "Test", revers: true, sort: true }, data: {"email": "example@gmail.com", "user": "Test", "password": "123456789"}, filename: "users", numberDatabaseType: 0, numberFormatData: 0, }; EXAMPLE for repass: PATCH - ".../auth/repass"; KEYS: { set: { password: "xxxxxxxxxxx" }, search: { key: "user", value: "Test", revers: true, sort: true }, valid: {"email": "example@gmail.com", "user": "Test", "password": "123456789"}, filename: "users", numberDatabaseType: 0, numberFormatData: 0, }; 3. ------------------------------------ Basic module ------------------------------------ Receive documentation about API (GET): ".../api/help"; Receive info about API (GET): ".../api/info"; If Test API Enabled, You can use next URL: Test request information (GET): ".../test"; ---> If Test API Enabled, You can use next URL: Test request information (GET): ".../test"; ---> Notice! All data in URL have destructurization in one object {...params, ...query, ...body}. Object keys may be overwritten when duplicated depending on priority. Priority Data in URL Request: 1. Body data; 2. Query data; 3. Params data; 4. ------------------------------------ CMD module ------------------------------------ POST | Check status CMD Module: ".../api/cmd"; POST | Check exist DNS Domain name: ".../api/cmd ('/dns', '/dns?', '/dns/:search?')"; POST | Check exist DNS Domain name: ".../api/cmd/ ('/nslookup', '/nslookup?', '/nslookup/:search?')"; Keys in request: search - That's string to search value. 5. ------------------------------------ Console module ------------------------------------ Notice! For use URL need API Key. Console: ".../api/console"; Console with list command: ".../api/console/help"; Console with command: ".../api/console/*command*"; 6. ------------------------------------ Counters module ------------------------------------ Collect visitors to list: ".../api/counters/visitor"; Notice! | In request you can collect data about user; Use URL with GET, POST -> ".../api/counters ('/visitor', '/visitor?', '/visitor/:data', '/visitor/:data?')"; Receive visitors list (GET): ".../api/counters/show-visitors"; Show counts (GET): ".../api/counters/show-counts"; 7. ------------------------------------ Crypto module ------------------------------------ Supported API crypto-formats: AES / SHA-256 / HMAC / Base64 / SHA-3 / Blake2b / MD5 . Next crypto-formats needs set to secret key for work: AES / HMAC / MD5 Notice: URL's without crypto "key" need API Key. Check status and help Crypto API: .../api/crypto (?api="") - GET method with API Key .../api/crypto?key="" - GET method without API Key Encrypt data (GET, POST): ".../api/crypto ( /encrypt /encrypt? /encrypt/:format? /encrypt/:format/:value? /encrypt/:format/:value/:key? - Notice: Don't need API Key. )". Decrypt data (GET, POST): ".../api/crypto ( /decrypt /decrypt? /decrypt/:format? /decrypt/:format/:value? /decrypt/:format/:value/:key? - Notice: Don't need API Key. )". Verify data crypt (GET, POST): ".../api/crypto ( /verify /verify? /verify/:format? /verify/:format/:value? /verify/:format/:value/:hash? /verify/:format/:value/:hash/:key? - Notice: Don't need API Key. )". 8. ------------------------------------ Database module ------------------------------------ Notice: For use URL need API Key. Database JSON -> Database status: ".../api/database/"; Database with list URL: ".../api/database/help"; MongoDB Database -> Database status: ".../api/mongodb/"; Database with list URL: ".../api/mongodb/help"; 9. ------------------------------------ Detect IP Address module ------------------------------------ URL for detected IP Address (GET, POST): ".../api ( /ip /ip? /ip/:ipv4? /ip/:ipv4/:browser? /ip/:ipv4/:browser/:location? /ip/:ipv4/:browser/:location/:language? )". 10. ------------------------------------ Other module ------------------------------------ Generate and get ID (GET, POST): ".../api/get (/id, /id? , /id/:numbers? )" Notice! | Set key "numbers" for generate ammount numbers in ID. Get current Date (GET): ".../api/get (/date, /date? , /date/:numbers? )" Notice! | Set key "numbers": 0, 1, 2. Get current Time (GET): ".../api/get (/time, /time? , /time/:numbers? )" Notice! | Set key "numbers": 0, 1. Get current System counter information in JSON Format (GET): ".../api/get (/stat, /stats)" Notice! | Set key "numbers": 0, 1. Redirect module (GET): ".../redirect?" Notice! | URL must have key "href". Example how to use: .../redirect?href=*URL* 11. ------------------------------------ Payment module - Braintree ------------------------------------ Notice: For use URL need API Key. ⚠ Attention! Use keys 'data', 'user', 'database' with cryptographic module for protection payment's and all other informations. █ Supported module: Braintree SDK --------------->>>>> Payment module URL's: GET | URL for receive module information and check module status: '.../pay/braintree', '.../pay/braintree?', '.../pay/braintree/help', '.../pay/braintree/help?'; POST, PATCH | URL for payment operations: '.../pay/braintree/payment', '.../pay/braintree/payment?'; Data for payment -> Data for payment must be contain: { id, number, name, expire, cvc, price, issuer, tarif, period, title, pricePerOne, web, iso, email, tel, text } = data; Data = { number: "4111 1111 1111 1111", name: "Antonio Banderas", expire: "12/24", cvc: "332", issuer: "visa", tarif: "1", period: "3", title: "Standart", pricePerOne: "0.75", price: "2.25", id: "111000C6S20250101", web: "example.com", iso: "EUR", email: "user@test.com", tel: "+0000000000", text: "", }; Value 'tarif' - that's permissions level. Higher tarif level - better and higher permissions. Value 'period' - that's ammount month to continue service. Default value for one product - '1'. Value 'title' - Must contain name tarif or service or name / id product. Value 'id' - that's ID user in database for future operations. Value 'web' - that's URL resourse website. Value 'pricePerOne' - that's value 'price' / 'period'. Price for one month or price of one product. Value 'text' - Reserved field for addition support information. User for payment -> User for payment must be contain: { receiver, merchantId, publicKey, privateKey, merchantAccounts, defaultISO } = user; User = { receiver: "NAME", defaultISO: "EUR", merchantId: "BRAINTREE_MERCHANT_ID", publicKey: "BRAINTREE_PUBLIC_KEY", privateKey: "BRAINTREE_PRIVATE_KEY", merchantAccounts: { EUR: 'MERCHANT_VALUE_EUR', USD: 'MERCHANT_VALUE_USD', RUB: 'MERCHANT_VALUE_RUB', CZK: 'MERCHANT_VALUE_CZK', PLN: 'MERCHANT_VALUE_PLN', CAD: 'MERCHANT_VALUE_CAD', }, }; Database for operation when success payment -> Database for operations must be contain: { id: "xxxxxxxxxxxxxxxx", filename: "users", numberDatabaseType: 0, numberFormatData: 0, } Or 'false' for off = database; Information about 'database' Keys: id - User id in database; data - Object with user data; filename - This is name file in database, value must be string; numberDatabaseType - This is option to choice database type. Values: 0 - JSON Database | 1 - MongoDB Database numberFormatData - This is option to choice format type data in database. Values: 0 - Use data in key "data" | 1 - Use data in {} If payment success and set database option, returns values set update 'payments' (array), 'time_expire' (string) and 'level' (string) in database. Example testing number cards: Type of card | Number | Result Visa | 4111 1111 1111 1111 | Success transaction. Mastercard | 5555 5555 5555 4444 | Success transaction. Discover | 6011 0009 9013 9424 | Success transaction. American Exp. | 3782 822463 10005 | Success transaction. Error! Luhn | 4111 1111 1111 1112 | Failed! Not valid card. Rejected | 4000 1111 1111 1115 | Failed! Transaction rejected. You must create account for receive MERCHANT API keys: Braintree SDK Sandbox for Test - https://sandbox.braintreegateway.com/ Braintree Login Sandbox for Test - https://sandbox.braintreegateway.com/login 12. ------------------------------------ Payment module - Buy Me a Cofee (BMC) or Gumroad ------------------------------------ You must create account for receive URL to sell: Link: https://www.buymeacoffee.com/ Notice (01.06.2025): Transaction cost per operation "Buy Me A Cofee" (BMC / Gumroad): 5% + (Stripe 2.9% + $0.30) + 0.5% (Payout) + 1% (International payment) + 0.5% (Subscribe payment) = 9.9% + $0.30 Transaction cost per operation "Gumroad": 10% + 0.5 $ per trancsaction or 30% per trancsaction for premium subscribe. For use module: 1. Create account in BMC / Gumroad on link: https://www.buymeacoffee.com/ (BMC) or https://gumroad.com/ (Gumroad) 2. Create in BMC / Gumroad account PRODUCT/SERVICE and set URL after success pay: ".../pay/bmc/activate" (BMC) or ".../pay/gumroad/activate" (Gumroad); 3. Get in BMC / Gumroad account created link on PRODUCT/SERVICE (In future this is must be value for data object for key "href"); 4. Set on You website PRODUCT/SERVICE link to redirect with data on URL (GET): ".../pay/bmc/redirect?" (BMC) or ".../pay/gumroad/redirect?" (Gumroad). Required keys for data in URL query: "pay", "receiver", "href", "id", "title", "productID", "period", "tarif", "pricePerOne", "price", "iso", "filename", "numberDatabaseType", "numberFormatData" Example: ".../pay/bmc/redirect??href=https%3A%2F%2Fwww.buymeacoffee.com%2Fexample_item_sell/&pay=bmc&title=Standart&tarif=1&period=2&pricePerOne=1&price=2&iso=USD&filename=example_name_database&numberDatabaseType=1&numberFormatData=1&&id=112233C6V20200606&productID=null&email=example@test.com&tel=1234567890&text=Test payment operation&receiver=Name_Surname" Notice! For key "href" you can use "https://" = "https%3A%2F%2F" or not set protocols. Protocols set automatic to "HTTP", but manual set to "HTTPS" will be better way. P.S. You can check of true URL and receive status 200 "OK": ".../pay/bmc/" (BMC) or ".../pay/gumroad/" (Gumroad). Example record data (set in URL query): { <<<------ MODULE pay: "*module_name*" | Required. | Set platform. Value modules: "bmc", "gumroad". <<<------ BUYER/CLIENT/USER id: "25X2ZD13", | Required (database) or Not Required. | User ID, for interaction with the database, if any, and if necessary email: "example@test.com", | Not Required. | User email, for interaction with the database, if any, and if necessary user: "Test", | Not Required. | User name, for interaction with the database, if any, and if necessary tel: "+0000000000", | Not Required. | User phone number, for notifications <<<------ PRODUCT/SERVICE title: "Test name product", | Required. | Product or service name productID: "205Z3X", | Required. | Product or service code period: "3", | Required. | Period (months) or ammount items tarif: "1", | Required. | Tariff (level) pricePerOne: "0.75", | Required. | Price per 1 unit (items) price: "2.25", | Required. | Total price (month/items x pcs.) iso: "EUR", | Required. | Price in currency equivalent text: "Test transaction text string.", | Not Required. | Note on purchase/product/service <<<------ DATABASE filename: "example_shop_database_name", | Required. | This is name file in database, value must be string numberDatabaseType: "1", | Required. | This is option to choice database type. Values: 0 - JSON Database | 1 - MongoDB Database numberFormatData: "0", | Required. | This is option to choice format type data in database. Values: 0 - Use data in key 'data' | 1 - Use data in {} <<<------ TRANSITION origin: "https://shop.example.com", | Required. | Link from which the transition was made href: "https://buymeacoffee.com/example_product", | Required. | Link to redirect payment in BMC / Gumroad Platform <<<------ TIME RECORDING time_date: "03.13.2023, 13:30", | Set Automatic. | Generated time time_value: "1393949567890", | Set Automatic. | Time in "ms" data of key "time_date" time_expire: "9876543210", | Required (database) or set Automatic | Time to expire user account or service in "ms" <<<------ NOTIFICATIONS chatID: "1234567890", | Not Required. | Number ID chat for Telegram sendler. <<<------ ACTIVATION AND TRIGGERS activation: "25X2ZD13", | Set Automatic. | Activation code to enter activated: false, | Set Automatic. | Trigger to prevent reactivation denied: false, | Set Automatic. | Trigger for refusal due to mismatch pending: true } | Set Automatic. | Trigger for waiting for activation P.S. FOR SECURITY URL: Also you can encrypt data, but must send encrypt data in key "crypt" and use only Backend API (Crypto module) for operations (encrypt / decrypt) with data. Data must be encrypt in "AES" format. Example crypted data (set in URL query in key "crypt"): { crypt: "qwerty123X456example789String0..." } | Required. | Encrypted data. Must be encrypt in "AES" format. 13. ------------------------------------ Payment module - Order ------------------------------------ URL Way to access module: ".../pay/order/"; Collect order with comission value for services: (GET): '/comission?', '/comission/:id?', '/comission/:id/:notice?', '/comission/:id/:notice/:total?', '/comission/:id/:notice/:total/:percent?', '/comission/:id/:notice/:total/:percent/:iso?', '/comission/:id/:notice/:total/:percent/:iso/:domain?'; Description data: { id, notice, total, percent, iso, domain }; id - Identificator for order. Required. Value must be in string. notice - Description about sales. Required. Value must be in string and encode in URI string (component). total - Value for total sale in order. Required. percent - Percent for comission. Required. Example: If 5% - must be value "0.05", If 10% - must be value "0.1". iso - That's symbol and/or code of money for order sale. Required. Value must be in string and encode in URI string (component). domain - That's domain where was sales and orders. Not required. Value must be in string. 14. ------------------------------------ Scripts for Frontend ------------------------------------ Only work with "GET" request method. Collect visitor scripts: '/scripts/script-visitor.js'; - Custom collect visitor on Backend; '/scripts/script-ipapi.js'; - "IPapi" service for collect information about visitor; Other scripts: ".../favicon.ico" - Receive icon. ".../scripts/script.js" - Receive script. 15. ------------------------------------ Storage module ------------------------------------ Notice: For use URL need API Key. Local Storage -> FIRST PART URL: '.../api/storage/', GET | Receive list (Help) URL's for Local Storage: '.../', '.../help'; GET, POST | Receive list files and folders: '/list', '/list?', '/list/:symbol?', '/list/:path?'; GET, POST | Download file: '/download', '/download?', '/download/:nameFile?', '/download/:nameFile/:symbol?', '/download/:nameFile/:symbol/:path?'; GET, POST | Open in browser or download file: '/open', '/open?', '/open/:nameFile?', '/open/:nameFile/:symbol?', '/open/:nameFile/:symbol/:path?'; PUT, POST | Upload file: '/upload', '/upload?', '/upload/:nameFile?', '/upload/:nameFile/:symbol?', '/upload/:nameFile/:symbol/:path?'; PATCH, POST | Replace file: '/move', '/move?', '/move/:nameFile?'; PATCH, DELETE | Delete file: '/delete', '/delete?', '/delete/:nameFile?', '/delete/:nameFile/:symbol?', '/delete/:nameFile/:symbol/:path?'; PUT, POST | Create folder: '/create', '/create?', '/create/:nameFolder?', '/create/:nameFolder/:symbol?', '/create/:nameFolder/:symbol/:path?'; PATCH, DELETE | Delete folder: '/remove', '/remove?', '/remove/:nameFolder?', '/remove/:nameFolder/:symbol?', '/remove/:nameFolder/:symbol/:path?'; PATCH, POST | Replace folder: '/replace', '/replace?', '/replace/:nameFolder?'; Keys for 'Replace' or 'Move' operation: nameFolder - Folder name for replace. fromSymbol - Select disk symbol for replace. fromPath - Select disk path for replace. toSymbol - Destination to disk symbol. toPath - Destination to path disk. Keys for other operation: nameFile / nameFolder - Destination object name. file - Destination file. symbol - Destination symbol. path - Destination path. ⚠ If enabled static disk, you can use next URL for access file: Use API Key in request headers 'x-api-key' EXAMPLE: http://localhost:3001/api/disk/r/Storage/test/file.txt GET | '.../api/disk/*disk letter*/*Name folder*/*Name folder*/*Name file with format*'; GET, POST | Auto format link for receive file: '/link', '/link?', '/link/:nameFile?', '/link/:nameFile/:symbol?', '/link/:nameFile/:symbol/:path?'; 16. ------------------------------------ System information module ------------------------------------ Receive (fast) system status in JSON Format (GET): ".../api/system-status-lite"; Receive full (slower) system status in JSON Format (GET): ".../api/system-status"; Receive system informations in JSON Format (GET): ".../api/system-info"; Receive disk informations in JSON Format (GET)".../api/disk-status"; Receive processes in JSON Format (GET): ".../api/processes"; Receive connections in JSON Format (GET): ".../api/connections"; 17. ------------------------------------ Telegram module ------------------------------------ Send Message - Request method's: GET, POST. ".../api/telegram ('/send', '/send?', '/send/:message?', '/send/:message/:format?', '/send/:message/:format/:id?')"; Keys: message - Send message text. Values must be in string; format - Send message with server form. Values must be boolean: true/false (Default value: true); id - Send message on Telegram Chat ID; Example (string): 'xxxxxxxxx, xxxxxxxxx' Get telegram chats id - Request method's: GET. ".../api/telegram ('/chats', '/chats?', '/chats/:find?')"; Keys: find - Set name to find user; Get telegram help - Request method's: GET. ".../api/telegram ('/help', '/help?')";