After domain DNS record is added, you can use this method to pull domain active status. U301 is using Let's Encrypt to authorize the domain for SSL certificate under the hood. Once the domain is active, it is ready for short link creation.
This is an HTTP polling endpoint. Please ensure a sufficient interval between requests to avoid triggering rate limits.
import { U301 } from 'u301';
const apiKey = '<YOUR_API_KEY>';
const workspaceId = '<YOUR_WORKSPACE_ID>';
const u301 = new U301({
apiKey,
workspaceId,
});
const {
actived,
message
} = await u301.domains.getActiveStatus('t.example.com'); // [!code highlight]
console.log({
actived,
message
});curl --location 'https://api.u301.com/v3/shorten/domains/<YOUR_DOMAIN>/active?workspaceId=<YOUR_WORKSPACE_ID>' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
-X PATCHRequest
| Name | Location | Type | Required | Default | Description |
|---|---|---|---|---|---|
Authorization | Header | string | Bearer token used for authentication. | ||
workspaceId | Query | string | Workspace identifier for multi‑tenant routing. | ||
domain | Path | string | Domain to get active status |
Response
| Name | Type | Description |
|---|---|---|
actived | boolean | Whether the domain is active. |
message | string | Message. |
{
"actived": false,
"message": "Challenge not ready"
}Last updated on