Skip to content

Link Field Missing in API Response Since v3.0.0 Update #795

@ghost

Description

Description:

After updating to the latest version (v3.0.0 and subsequent releases), the link field is no longer appearing in the API response when making POST requests to /api/v2/links. This issue breaks API integrations that rely on the link field for retrieving the full shortened URL.


Environment Details:

  • Kutt Version: v3.1.1
  • Database: MySQL
  • Hosting: Self-hosted (https://selfhost.viacloudron.com)
  • API Endpoint Used: /api/v2/links

Request Sample:

Endpoint:

POST https://selfhost.viacloudron.com/api/v2/links

Payload:

{
  "target": "https://www.cars.com/",
  "description": "Test link for Cars.com",
  "expire_in": "2 days",
  "password": "mypassword",
  "customurl": "cars-test",
  "reuse": false,
  "domain": "selfhost.viacloudron.com"
}

Headers:

  • Content-Type: application/json
  • X-API-KEY: <Your API Key>

Expected Response:

{
  "address": "https://selfhost.viacloudron.com/cars-test",
  "banned": false,
  "created_at": "2025-01-20T17:54:45.777Z",
  "id": "88b6c501-342a-4b0c-8289-41fc5af8ad79",
  "link": "https://selfhost.viacloudron.com/cars-test",
  "password": true,
  "target": "https://www.cars.com/",
  "description": "Test link for Cars.com",
  "updated_at": "2025-01-20T17:54:45.777Z",
  "visit_count": 0
}

Actual Response:

{
  "id": "88b6c501-342a-4b0c-8289-41fc5af8ad79",
  "address": "cars-test",
  "description": "Test link for Cars.com",
  "banned": false,
  "password": true,
  "expire_in": "2025-01-22T17:54:44.769Z",
  "target": "https://www.cars.com/",
  "visit_count": 0,
  "created_at": "2025-01-20T17:54:45.777Z",
  "updated_at": "2025-01-20T17:54:45.777Z"
}

Issue Details:

The link field is missing in the response. This field is essential for:

  1. API integrations that retrieve and use the full shortened URL (address only provides the custom alias).
  2. Maintaining backward compatibility with previous versions.

The absence of the link field breaks existing integrations and workflows.


Steps to Reproduce:

  1. Install Kutt v3.1.1.
  2. Configure the application with MySQL and self-host it.
  3. Make a POST request to /api/v2/links with the sample payload and headers.
  4. Observe the missing link field in the API response.

Proposed Fix:

Reintroduce the link field in the API response, ensuring compatibility with pre-v3.0.0 integrations.


References:

  • Issue caused post v3.0.0 update.
  • Relevant commits/releases:

Additional Context:

This issue impacts automation and third-party integration capabilities of the platform. Restoring the link field is crucial for users relying on API responses.

The Last Working addition is 2.74 Working Properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions