YiffyAPI
  • Images
  • Thumbnails
  • Shortener
  • Shared Responses
    • Error Codes
  • API Key
Powered by GitBook
On this page
  • Shorten A URL
  • Get A Short URL (Redirect)
  • Get A Short URL (Preview)
  • Get A Short URL (JSON)
  • Delete A Short URL
  • Modify A Short URL

Was this helpful?

Shortener

PreviousThumbnailsNextShared Responses

Last updated 1 year ago

Was this helpful?

An is required for this service. See for common error responses.

Shorten A URL

POST https://yiff.rocks/create

If is enabled, a 503 Service Unavailable will be returned.

Query Parameters

Name
Type
Description

editable

Boolean

If the shortened url should be editable (you will get a code to edit with)

Request Body

Name
Type
Description

code

String

The code to use, random if not specified.

credit

String

The name to credit, Unknown if not specified.

url*

String

The URL to shorten.

// Max: 50
{
  "success": false,
  "error": "Provided code is too long.",
  "code": 1070
}
// Allowed: a-z, A-Z, -, 0-9
{
  "success": false,
  "error": "Invalid characters in code.",
  "code": 1071
}
{
  "success": false,
  "error": "Code already in use.",
  "code": 1072
}
// RegEx: /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i
{
  "success": false,
  "error": "Invalid url provided.",
  "code": 1073
}
// Max: 50
{
  "success": false,
  "error": "Provided credit is too long.",
  "code": 1074
}
{
  "success": true,
  "data": {
    "code": "",
    "createdAt": "0000-00-00T00:00:00.000Z",
    "modifiedAt": "0000-00-00T00:00:00.000Z", // nullable
    "url": "",
    "pos": 0,
    "credit": "",
    "fullURL": "https://yiff.rocks/{code}",
    "managementCode": null
  }
}
{
  "success": true,
  "data": {
    "code": "",
    "createdAt": "0000-00-00T00:00:00.000Z",
    "modifiedAt": "0000-00-00T00:00:00.000Z", // nullable
    "url": "",
    "pos": 0,
    "credit": "",
    "fullURL": "https://yiff.rocks/{code}",
    "managementCode": "" // nullable, save if you plan on editing later
  }
}
{
  "success": false,
  "error": "Service is currently in read-only mode.",
  "code": 2
}

Get A Short URL (Redirect)

GET https://yiff.rocks/:code

// Redirected to original url
Unknown short url code.

Get A Short URL (Preview)

GET https://yiff.rocks/:code+

// HTML Page
Unknown short url code.

Get A Short URL (JSON)

GET https://yiff.rocks/:code.json

{
  "success": true,
  "data": {
    "code": "",
    "createdAt": "0000-00-00T00:00:00.000Z",
    "modifiedAt": "0000-00-00T00:00:00.000Z", // nullable
    "url": "",
    "pos": 0,
    "credit": "",
    "fullURL": "https://yiff.rocks/{code}"
  }
}
{
  "success": false,
  "error": "A short url with that code was not found.",
  "code": 1075
}

Delete A Short URL

DELETE https://yiff.rocks/:code

Request Body

Name
Type
Description

managementCode*

String

The management code you received when creating the shorturl.

{
  "success": false,
  "error": "You must provide an authorization code. These are created at the time the short url was created.",
  "code": 1076
}
{
  "success": false,
  "error": "A short url with that code was not found.",
  "code": 1075
}
{
  "success": false",
  "error": "That short url does not have a management code, so it cannot be deleted.",
  "code": 1077
}
{
  "success": false,
  "error": "That management code does not match this short url.",
  "code": 1078
}
// No Content
{
  "success": false,
  "error": "Service is currently in read-only mode.",
  "code": 2
}

Modify A Short URL

PATCH https://yiff.rocks/:code

Request Body

Name
Type
Description

managementCode*

String

The management code you received when creating the shorturl.

credit

String

The new credit name for the url.

url

String

The new url for the shorturl.

{
  "success": false,
  "error": "You must provide an authorization code. These are created at the time the short url was created.",
  "code": 1076
}
{
  "success": false,
  "error": "A short url with that code was not found.",
  "code": 1075
}
{
  "success": false",
  "error": "That short url does not have a management code, so it cannot be modified.",
  "code": 1077
}
{
  "success": false,
  "error": "That management code does not match this short url.",
  "code": 1078
}
// RegEx: /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i
{
  "success": false,
  "error": "Invalid url provided.",
  "code": 1073
}
{
  "success": false,
  "error": "The provided url is already in use.",
  "code": 1079
}
// Max: 50
{
  "success": false,
  "error": "Provided credit is too long.",
  "code": 1074
}
{
  "success": false,
  "error": "No changes were detected.",
  "code": 1080
}
{
  "success": true,
  "data": {
    "code": "",
    "createdAt": "0000-00-00T00:00:00.000Z",
    "modifiedAt": "0000-00-00T00:00:00.000Z", // nullable
    "url": "",
    "pos": 0,
    "credit": "",
    "fullURL": "https://yiff.rocks/{code}"
  }
}
{
  "success": false,
  "error": "Service is currently in read-only mode.",
  "code": 2
}

If is enabled, a 503 Service Unavailable will be returned.

If is enabled, a 503 Service Unavailable will be returned.

API Key
Shared Responses
Read Only
Read Only
Read Only