7

Total Sites

3

Total Users

293

Total Optimize CSS

978

Total Image Converted

API Documentation

1. Delete CSS Response by URL
Endpoint

POST /api/delete-css-response/:id

Description

Deletes a specific CSS response from the database based on the requested URL and validates the API key.

URL Parameters
  • id: The requested URL that corresponds to the CSS response to be deleted.
Query Parameters
  • api_key: A valid API key associated with a site.
Request Example
cURL:
curl -X POST "https://codefusiononline.com/api/delete-css-response/yourRequestedURL" \
-H "Content-Type: application/json" \
--data-urlencode "api_key=YOUR_API_KEY"
Laravel HTTP Request:
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'Content-Type' => 'application/json',
])->post('https://codefusiononline.com/api/delete-css-response/yourRequestedURL', [
    'api_key' => 'YOUR_API_KEY',
]);
WordPress Remote Request:
$response = wp_remote_post('https://codefusiononline.com/api/delete-css-response/yourRequestedURL', [
    'body' => [
        'api_key' => 'YOUR_API_KEY',
    ],
]);
JavaScript (Fetch API):
fetch('https://codefusiononline.com/api/delete-css-response/yourRequestedURL?api_key=YOUR_API_KEY', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
    }
})
.then(response => response.json())
.then(data => {
    console.log(data); // Handle the response data
})
.catch(error => {
    console.error('Error:', error); // Handle error
});
Response Example
{
    "message": "css_response deleted successfully"
}
Error Responses
  • 401 Unauthorized: If the API key is missing.
  • 403 Forbidden: If the API key is invalid.
  • 500 Internal Server Error: If there's a database error.
2. Delete Site Cache by Site ID
Endpoint

POST /api/delete-site-cache/:siteId

Description

Deletes all CSS responses associated with a specific site based on its ID and validates the API key.

URL Parameters
  • siteId: The ID of the site whose cache will be deleted.
Query Parameters
  • api_key: A valid API key associated with the site.
Request Example
cURL:
curl -X POST "https://codefusiononline.com/api/delete-site-cache/YOUR_SITE_ID" \
-H "Content-Type: application/json" \
--data-urlencode "api_key=YOUR_API_KEY"
Laravel HTTP Request:
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'Content-Type' => 'application/json',
])->post('https://codefusiononline.com/api/delete-site-cache/YOUR_SITE_ID', [
    'api_key' => 'YOUR_API_KEY',
]);
WordPress Remote Request:
$response = wp_remote_post('https://codefusiononline.com/api/delete-site-cache/YOUR_SITE_ID', [
    'body' => [
        'api_key' => 'YOUR_API_KEY',
    ],
]);
JavaScript (Fetch API):
fetch('https://codefusiononline.com/api/delete-site-cache/YOUR_SITE_ID?api_key=YOUR_API_KEY', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
    }
})
.then(response => response.json())
.then(data => {
    console.log(data); // Handle the response data
})
.catch(error => {
    console.error('Error:', error); // Handle error
});
Response Example
{
    "message": "Site cache deleted successfully"
}
Error Responses
  • 401 Unauthorized: If the API key is missing.
  • 403 Forbidden: If the API key is invalid for the specified site ID.
  • 500 Internal Server Error: If there's a database error.
Back to Top