Validate Scheme Documentation

Shared Validate Throttle: 500/Hour

Object: Scheme

Scheme
There are 2 exceptions to what is considered a valid Scheme!
  1. UUIDs are supported
    A Digit is allowed to be used as the first character of a Scheme!
    This isn't considered Correct but is allowed. InvalidSyntax will be true if the validated Scheme is invalid according to the RFC!
  2. Unicode is allowed
    Punycode can be used to represent a valid Scheme.
    Input will also be Normalized using non transitional UTS #46. You will not be able to tell the difference between a scheme of HTTP and http!
print
Object: Print

Example

"print": {
	"uri": "xn--238h",
	"iri": "😻"
}
encoding
Object: Encoding

Example

"encoding": {
	"pe-necessary": true,
	"idna-excluded": true
}
invalid-syntax
Boolean
Is Input Invalid according to the Scheme RFC?

UUIDs that start with a Digit are invalid according to the spec! We will Validate them, but will return true!

Example

"invalid-syntax": false
dangerous
Boolean
Is this Potentially Dangerous?

Example

"dangerous": false
correct
Boolean
Was Input Correct to the Spec?

Example

"correct": true

Object Examples: Scheme

ASCII: "HTTPS"
{
	"print": {
		"uri": "https",
		"iri": "https"
	},
	"encoding": {
		"idna-normalized": true
	},
	"correct": true
}
Unicode Input: "😻"
{
	"print": {
		"uri": "xn--238h",
		"iri": "😻"
	},
	"encoding": {
		"unicode": true,
		"idna-excluded": true
	},
	"correct": true
}
Percent Encoding Input: "%F0%9F%98%BB"
{
	"print": {
		"uri": "xn--238h",
		"iri": "😻"
	},
	"encoding": {
		"pe-necessary": true,
		"idna-excluded": true
	},
	"correct": true
}
UUID Input "065e646d-2f4e-4aae-882f-c99685e710d2"
{
	"print": {
		"uri": "065e646d-2f4e-4aae-882f-c99685e710d2",
		"iri": "065e646d-2f4e-4aae-882f-c99685e710d2"
	},
	"encoding": {},
	"invalid-syntax": true
}

Object: Scheme_Options

POST APIs only support setting Options. Attributes are displayed when set to true.
GET APIs return the Default set Options.
print
Object: Print_Options
encoding
Object: Encoding_Options
invalid-syntax
Boolean
dangerous
Boolean
correct
Boolean

Object Examples: Scheme_Options

Default Options:
{
	"print": {
		"uri": true,
		"iri": true
	},
	"encoding": {
		"cleaned": true,
		"unicode": true,
		"pe-necessary": true,
		"pe-unnecessary": true,
		"pe-partial": true,
		"idna": true,
		"idna-invalid": true,
		"idna-normalized": true,
		"idna-normalize-failed": true,
		"idna-excluded": true
	},
	"invalid-syntax": true,
	"dangerous": true,
	"correct": true
}

Object: Print

uri
String
URI Output

Unicode and Unsafe ASCII Characters are Percent Encoded

Example

"uri": "ascii"
"uri": "%25" // ascii % character
"uri": "%F0%9F%98%BB" // 😻
iri
String
IRI Output

Unicode is Unencoded, Unsafe ASCII Characters are Percent Encoded

Example

"iri": "unicode"
"iri": "%25" // ascii % character
"iri": "😻"

Object Examples: Print

ASCII Input: "HTTPS"
{
	"uri": "https",
	"iri": "https"
}
Unicode Input: "😻"
{
	"uri": "xn--238h",
	"iri": "😻"
}

Object: Print_Options

POST APIs only support setting Options. Attributes are displayed when set to true.
GET APIs return the Default set Options.
uri
Boolean
iri
Boolean

Object: Encoding

cleaned
Boolean
Was the Input Cleaned?
Control Character or other Blacklisted Characters may be removed!

Example

"cleaned": false
unicode
Boolean
Did the Input contain Unicode?

Example

"unicode": true
pe-necessary
Boolean
Did the Input contain Percent Encoding - was a Character Necessarily Encoded?

Example

"pe-necessary": false
pe-unnecessary
Boolean
Did the Input contain Percent Encoding - was a Character Unnecessarily Encoded?

Example

"pe-unnecessary": false
pe-partial
Boolean
Did the Input contain Percent Encoding - was a Unicode Character Partially Encoded?

Example

"pe-partial": false
idna
Boolean
Was the Input IDNA Encoded?

Example

"unicode": true
idna-invalid
Boolean
Was the Input an Invalid IDNA Label?

Example

"idna-invalid": false
idna-normalized
Boolean
Was the Input UTS #46 Normalized?

Example

"idna-normalized": true
idna-normalize-failed
Boolean
Did Input contain a Disallowed or Invalid UTS #46 Character?

Example

"idna-normalize-failed": false
idna-excluded
Boolean
Does the Input contain a UTS #46 Character that is Excluded from use with IDNA 2008?

Example

"idna-excluded": false

Object Examples: Encoding

ASCII Input: "https"
{}
Unicode Input: "😻"
{
	"unicode": true,
	"idna-excluded": true
}

Object: Encoding_Options

POST APIs only support setting Options. Attributes are displayed when set to true.
GET APIs return the Default set Options.
cleaned
Boolean
unicode
Boolean
pe-necessary
Boolean
pe-unnecessary
Boolean
pe-partial
Boolean
idna
Boolean
idna-invalid
Boolean
idna-normalized
Boolean
idna-normalize-failed
Boolean
idna-excluded
Boolean

POST /api;v1.0/validate/uri/scheme

JSON POST endpoint. Supports Validator Options!

Request

Parameters

raw
String
Raw Input to Validate

Example

"raw": "http://juandefu.ca/"
options
Object: Scheme_Options
Optional
Validator Options
Default Options will be used when nil

shorten
Boolean
Optional
Shorten Validated Object
Shortened Object may include other URI Compments needed to create a Valid URI Object
Validated must be Valid and Shorten must not be Throttled!

Example

"shorten": true
shorten-private
Boolean
Optional
If this is set you will only be able to access the Shortened Link with a 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": true

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
If Validated is Throttled or an error occurs Shortened will be ignored!

validated
Object: Scheme
Always returned!

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


GET /api;v1.0/validate/uri/scheme

GET endpoint that only uses Query String Parameters. Supports JSONP!
Content must be properly encoded to fit within the Query String Field Variable "raw"!

Request

Parameters

raw
String
Raw Input to Validate

Example

"raw": "http://juandefu.ca/"
shorten
Exists
Optional
Shorten Validated Object
Shortened Object may include other URI Compments needed to create a Valid URI Object
Validated must be Valid and Shorten must not be Throttled!

shorten-private
Exists
Optional
If this is set you will only be able to access the Shortened Link with a 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!

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({});
pd
Exists
Optional
Should Input be Percent Decoded before being passed to the Validator?
Most Validators will do their own Percent Decoding of Input.
This should only be used if necessary or if the Validator does not support Percent Decoding.

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
If Validated is Throttled or an error occurs Shortened will be ignored!

validated
Object: Scheme
Always returned!

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


GET /api;v1.0/validate/uri/scheme/after?

GET endpoint that uses Directory Parameters and the whole content of Query String (?) as the Raw Parameter. Supports JSONP!
This is useful if you are unsure or unable to properly encode a Query String Variable.
This will not support Fragments if # is not encoded! Fragments are client side only!
Variables are appended to the Directory 'after' with the ; Delimiter and before the Query String! Order of parameters is not important.
Example:
Request: /api;v1.0/validate/uri/scheme/after;jsonp=Whoa;shorten;validator=2?http
Parameters: ;jsonp=Whoa;shorten
Validate: http

Request

Parameters

shorten
Exists
Optional
Shorten Validated Object
Shortened Object may include other URI Compments needed to create a Valid URI Object
Validated must be Valid and Shorten must not be Throttled!

shorten-private
Exists
Optional
If this is set you will only be able to access the Shortened Link with a 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!

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({});
pd
Exists
Optional
Should Input be Percent Decoded before being passed to the Validator?
Most Validators will do their own Percent Decoding of Input.
This should only be used if necessary or if the Validator does not support Percent Decoding.

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
If Validated is Throttled or an error occurs Shortened will be ignored!

validated
Object: Scheme
Always returned!

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