Domains

Domains and sub-domains are the internal categorisation of tickets, configured by each account in its settings. This resource returns the domains of your own account only: a contractor never reads the domains of its clients. Read-only. Use it to resolve the domain, main_domain and subdomain of a ticket.

Properties

  • Name
    _id
    Type
    string
    Description

    Unique identifier of the domain. This is the value carried by domain._id, main_domain._id and subdomain._id of a ticket.

  • Name
    label
    Type
    string
    Description

    Name of the domain in the language of the API token's user, then of the account, then in French.

  • Name
    parent_id
    Type
    string
    Description

    Id of the parent domain, null for a root domain.

  • Name
    i18n
    Type
    object
    Description

    Every translation of the name, keyed by language code (fr, en, de, es, ...).

  • Name
    subdomains
    Type
    array
    Description

    Only with tree=true: the sub-domains of the domain, with the same properties (recursively).


GET/api/v3.0/domains

Domains list

This endpoint returns every domain and sub-domain of your account. By default the list is flat, each sub-domain pointing to its domain through parent_id; with tree=true you get the root domains with their subdomains nested. The list is not paginated.

Optional parameters

  • Name
    tree
    Type
    string
    Description

    true | false (default). With true, root domains carry their subdomains.

client_id is not supported: an account only reads its own domains. Sending it returns 400 with { "error": "client_id is not supported: an account can only read its own domains." }.

Request

GET
/api/v3.0/domains
curl -G https://api.bob-desk.com/api/v3.0/domains \
  -H "Authorization: Bearer {token}" \
  -d tree="true"

Response (tree=true)

{
  "domains": [
    {
      "_id": "5d9b5b5b9ab7e72a4fb4ae71",
      "label": "Bâtiment",
      "parent_id": null,
      "i18n": { "fr": "Bâtiment", "en": "Building" },
      "subdomains": [
        {
          "_id": "5d9b5b5b9ab7e72a4fb4ae70",
          "label": "Plomberie",
          "parent_id": "5d9b5b5b9ab7e72a4fb4ae71",
          "i18n": { "fr": "Plomberie", "en": "Plumbing" },
          "subdomains": []
        }
      ]
    }
  ]
}

Response (flat, default)

{
  "domains": [
    {
      "_id": "5d9b5b5b9ab7e72a4fb4ae71",
      "label": "Bâtiment",
      "parent_id": null,
      "i18n": { "fr": "Bâtiment", "en": "Building" }
    },
    {
      "_id": "5d9b5b5b9ab7e72a4fb4ae70",
      "label": "Plomberie",
      "parent_id": "5d9b5b5b9ab7e72a4fb4ae71",
      "i18n": { "fr": "Plomberie", "en": "Plumbing" }
    }
  ]
}