Cloud Toolkit

Welcome to the Cloud Toolkit API, a powerful set of tools designed to streamline your development process. Whether you're generating thumbnails, uploading files, or handling complex image manipulations, our API provides reliable and easy-to-use solutions.

File Uploader Mailer Captcha
/api/bcloud/fileuploader/upload

Method: POST

Description:

Body Parameters:

  • file: file to upload

Usage Examples:

const formData = new FormData();
formData.append('file', fileInput.files[0]);

fetch('https://fileuploader.cloudmateria.com/api/bcloud/fileuploader/upload', { method: 'POST', body: formData }) .then(res => res.json()) .then(data => console.log(data));

/api/bcloud/fileuploader/render?folder={folder}&filename={filename}

Method: GET

Description:

Body Parameters:

  • folder: name of the folder
  • filename: name of the file

Usage Examples:

fetch('https://fileuploader.cloudmateria.com/api/bcloud/fileuploader/render?folder=myfolder&filename=myfile.png')
  .then(res => res.blob())
  .then(blob => {
    const url = URL.createObjectURL(blob);
    window.open(url);
  });
/api/bcloud/fileuploader/delete

Method: DELETE

Description:

Body Parameters:

  • folder: name of the folder
  • filename: name of the file

fetch('https://fileuploader.cloudmateria.com/api/bcloud/fileuploader/delete', {
  method: 'DELETE',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    folder: 'myfolder',
    filename: 'myfile.png'
  })
})
.then(res => res.json())
.then(data => console.log(data));
    
/api/mailer/send-mail

Method: POST

Description: Send an email using the configured mail transporter.

Body Parameters (JSON):

  • to (string, required): Recipient's email address.
  • subject (string, required): Email subject line.
  • text (string, required): Plain text version of the email content.
  • html (string, optional): HTML content for richer email formatting.

Example Request Body:

{
  "to": "recipient@example.com",
  "subject": "Welcome!",
  "text": "Hello, this is a plain text email.",
  "html": "

Hello, this is an HTML email.

" }

Usage Examples:

import axios from 'axios';

axios.post('/api/mailer/send-mail', { to: 'recipient@example.com', subject: 'Hello!', text: 'This is plain text.', html: 'This is HTML' }).then(res => { console.log('Success:', res.data); }).catch(err => { console.error('Error:', err); });

/api/captcha/generate

Method: GET
Description: Generate a CAPTCHA SVG and an associated captchaId to verify later.

Response Example:

{
  "captchaId": "abc123def456",
  "captchaSvg": "<svg xmlns=....>...</svg>"
}

/api/captcha/verify

Method: POST
Description: Verify the user's CAPTCHA input against the generated one.

Body Parameters (JSON):

  • captchaId (string, required): ID received from /generate endpoint.
  • userInput (string, required): User's input for the CAPTCHA.

Example Request Body:

{
  "captchaId": "abc123def456",
  "userInput": "A1b2C3"
}

Response Example:

{
  "success": true
}

Usage Examples:

import axios from 'axios';

// First, GET the captcha axios.get('https://captcha.cloudmateria.com/api/captcha/generate') .then(res => { console.log('Captcha:', res.data); // Display captchaSvg to the user and get userInput const captchaId = res.data.captchaId; const userInput = 'A1b2C3'; // User's input

// Then, POST to verify
return axios.post('https://captcha.cloudmateria.com/api/captcha/verify', {
  captchaId,
  userInput
});

}) .then(res => { console.log('Verification:', res.data); }) .catch(err => console.error(err));

Back to Top