URL 단축기

URL 단축기 · GPT-Aktionen

1pt URL Shortener

This API allows for URL shortening, providing either a random shortened URL or a custom one if specified.

  • POST /addURLCreate a Shortened URL
Ursprüngliches API-Schema
{
  "openapi": "3.0.0",
  "info": {
    "title": "1pt URL Shortener",
    "version": "1.0.0",
    "description": "This API allows for URL shortening, providing either a random shortened URL or a custom one if specified."
  },
  "servers": [
    {
      "url": "https://csclub.uwaterloo.ca/~phthakka/1pt-express",
      "description": "1pt.co URL Shortening Service hosted by CSC"
    }
  ],
  "paths": {
    "/addURL": {
      "post": {
        "summary": "Create a Shortened URL",
        "operationId": "addURL",
        "parameters": [
          {
            "name": "long",
            "in": "query",
            "required": true,
            "description": "The original URL to be shortened.",
            "schema": {
              "type": "string",
              "format": ""
            }
          },
          {
            "name": "short",
            "in": "query",
            "required": false,
            "description": "The desired short URL path. If not specified or taken, a random path is generated.",
            "schema": {
              "type": "string",
              "format": ""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "URL successfully shortened",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "short": {
                      "type": "string"
                    },
                    "long": {
                      "type": "string"
                    },
                    "receivedRequestedShort": {
                      "type": "boolean",
                      "description": "Indicates if the requested short URL was applied. Present only when the custom short URL could not be used."
                    }
                  },
                  "required": [
                    "message",
                    "short",
                    "long"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error in URL shortening process"
          }
        }
      }
    }
  }
}