The SDK is currently in active development. For more details, see the U301 Postman docs.

Get Active Status

Pull domain active status after domain DNS record is added

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.

u301.domains.getActiveStatus
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
});

the response

PATCH /v3/shorten/domains/:domain/active
curl --location 'https://api.u301.com/v3/shorten/domains/<YOUR_DOMAIN>/active?workspaceId=<YOUR_WORKSPACE_ID>' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
-X PATCH

the response

Request

NameLocationTypeRequiredDefaultDescription
AuthorizationHeaderstringBearer token used for authentication.
workspaceIdQuerystringWorkspace identifier for multi‑tenant routing.
domainPathstringDomain to get active status

Response

NameTypeDescription
activedbooleanWhether the domain is active.
messagestringMessage.
response-example.json
{
    "actived": false,
    "message": "Challenge not ready"
}

Last updated on

On this page