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
}
]
}
By default, all API calls affect only URLs in default domain (has status set to "default").
To specify 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.
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.
If you are working with multiple domains, we recommend to always specify "domain" parameter. This will help you avoid many errors and ambiguous situations.
Note that internal representation of internationalized domain names handled according to RFC3490.