Bumuo sa s.id — REST API, Webhooks & OAuth
Gumawa ng maikling link, subaybayan ang mga click, at i-automate ang iyong workflow gamit ang developer platform ng s.id. Simpleng API key auth, real-time webhooks, at OAuth 2.0 para sa third-party apps.
REST API
Pamahalaan ang mga link, QR code, at data ng user gamit ang malinis na JSON API. Bearer token auth, 38 req/min.
Alamin PaWebhooks
Mag-subscribe sa link.created, link.clicked, qr.scanned, at iba pa. HMAC-signed na mga payload.
Alamin PaOAuth 2.0
Ang authorization-code flow na may PKCE at refresh token rotation ay nagpapahintulot sa iyong app na kumilos para sa mga user ng s.id.
Alamin PaMabilis na Simula
Gumawa ng maikling link sa isang API call.
Buksan ang Dashboard → Developer → API Keys
Gumawa ng key na may mga scope na kailangan mo
Tawagan ang API gamit ang Bearer sk_live_...
Base 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"}'Mga Endpoint
Lahat ng endpoint ay nangangailangan ng API key na may tamang scope.
| Paraan | Path |
|---|---|
| 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} |
Mga API Scope
Ang bawat API key ay may scope — humiling lamang ng mga permiso na kailangan ng iyong integrasyon.
links:readList and read linkslinks:writeCreate and update links (create, edit, restore)links:archiveArchive linkslinks:analyticsRead per-link click statistics and lifetime countsqr: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 quotamicrosites:readRead micrositesmicrosites:writeCreate, update, delete and manage components of micrositesWebhooks
Irehistro ang isang HTTPS endpoint para makatanggap ng real-time na mga event. Ang bawat delivery ay POST-signed gamit ang HMAC-SHA256.
Mga available na event
link.createdFired when a new link is createdlink.updatedFired when a link's URL or title is changedlink.archivedFired when a link is archivedlink.clickedFired on each redirect (per-click event)microsite.publishedFired when a microsite is publishedqr.scannedFired when a QR code is scannedHalimbawa ng 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"
}I-verify ang signature (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),
);
}Ang secret ay ipinapakita nang isang beses kapag gumawa ka ng webhook. I-verify bago iproseso ang event.
Pagpapatunay
Dalawang paraan ng pagpapatunay: API key para sa server-to-server, OAuth 2.0 para sa mga daloy sa ngalan ng user.
Mga API Key
Gumawa ng key sa Dashboard → Developer → API Keys. Ipasa ito bilang Bearer token. Ang mga key ay may scope at maaaring bawiin sa anumang oras.
Authorization: Bearer sk_live_...OAuth 2.0
Gamitin ang authorization-code flow para kumilos para sa mga user ng s.id. Mag-redirect sa /oauth/authorize, palitan ang code sa /oauth/token.
Gabay sa OAuth 2.0Handa na bang magsimulang bumuo?
Gumawa ng API key sa loob ng ilang minuto. Kasama ang libreng tier — walang credit card na kailangan.