D
DPBOSS APIs Developer Docs
Back to Home

Overview & Authentication

All programmatic routes are built using standardized JSON response formats. To secure connection pathways, clients are provided a unique Webhook Secret key.

Note on Security: Keep your secret key completely confidential. All webhook events pushed to your servers contain an HMAC signature signed with this secret key in the headers.

GET Active Markets List

GET

Fetch all active traditional DPBoss Satta Matka and Satta King markets currently synchronized in the central database.

Endpoint: GET /api/markets
{
  "success": true,
  "count": 2,
  "data": [
    {
      "id": 1,
      "name": "KALYAN",
      "type": 1,
      "type_label": "Main Market"
    },
    {
      "id": 2,
      "name": "GALI",
      "type": 2,
      "type_label": "Gali Desawar"
    }
  ]
}

GET Latest Declared Results

GET

Fetch the latest result values declared today for all active games, including detailed panna and jodi breakdowns.

Endpoint: GET /api/results/latest
{
  "success": true,
  "count": 2,
  "data": [
    {
      "market_id": 1,
      "market_name": "KALYAN",
      "market_type": 1,
      "type_label": "Main Market",
      "result": "123-67-456",
      "open_panna": "123",
      "open_digit": "6",
      "close_digit": "7",
      "close_panna": "456",
      "result_time": "09:30 PM",
      "date": "2026-06-01"
    },
    {
      "market_id": 2,
      "market_name": "GALI",
      "market_type": 2,
      "type_label": "Gali Desawar",
      "result": "52",
      "open_panna": null,
      "open_digit": "5",
      "close_digit": "2",
      "close_panna": null,
      "result_time": "11:55 PM",
      "date": "2026-06-01"
    }
  ]
}

Webhook Push Event

POST

Whenever a new Kalyan Matka or Satta King result is scraped, our system will instantly send a `POST` request to your configured webhook url.

Webhook Header Details:
  • Content-Type: application/json
  • X-Market-Signature: sha256_hmac_signature_token
  • User-Agent: MarketResultService-WebhookDispatcher/1.0
{
  "market_name": "KALYAN",
  "market_type": 1,
  "result": "123-67-456",
  "result_time": "09:30 PM",
  "date": "2026-06-01"
}

HMAC Signature Verification Code

To protect your endpoint, check the signature header and compare it locally with the computed signature of the raw input body using your secret key.

PHP Code Integration
<?php

$payload = file_get_contents('php://input');
$receivedSignature = $_SERVER['HTTP_X_MARKET_SIGNATURE'] ?? '';

// Your unique secret key provided in Admin Panel
$webhookSecret = 'sec_your_secret_token_here'; 

// Calculate expected signature
$expectedSignature = hash_hmac('sha256', $payload, $webhookSecret);

if (hash_equals($expectedSignature, $receivedSignature)) {
    // Signature is valid! Process the result safely.
    $data = json_decode($payload, true);
    $marketName = $data['market_name'];
    $resultValue = $data['result'];
    
    // Update your database...
    http_response_code(200);
    echo "Webhook processed successfully.";
} else {
    // Signature invalid, deny request!
    http_response_code(401);
    echo "Invalid Webhook Signature.";
}
Node.js Code Integration
const crypto = require('crypto');

app.post('/webhooks/results', (req, res) => {
    const rawBody = JSON.stringify(req.body);
    const signature = req.headers['x-market-signature'];
    const secret = 'sec_your_secret_token_here';
    
    const computedSignature = crypto
        .createHmac('sha256', secret)
        .update(rawBody)
        .digest('hex');
        
    if (computedSignature === signature) {
        // Valid webhook!
        console.log(`Updated result for ${req.body.market_name}: ${req.body.result}`);
        res.status(200).send('Success');
    } else {
        // Unauthorized
        res.status(401).send('Unauthorized Signature');
    }
});