Skip to content

Latest commit

 

History

History
317 lines (223 loc) · 19.6 KB

File metadata and controls

317 lines (223 loc) · 19.6 KB

Domains

Overview

Available Operations

list

Retrieve a list of domains associated with the authenticated workspace.

Example Usage

from dub import Dub


with Dub(
    token="DUB_API_KEY",
) as d_client:

    res = d_client.domains.list(request={})

    while res is not None:
        # Handle items

        res = res.next()

Parameters

Parameter Type Required Description
request operations.ListDomainsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.ListDomainsResponse

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4XX, 5XX */*

create

Create a domain for the authenticated workspace.

Example Usage

from dub import Dub


with Dub(
    token="DUB_API_KEY",
) as d_client:

    res = d_client.domains.create(request={
        "slug": "acme.com",
        "expired_url": "https://acme.com/expired",
        "not_found_url": "https://acme.com/not-found",
        "placeholder": "https://dub.co/help/article/what-is-dub",
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.CreateDomainRequestBody ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

components.DomainSchema

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4XX, 5XX */*

delete

Delete a domain from a workspace. It cannot be undone. This will also delete all the links associated with the domain.

Example Usage

from dub import Dub


with Dub(
    token="DUB_API_KEY",
) as d_client:

    res = d_client.domains.delete(slug="acme.com")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
slug str ✔️ The domain name. acme.com
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteDomainResponseBody

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4XX, 5XX */*

update

Update a domain for the authenticated workspace.

Example Usage

from dub import Dub


with Dub(
    token="DUB_API_KEY",
) as d_client:

    res = d_client.domains.update(slug="acme.com", request_body={
        "slug": "acme.com",
        "expired_url": "https://acme.com/expired",
        "not_found_url": "https://acme.com/not-found",
        "placeholder": "https://dub.co/help/article/what-is-dub",
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
slug str ✔️ The domain name. acme.com
request_body Optional[operations.UpdateDomainRequestBody] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

components.DomainSchema

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4XX, 5XX */*

register

Register a domain for the authenticated workspace. Only available for Enterprise Plans.

Example Usage

from dub import Dub


with Dub(
    token="DUB_API_KEY",
) as d_client:

    res = d_client.domains.register(request={
        "domain": "acme.link",
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.RegisterDomainRequestBody ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.RegisterDomainResponseBody

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4XX, 5XX */*

check_status

Check if a domain name is available for purchase. You can check multiple domains at once.

Example Usage

from dub import Dub


with Dub(
    token="DUB_API_KEY",
) as d_client:

    res = d_client.domains.check_status(request={
        "domains": "<value>",
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.CheckDomainStatusRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

List[operations.CheckDomainStatusResponseBody]

Errors

Error Type Status Code Content Type
errors.BadRequest 400 application/json
errors.Unauthorized 401 application/json
errors.Forbidden 403 application/json
errors.NotFound 404 application/json
errors.Conflict 409 application/json
errors.InviteExpired 410 application/json
errors.UnprocessableEntity 422 application/json
errors.RateLimitExceeded 429 application/json
errors.InternalServerError 500 application/json
errors.SDKError 4XX, 5XX */*