Domains

GET /domains - read list of shortening domains in account

Example response: { "error": { "code": 0, "message": "" }, "version": "3.1", "domains": [ { "domain": "custom.com", "hash_character_set": "restricted", "hash_generation": "incremental", "status": "active", "custom_root_page": "", "custom_404_page": "", "redirect_code": "303", "use_https": false }, { "domain": "custom2.com", "hash_character_set": "restricted", "hash_generation": "random", "status": "default", "custom_root_page": "http://mysite.net", "custom_404_page": "", "redirect_code": "303", "use_https": true } ] }

If your account contains multiple domains, we recommend to always specify "domain" parameter. This can help you avoid potential errors and ambiguous situations. By default, all API calls affect only URLs under default domain ("default" is a status found in domain settings).

To specify a different working domain (for shortening or other operations), you should add query parameter "domain":
GET /urls?domain=custom.com&hashes=a,b,c
The above call will fetch URLs from domain custom.com. URLs with same hashes, that exists in other domains won't be fetched.

For shortening, an example call may look like this: POST /urls?domain=custom.com JSON payload: { "urls": [ { "custom_hash": "mytiny", "long_url": "http://example.com" } ] }

Depending on your particular usage, it might also make sense to limit an API key to a specific domain.

In case of invalid domain, you will get error 1313.

"domain" parameter doesn't work together with "tags" parameter. If "tags" parameter specified, "domain" will be ignored. In other words, tags works across all your domains.

Note that internal representation of internationalized domain names handled according to RFC3490.