Developers
Sign in
DOTCODE Developers
API Docs

Build with DOTCODE Platform

Integrate events, contests, and user data into your college or company applications.

Quickstart

1. Get an API Key

Request an API key for your organization. Keys are issued per college or company.

2. Make Your First Request

curl -X GET "https://api.dotcode.online//api/v1/public/events" \
  -H "Content-Type: application/json"

# With API Key for partner endpoints:
curl -H "x-api-key: <API_KEY>" "https://api.dotcode.online//api/v1/partner/colleges/123/stats?from=2025-01-01&to=2025-12-01"

3. Subscribe to Webhooks

curl -X POST "https://api.dotcode.online//api/v1/webhooks" \
  -H "x-api-key: <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{"targetUrl":"https://partner.example/webhook","events":["CONTEST_FINISHED","HACKATHON_RESULTS"]}'

Webhook Events

CONTEST_CREATED

New contest is created

CONTEST_STARTED

Contest begins

CONTEST_FINISHED

Contest ends with results

HACKATHON_STARTED

Hackathon kicks off

HACKATHON_FINISHED

Hackathon ends

HACKATHON_RESULTS

Results are published

USER_REGISTERED

New user signs up

USER_BADGE_EARNED

User earns a badge

SUBMISSION_ACCEPTED

Code submission passes

LEADERBOARD_UPDATED

Leaderboard changes

Ambassador API

Get Leaderboard

curl -X GET "https://api.dotcode.online//api/v1/ambassadors/leaderboard?limit=10&collegeId=5" \
  -H "Authorization: Bearer <TOKEN>"

Returns the top performing ambassadors based on referral points.

Referral Tracking

The system uses a 30-day cookie (sd_ref) and URL parameter attribution precedence.
1. ?ref=CODE (Highest Priority)
2. Cookie sd_ref

Signature Verification

All webhook payloads are signed with HMAC-SHA256. Verify the signature to ensure authenticity.

Headers sent with each webhook:

  • X-Stucode-Event-Id - Unique event identifier
  • X-Stucode-Delivery-Id - Delivery attempt ID (for idempotency)
  • X-Stucode-Timestamp - ISO timestamp
  • X-Stucode-Signature - sha256=HMAC signature

The signature covers the raw request body concatenated with the delivery id and the timestamp, in that order. Verify against the bytes you received rather than a re-serialised object — key order is not guaranteed to survive a parse and re-stringify.

Verification (Node.js):

const crypto = require('crypto');

// rawBody: the exact bytes of the request body, before JSON.parse
function verifyWebhook(rawBody, headers, secret) {
  const signature  = headers['x-stucode-signature'];
  const deliveryId = headers['x-stucode-delivery-id'];
  const timestamp  = headers['x-stucode-timestamp'];

  const expected = crypto
    .createHmac('sha256', secret)
    .update(`${rawBody}${deliveryId}${timestamp}`)
    .digest('hex');

  // Constant-time compare: a === b leaks how much of the signature matched.
  const a = Buffer.from(signature || '');
  const b = Buffer.from('sha256=' + expected);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

Rate Limits & Quotas

1,000

Requests/day (default)

5

Webhook retry attempts

7s

Webhook timeout

© 2026 DOTCODE. All rights reserved.