Quickstart
The fastest way to integrate Plinkly into your application. All you need is your API token.
1. Create a Short Link
curl -X POST "https://plink.ly/apiv/shorten" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/my-long-page",
"slug": "custom-alias",
"domain_id": 0
}'
Authentication
Authenticate your requests by including your secret API token in the Authorization header.
You can generate or manage your tokens from your Dashboard Settings.
Authorization: Bearer 0123456789abcdef0123456789abcdef...
Note: API tokens carry many privileges, so be sure to keep them secure! Do not share your secret API tokens in publicly accessible areas such as GitHub, client-side code, and so forth.
POST /shorten
Create a new shortened link. If no slug is provided, a random one will be generated.
url(required): The destination URL.slug(optional): Custom alias (e.g. 'summer-sale').expire_days(optional): Days until link expires (0 = forever).
GET /stats
Retrieve analytics for a specific link. Returns click counts, browser data, and referrers.
curl "https://plink.ly/apiv/stats?slug=abc12" \
-H "Authorization: Bearer YOUR_TOKEN"
DELETE /delete
Permanently remove a short link and its associated data.
curl -X DELETE "https://plink.ly/apiv/delete?slug=abc12" \
-H "Authorization: Bearer YOUR_TOKEN"
Integrations (Signed Requests)
For server-to-server communication (like activating plans from external payment gateways), we use HMAC signatures instead of Bearer tokens for enhanced security.
Signature Algorithm
Compute the HMAC SHA-256 of timestamp + rawBody using your shared secret.
signature = HMAC_SHA256(secret, timestamp + rawJSONBody)
// Headers to send:
X-G2PICK-TIMESTAMP: {timestamp}
X-G2PICK-SIGNATURE: {signature}