Integration Guide

Learn how to integrate your generated Mock APIs into any application, framework, or language.

Connect to your API

Once you have generated an API endpoint, you can consume it just like any other REST API. Choose your preferred language or framework below to see how to connect.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Mock API Demo</title>
</head>
<body>
    <div id="result">Loading...</div>

    <script>
        // Replace with your generated API URL
        const API_URL = 'https://draftapi.cloud/api/your-endpoint';

        fetch(API_URL)
            .then(response => response.json())
            .then(data => {
                document.getElementById('result').textContent = JSON.stringify(data, null, 2);
            })
            .catch(error => {
                console.error('Error:', error);
                document.getElementById('result').textContent = 'Error loading data';
            });
    </script>
</body>
</html>

Note: Replace https://draftapi.cloud/api/your-endpoint with the actual URL provided in your Dashboard.