from dub import Dub
with Dub(
token="DUB_API_KEY",
) as d_client:
res = d_client.domains.list(request={
"archived": True,
})
while res is not None:
# Handle items
res = res.next()declare(strict_types=1);
require 'vendor/autoload.php';
use Dub;
$sdk = Dub\Dub::builder()
->setSecurity(
'DUB_API_KEY'
)
->build();
$responses = $sdk->domains->list(
archived: true,
page: 1,
pageSize: 50
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}package main
import(
"context"
dubgo "github.com/dubinc/dub-go"
"github.com/dubinc/dub-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := dubgo.New(
dubgo.WithSecurity("DUB_API_KEY"),
)
res, err := s.Domains.List(ctx, operations.ListDomainsRequest{
Archived: dubgo.Pointer(true),
})
if err != nil {
log.Fatal(err)
}
if res != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}require 'dub'
Models = ::OpenApiSDK::Models
s = ::OpenApiSDK::Dub.new(
security: Models::Shared::Security.new(
token: 'DUB_API_KEY',
),
)
req = Models::Operations::ListDomainsRequest.new(
archived: true,
)
res = s.domains.list(request: req)
unless res.nil?
# handle response
endimport { Dub } from "dub";
const dub = new Dub({
token: "DUB_API_KEY",
});
async function run() {
const result = await dub.domains.list();
for await (const page of result) {
console.log(page);
}
}
run();curl --request GET \
--url https://api.dub.co/domains \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.dub.co/domains', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.dub.co/domains")
.header("Authorization", "Bearer <token>")
.asString();[
{
"id": "<string>",
"slug": "acme.com",
"verified": false,
"primary": false,
"archived": false,
"placeholder": "https://dub.co/help/article/what-is-dub",
"expiredUrl": "https://acme.com/expired",
"notFoundUrl": "https://acme.com/not-found",
"logo": "<string>",
"assetLinks": null,
"appleAppSiteAssociation": null,
"createdAt": "<string>",
"updatedAt": "<string>",
"registeredDomain": {
"id": "<string>",
"autoRenewalDisabledAt": "<string>",
"createdAt": "<string>",
"expiresAt": "<string>",
"renewalFee": 123
}
}
]{
"error": {
"code": "bad_request",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#bad-request"
}
}{
"error": {
"code": "unauthorized",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#forbidden"
}
}{
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#not-found"
}
}{
"error": {
"code": "conflict",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#conflict"
}
}{
"error": {
"code": "invite_expired",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#invite-expired"
}
}{
"error": {
"code": "unprocessable_entity",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#unprocessable-entity"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#rate-limit_exceeded"
}
}{
"error": {
"code": "internal_server_error",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#internal-server_error"
}
}Retrieve a list of domains
Retrieve a list of domains associated with the authenticated workspace.
from dub import Dub
with Dub(
token="DUB_API_KEY",
) as d_client:
res = d_client.domains.list(request={
"archived": True,
})
while res is not None:
# Handle items
res = res.next()declare(strict_types=1);
require 'vendor/autoload.php';
use Dub;
$sdk = Dub\Dub::builder()
->setSecurity(
'DUB_API_KEY'
)
->build();
$responses = $sdk->domains->list(
archived: true,
page: 1,
pageSize: 50
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}package main
import(
"context"
dubgo "github.com/dubinc/dub-go"
"github.com/dubinc/dub-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := dubgo.New(
dubgo.WithSecurity("DUB_API_KEY"),
)
res, err := s.Domains.List(ctx, operations.ListDomainsRequest{
Archived: dubgo.Pointer(true),
})
if err != nil {
log.Fatal(err)
}
if res != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}require 'dub'
Models = ::OpenApiSDK::Models
s = ::OpenApiSDK::Dub.new(
security: Models::Shared::Security.new(
token: 'DUB_API_KEY',
),
)
req = Models::Operations::ListDomainsRequest.new(
archived: true,
)
res = s.domains.list(request: req)
unless res.nil?
# handle response
endimport { Dub } from "dub";
const dub = new Dub({
token: "DUB_API_KEY",
});
async function run() {
const result = await dub.domains.list();
for await (const page of result) {
console.log(page);
}
}
run();curl --request GET \
--url https://api.dub.co/domains \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.dub.co/domains', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.dub.co/domains")
.header("Authorization", "Bearer <token>")
.asString();[
{
"id": "<string>",
"slug": "acme.com",
"verified": false,
"primary": false,
"archived": false,
"placeholder": "https://dub.co/help/article/what-is-dub",
"expiredUrl": "https://acme.com/expired",
"notFoundUrl": "https://acme.com/not-found",
"logo": "<string>",
"assetLinks": null,
"appleAppSiteAssociation": null,
"createdAt": "<string>",
"updatedAt": "<string>",
"registeredDomain": {
"id": "<string>",
"autoRenewalDisabledAt": "<string>",
"createdAt": "<string>",
"expiresAt": "<string>",
"renewalFee": 123
}
}
]{
"error": {
"code": "bad_request",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#bad-request"
}
}{
"error": {
"code": "unauthorized",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#forbidden"
}
}{
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#not-found"
}
}{
"error": {
"code": "conflict",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#conflict"
}
}{
"error": {
"code": "invite_expired",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#invite-expired"
}
}{
"error": {
"code": "unprocessable_entity",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#unprocessable-entity"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#rate-limit_exceeded"
}
}{
"error": {
"code": "internal_server_error",
"message": "The requested resource was not found.",
"doc_url": "https://dub.co/docs/api-reference/errors#internal-server_error"
}
}Authorizations
Default authentication mechanism
Query Parameters
Whether to include archived domains in the response. Defaults to false if not provided.
The search term to filter the domains by.
The page number for pagination.
x > 01
The number of items per page.
0 < x <= 5050
Response
The domains were retrieved.
The unique identifier of the domain.
The domain name.
"acme.com"
Whether the domain is verified.
Whether the domain is the primary domain for the workspace.
Whether the domain is archived.
Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.
"https://dub.co/help/article/what-is-dub"
The URL to redirect to when a link under this domain has expired.
"https://acme.com/expired"
The URL to redirect to when a link under this domain doesn't exist.
"https://acme.com/not-found"
The logo of the domain.
assetLinks.json configuration file (for deep link support on Android).
apple-app-site-association configuration file (for deep link support on iOS).
The date the domain was created.
The date the domain was last updated.
The registered domain record.
Show child attributes
Show child attributes