How to Connect Your Apps to Our Service

This guide explains how to connect your applications to our link shortening service.

First Things First: Getting Connected

Before you can use our service, you'll need to get a special access key (we call it a "token"). Think of it like a password that lets your app talk to our service.

How to Get Your Access Key

Send your email and password to this address: POST /api/auth

What to Send

{
    "email": "you@example.com",
    "password": "your_password"
}

Example Request

curl -X POST https://clikin.to/api/auth \
    -H "Content-Type: application/json" \
    -d '{"email": "you@example.com", "password": "your_password"}'

What You'll Get Back

We'll send you your access key and some basic information about your account:

{
    "success": true,
    "token": "your.access.key",
    "user": {
        "id": "your_id",
        "email": "you@example.com",
        "username": "your_name"
    }
}

Using Your Token

For all subsequent API requests, include your token in the Authorization header as a Bearer token:

Authorization: Bearer your.access.key

What You Can Do With Our Service

See Your Organizations

Want to see all the organizations you're part of? Just ask: GET /api/orgs

Example Request

curl https://clikin.to/api/orgs \
    -H "Authorization: Bearer your.access.key"

We'll show you something like this:

{
    "success": true,
    "organizations": [
        {
            "id": "org_123",
            "name": "My Family Links",
            "is_owner": true,
            "member_count": 5
        }
    ]
}

View Your Links

Need to see all the links in your organization? Just ask: GET /api/orgs/{your_org_id}/links

Example Request

curl https://clikin.to/api/orgs/org_123/links \
    -H "Authorization: Bearer your.access.key"

We'll show you all your links, including:

  • The short link we created
  • Where it goes to
  • How many times it's been used
  • When it expires (if you set that up)
  • Any tags associated with the link

Create a New Short Link

Want to make a new short link? Here's how: POST /api/orgs/{your_org_id}/links

What You Need to Tell Us

{
    "destination_url": "https://www.your-long-link.com",
    "fallback_url": "https://www.backup-link.com", // optional: users are redirected here if link is disabled/expired/maxed out
    "expires_in": 30, // optional: how many days until it expires
    "max_clicks": 100, // optional: maximum times it can be used
    "tags": ["marketing", "summer-campaign"], // optional: array of tag strings
    "password": "secret123" // optional: require a password to access the link
}

Note: The fallback URL is where users will be redirected if the link becomes disabled, expires, or reaches its maximum click limit. If no fallback URL is provided, users will see a 404 error page in these cases. When a password is set, users will need to enter it before accessing the destination URL.

Example Request

curl -X POST https://clikin.to/api/orgs/org_123/links \
    -H "Authorization: Bearer your.access.key" \
    -H "Content-Type: application/json" \
    -d '{
        "destination_url": "https://www.your-long-link.com",
        "expires_in": 30,
        "max_clicks": 100,
        "tags": ["marketing", "summer-campaign"],
        "password": "secret123"
    }'

See How Your Links Are Doing

Want to know how many people are using your link? Ask for stats: GET /api/orgs/{your_org_id}/links/{link_id}/stats

Example Request

curl https://clikin.to/api/orgs/org_123/links/link_456/stats \
    -H "Authorization: Bearer your.access.key"

We'll tell you:

  • How many times the link was clicked
  • When it was clicked
  • Where people came from when they clicked it

Turn Links On and Off

Need to pause a link temporarily? You can toggle it on/off: POST /api/orgs/{your_org_id}/links/{link_id}/toggle

Example Request

curl -X POST https://clikin.to/api/orgs/org_123/links/link_456/toggle \
    -H "Authorization: Bearer your.access.key"

It's like a light switch - just flip it on or off whenever you need!

If Something Goes Wrong

If there's a problem, we'll let you know what happened and how to fix it:

{
    "success": false,
    "message": "Here's what went wrong..."
}

Common Issues You Might See

  • 400 - You forgot to include some information we need
  • 401 - Your access key is missing or doesn't work anymore
  • 403 - You're not allowed to see this information
  • 404 - We couldn't find what you were looking for