Wisk API

Integrate our powerful URL shortening service into your applications.

API Overview

The Wisk API allows you to programmatically create and manage short URLs. Our RESTful API is easy to integrate with any application or service.

We currently offer two main endpoints:

All API requests require authentication using your API key, which you can obtain for free from your Wisk dashboard after logging in.

Getting Started

To start using the Wisk API:

  1. Sign up for a Wisk account and log in
  2. Authenticate via API to obtain a Sanctum token (see below)
  3. Generate your API key from the dashboard or via API
  4. Use the key in your API requests as described below

Base URL: https://wisk.in/api

Authenticating with Sanctum

To generate an API key via API, you need a Sanctum token:

  1. Request a CSRF token: GET https://wisk.in/api/sanctum/csrf-cookie
  2. Log in to get a Sanctum token: POST https://wisk.in/api/login with email and password
  3. Use the Sanctum token in the Authorization: Bearer YOUR_SANCTUM_TOKEN header for /api-key/generate

POST /login

curl -X POST https://wisk.in/api/login \
-H "Content-Type: application/json" \
-H "X-XSRF-TOKEN: YOUR_CSRF_TOKEN" \
-d '{"email": "user@example.com", "password": "yourpassword"}'

Example Response:

{
    "message": "Login successful",
    "token": "YOUR_SANCTUM_TOKEN"
}

Generating an API Key

To generate an API key for free:

  1. Log in to your Wisk dashboard or authenticate via API
  2. Click the "Generate API Key" button in the dashboard or call the API endpoint
  3. Include the key in the Authorization: Bearer YOUR_API_KEY header for all API requests

POST /api-key/generate

Requires authentication via Sanctum token.

curl -X POST https://wisk.in/api/api-key/generate \
-H "Authorization: Bearer YOUR_SANCTUM_TOKEN" \
-H "Content-Type: application/json"

Example Response:

{
    "api_key": "YOUR_GENERATED_API_KEY"
}

Encode Endpoint

Convert a long URL into a short Wisk link.

POST /encode

Request Parameters:

Parameter

url

Type

string

Description

The long URL to shorten

Required

Yes

Parameter

custom_slug

Type

string

Description

Custom short code (for logged-in users)

Required

No

Example Request:

curl -X POST https://wisk.in/api/encode \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/very/long/url", "custom_slug": "my-link"}'

Example Response:

{
    "status": "success",
    "short_url": "https://wisk.in/my-link",
    "original_url": "https://example.com/very/long/url"
}

Decode Endpoint

Retrieve the original URL from a short Wisk link.

GET /decode

Request Parameters:

Parameter

short_url

Type

string

Description

The short Wisk URL to decode

Required

Yes

Example Request:

curl -X GET "https://wisk.in/api/decode?short_url=https://wisk.in/my-link" \
-H "Authorization: Bearer YOUR_API_KEY"

Example Response:

{
    "status": "success",
    "original_url": "https://example.com/very/long/url",
    "short_url": "https://wisk.in/my-link"
}