s.id Logo
s.id
डेवलपर प्लेटफ़ॉर्म

s.id पर बनाएं — REST API, Webhooks & OAuth

s.id डेवलपर प्लेटफ़ॉर्म के साथ शॉर्ट लिंक बनाएं, क्लिक ट्रैक करें, और अपना वर्कफ़्लो स्वचालित करें। सरल API key प्रमाणीकरण, रियल-टाइम webhooks, और तृतीय-पक्ष ऐप्स के लिए OAuth 2.0।

REST API

स्वच्छ JSON API से लिंक, QR कोड और यूज़र डेटा प्रबंधित करें। Bearer token auth, 38 req/मिनट।

और अधिक जानें

Webhooks

link.created, link.clicked, qr.scanned और अधिक के लिए सदस्यता लें। HMAC-हस्ताक्षरित payloads।

और अधिक जानें

OAuth 2.0

PKCE और refresh token rotation के साथ authorization-code flow आपके ऐप को s.id उपयोगकर्ताओं की ओर से कार्य करने देता है।

और अधिक जानें

त्वरित शुरुआत

एक API कॉल में शॉर्ट लिंक बनाएं।

1

Dashboard → Developer → API Keys खोलें

2

अपनी ज़रूरत के scopes के साथ key बनाएं

3

Bearer sk_live_... के साथ API कॉल करें

बेस URL: https://api.s.id/v2

curl -X POST https://api.s.id/v2/links \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"long_url": "https://example.com/long-url", "custom_slug": "mylink"}'

Endpoints

सभी endpoints को उचित scope के साथ API key की आवश्यकता है।

विधिपाथ
GET/links
POST/links
POST/links/available
GET/links/{short}
PUT/links/{short}
DELETE/links/{short}
POST/links/{short}/unarchive
GET/links/{short}/stats
GET/links/{short}/stats/lifetime
GET/user
GET/quota
GET/microsites
POST/microsites
GET/microsites/{slug}
PUT/microsites/{slug}
DELETE/microsites/{slug}
POST/links/bulk
GET/stats
GET/qr
PUT/qr
GET/links/{short}/qr
PUT/links/{short}/qr
POST/microsites/available
GET/microsites/{slug}/components
POST/microsites/{slug}/components
PUT/microsites/{slug}/components/{componentId}
DELETE/microsites/{slug}/components/{componentId}
POST/microsites/{slug}/components/order
GET/oauth/authorize
POST/oauth/token
POST/oauth/revoke
GET/oauth/userinfo
GET/api/user/oauth/apps
DELETE/api/user/oauth/apps/{clientId}
पूरा API Reference ↗

API Scopes

प्रत्येक API key scoped है — केवल वही अनुमतियां मांगें जो आपके integration को चाहिए।

links:readList and read links
links:writeCreate and update links (create, edit, restore)
links:archiveArchive links
links:analyticsRead per-link click statistics and lifetime counts
qr:readRead QR code settings (global and per-link)
qr:writeCustomize QR code settings (global and per-link)
user:readRead the authenticated user profile and account quota
microsites:readRead microsites
microsites:writeCreate, update, delete and manage components of microsites

Webhooks

रियल-टाइम इवेंट प्राप्त करने के लिए HTTPS endpoint रजिस्टर करें। प्रत्येक डिलीवरी HMAC-SHA256 के साथ POST-signed होती है।

उपलब्ध events

link.createdFired when a new link is created
link.updatedFired when a link's URL or title is changed
link.archivedFired when a link is archived
link.clickedFired on each redirect (per-click event)
microsite.publishedFired when a microsite is published
qr.scannedFired when a QR code is scanned

उदाहरण payload

{
  "event": "link.created",
  "link": {
    "id": 123,
    "short": "mylink",
    "short_url": "https://s.id/mylink",
    "long_url": "https://example.com/long-url",
    "title": "My Link",
    "created": "2026-06-22T10:00:00Z"
  },
  "timestamp": "2026-06-22T10:00:00Z"
}

हस्ताक्षर सत्यापित करें (Node.js)

const crypto = require('crypto');

function verifySignature(secret, rawBody, sigHeader) {
  const expected = 'sha256=' +
    crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from(sigHeader),
    Buffer.from(expected),
  );
}

Secret webhook बनाते समय एक बार दिखाया जाता है। event प्रोसेस करने से पहले सत्यापित करें।

Webhooks का पूरा गाइड

प्रमाणीकरण

प्रमाणीकरण के दो तरीके: server-to-server के लिए API keys, उपयोगकर्ता की ओर से flows के लिए OAuth 2.0।

API Keys

Dashboard → Developer → API Keys में key बनाएं। इसे Bearer token के रूप में पास करें। Keys scoped हैं और कभी भी revoke की जा सकती हैं।

Authorization: Bearer sk_live_...

OAuth 2.0

s.id उपयोगकर्ताओं की ओर से कार्य करने के लिए authorization-code flow का उपयोग करें। /oauth/authorize पर redirect करें, /oauth/token पर code exchange करें।

OAuth 2.0 गाइड

बनाना शुरू करने के लिए तैयार हैं?

मिनटों में API key बनाएं। मुफ़्त tier शामिल — कोई क्रेडिट कार्ड आवश्यक नहीं।