API Documentation

API Documentation

File Status Check API

Endpoint

GET /api/files

Description

This API endpoint checks if a file is available and returns its information based on the provided URL.

Request Examples

curl -X GET "https://akirabox.com/api/files?url=https://akirabox.com/{id}/file"
import requests

url = "https://akirabox.com/api/files"
params = {
	"url": "https://akirabox.com/{id}/file"
}

response = requests.get(url, params=params)
print(response.json())

$url = 'https://akirabox.com/api/files?url=' . 
	   urlencode('https://akirabox.com/{id}/file');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
const axios = require('axios');

const checkFile = async () => {
	try {
		const response = await axios.get('https://akirabox.com/api/files', {
			params: {
				url: 'https://akirabox.com/{id}/file'
			}
		});
		
		console.log( response.data);
	} catch (error) {
		if (error.response) {
			console.error('Error:', error.response.data.message);
		} else {
			console.error('Error:', error.message);
		}
	}
};

checkFile();

Response Examples

Successful Response (200)
{
	"status": 200,
	"name": "example.pdf",
	"size": "1.2 MB",
	"type": "file",
	"mime": "application/pdf",
	"url": "https://akirabox.com/{id}/file"
}
Error Response (404)
{
	"status": 404,
	"message": "File not found"
}

Upload API

Only available for Premium Users...