Important: Tr.im API is in Beta
Vanity domains are a great way to ensure consistent branding and encourage 'link trust.' To ensure that API integration works seamlessly follow the guidelines below to add a new vanity domain to verify a vanity domain and for the vanity domain list API.
Add a new vanity domain
Url: /vanity-domains
Method: POST
Request
Parameter |
Type |
Description |
Required |
vanity_domain |
string |
name of the vanity domain to create |
true |
Response
Parameter |
Type |
Description |
vanity_domain |
string |
name of created vanity domain |
An Example Request:
POST /vanity-domains HTTP/1.1
x-api-key: 28542e01d8c1ea0fcaf791bd83169a13
Content-Type: application/json
{ "vanity_domain": "mydomain.com" }
An Example Response:
An Example Error Response:
400 (Bad request)
ContentType: application/json
{
"code": 400,
"message": "Validation Failed",
"errors": {
"errors": [
"Vanity domain already exists."
],
"children": {
"vanityDomain": []
}
}
}
Verify a vanity domain
Url: /vanity-domains/{vanity_domain}/verify
vanity_domain vanity domain to verify ex. mydomain.com
Method: POST
Request
Empty. This request does not contain body.
Response
Parameter |
Type |
Description |
vanity_domain |
string |
name of verified vanity domain |
An Example Request:
POST /vanity-domains/mydomain.com/verify HTTP/1.1
x-api-key: 7ec3c5647b5c732db85d11deca8f6d95
Content-Type: application/json
An Example Response:
An Example Error Response:
400 (Bad request)
ContentType: application/json
{
"code": 400,
"message": "Validation Failed",
"errors": {
"children": {
"vanityDomain": {
"errors": [
"Given vanity domain has wrong configuration."
]
}
}
}
}
Vanity domain API
Url: /vanity-domains/list
Method: POST
Request
Empty. This request does not contain body.
Response
Parameter |
Type |
Description |
vanity_domains_count |
Integer |
Count of verified vanity domain |
vanity_domains |
Array |
List of verified vanity domain |
An Example Request
POST /vanity-domains/list HTTP/1.1
x-api-key: 2a4ff74ee231de46d73f86777d20d96c
Content-Type: application/json
An Example Response
200 (Success)
ContentType: application/json
{"vanity_domains_count":9,"vanity_domains":["katstack.com","paper22.com","rstackhouse.com","stackdaddy.co","STACKDIGITAL.CO","stackmastercapital.co","stacksolutions.us","stagetrim.in","www.stackdaddy.co"]}
Example Error Responses
- 403 (Forbidden)
ContentType: application/json
{"Forbidden":"Authentication Failed."}
-
500 Internal Server Error
An Exception was thrown while handling: Not Found
Comments