Shortened Documentation

Throttle: 1000/Hour

Object: Shortened

id
String
id is case sensitive!

Example

"id": "J"
private
String
private is case sensitive!
If the Shortened Link has a Private Key, it will only be able to accessible with the Private Key!
Private is a very large Random Integer up to 2^64 (18,446,744,073,709,551,615) and should be very hard to brute force!
DO NOT RELY SOLEY ON THIS FOR SECURITY!

Example

"private": "p4s5w04d"
short
String

Example

"short": "https://0ut.ca/J/p4s5w04d"
print-raw
String
Raw Input

Example

"print-raw": "https://juandefu.ca/"
"print-raw": "//😻"
"print-raw": "//xn--238h"
"print-raw": "//%F0%9F%98%BB"
print-uri
String
URI Output
Unicode and Unsafe ASCII Characters are Percent Encoded

Example

"print-uri": "https://juandefu.ca/"
"print-uri": "//xn--238h/?%25" // ascii % character
"print-uri": "//xn--238h/?%F0%9F%98%BB" // 😻
print-iri
String
IRI Output
Unicode is Unencoded, Unsafe ASCII Characters are Percent Encoded

Example

"print-iri": "https://juandefu.ca/"
"print-iri": "//😻/?%25" // ascii % character
"print-iri": "//😻/?😻"
print-normalized-uri
String
Normalized URI Output
Unicode and Unsafe ASCII Characters are Percent Encoded

Example

"print-normalized-uri": "https://juandefu.ca/"
"print-normalized-uri": "//xn--238h/?%25" // ascii % character
"print-normalized-uri": "//xn--238h/?%F0%9F%98%BB" // 😻
print-normalized-iri
String
Normalized IRI Output
Unicode is Unencoded, Unsafe ASCII Characters are Percent Encoded

Example

"print-normalized-iri": "https://juandefu.ca/"
"print-normalized-iri": "//😻/?%25" // ascii % character
"print-normalized-iri": "//😻/?😻"
dangerous
Boolean
Is this Potentially Dangerous? Dangerous Links will not be Redirected to.
Dangerous is not the same as a URI Objects Dangerous Field, we include the context of the Link Shortener.
Non URLs (URNs and URIs) and URLs without a Whitelisted Scheme would be considered Dangerous.
If you need to know if the URI itself is Dangerous use the Validate Object to do so.

Example

"dangerous": false
fallback
Boolean
This is only avaliable when using the shortened endpoint.
We will always revalidate the Shortened Raw input using the original Validator or custom Validator if specified.
If we're unable to Validate we will fallback to a Loose Validator.
When using the original Validator, the only reason this should ever be true is if STRICT Validation was originally used and the implementation of Strict has changed since then.

Example

"fallback": false
error
Number
Returns non 0 on Error. TODO: make more verbose

Constants

Key Value
UNKNOWN 1
THROTTLED 2
INVALID 3
NOTFOUND 404
INVALID_URI 1000
INVALID_URL_WAS_URN 1001
INVALID_URL_WAS_URI 1002


Example

"error": 1



POST /api;v1.0/shortened

JSON POST endpoint. Supports Validator Options!

Request

Parameters

id
String
id is case sensitive!

Example

"id": "J"
private
String
private is case sensitive!
If the Shortened Link has a Private Key, it will only be able to accessible with the Private Key!
Private is a very large Random Integer up to 2^64 (18,446,744,073,709,551,615) and should be very hard to brute force!
DO NOT RELY SOLEY ON THIS FOR SECURITY!

Example

"private": "p4s5w04d"
validator
Number
Optional
Method of Validation to use.
STRICT Validation will not allow Incorrect Spec Validation to occur! It's recommended to use LOOSE!
LOOSE_ASIS assumes percent encoding DOES NOT EXIST and any percent characters will be encoded!

The Default/Invalid Validator is LOOSE

Constants

Key Value
STRICT 1
LOOSE 2
LOOSE_ASIS 3


Example

"validator": 0
validate
Boolean
Optional
Validate Input
Input must be Valid and Validate must not be Throttled!

Example

"validate": true
validate-options
Object: URI Options
Optional
Validator Options
Default Options will be used when nil

Response

errors
[]String
This is only returned on Internal Errors! Always check the Response Header Content-Type before parsing!

Example

"errors": [
	"internal server error"
]
shortened
Object: Shortened
Always returned!

If Throttled, returns an Object containing the Attribute "throttle" with a value of the Throttle Expiration Timestamp RFC 3339

validated
Object: URI Validated
If Shortened is Throttled or an error occurs Validated will be ignored!




GET /api;v1.0/shortened/:id/:private

GET endpoint that optinally uses Query String Parameters. Supports JSONP!
ID and Private must be passed in place of :id and :private placeholders
Example:
/api;v1.0/shortened/J/p4s5w04d

Request

Parameters

validator
Number
Optional
Method of Validation to use.
STRICT Validation will not allow Incorrect Spec Validation to occur! It's recommended to use LOOSE!
LOOSE_ASIS assumes percent encoding DOES NOT EXIST and any percent characters will be encoded!

The Default/Invalid Validator is LOOSE

Constants

Key Value
STRICT 1
LOOSE 2
LOOSE_ASIS 3


Example

"validator": 0
validate
Exists
Optional
Validate Input
Input must be Valid and Validate must not be Throttled!

jsonp
String
Optional
JSONP will be used to pad the JSON payload with a Function.
Must be a-zA-Z and 15 characters or less.
If JSONP is set and is empty or invalid "ZeroOut" will be used!

Example

jsonp=Whoa
Whoa({});

Response

errors
[]String
This is only returned on Internal Errors! Always check the Response Header Content-Type before parsing!

Example

"errors": [
	"internal server error"
]
shortened
Object: Shortened
Always returned!

If Throttled, returns an Object containing the Attribute "throttle" with a value of the Throttle Expiration Timestamp RFC 3339

validated
Object: URI Validated
If Shortened is Throttled or an error occurs Validated will be ignored!