{"_id":"56b0ef73135ec20d00baf9b8","category":{"_id":"56b00ad88f7a4f0d0029dc92","version":"569f9cf6650e1d1900f96b5e","project":"569f9cf6650e1d1900f96b5b","__v":10,"pages":["56b00b4d3c70b01700facf68","56b00b9d3c70b01700facf6a","56b016f43a5b810d00745dca","56b0e8cabf040b0d00588a96","56b0ef73135ec20d00baf9b8","56b21ce83b6f690d00bdb6b6","56b21ea99621f20d00efb273","56b22157a5a1020d00cf4c60","56b224b29621f20d00efb287","56b226677ae4550d00062954"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-02-02T01:48:08.558Z","from_sync":false,"order":5,"slug":"domain-methods","title":"Domain methods"},"githubsync":"","project":"569f9cf6650e1d1900f96b5b","user":"5582e90181672a3900bb4fc7","__v":71,"version":{"_id":"569f9cf6650e1d1900f96b5e","project":"569f9cf6650e1d1900f96b5b","__v":12,"createdAt":"2016-01-20T14:43:02.785Z","releaseDate":"2016-01-20T14:43:02.785Z","categories":["569f9cf7650e1d1900f96b5f","56abdd81d4432d1900eed235","56abe0558beeff0d003b8118","56ad2f8b1c09150d00a183a8","56ad4e1cd21f1b0d00fd2f97","56b00ad88f7a4f0d0029dc92","56b2432e9621f20d00efb2bd","56b25826147e900d00d6497a","56b7af2a4b372d2100722c48","56b8c4d938b1070d0028920f","56b8cdab14feef0d0082415d","58599813cf9e112d0032cdab"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-02T18:03:31.572Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","examples":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"## Syntax\n\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    <credentials object>, \\n    \\\"domain\\\": <domain name>\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response**\n\nIf the domain exists and the user can access it\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"success\\\": true,\\n    \\\"settable_attribute\\\": [list of attribute names], \\n    \\\"metadata\\\":\\n\\t\\t{\\n        \\\"options\\\": {key value pairs} \\n        \\\"bulletins\\\":\\n        {\\n            \\\"manual\\\": [{bulletin info}, {bulletin info}, ...],\\n            \\\"auto\\\": [{bulletin info}, {bulletin info}, ...] \\n        },\\n        \\\"createtime\\\": <domain creation time> \\n\\t\\t},\\n        \\\"inherit\\\":\\n            \\\"default_password_encoding\\\": <encoding type>, \\n            \\\"brand\\\": <brand>,\\n            \\\"filterdelivery\\\": <quarantine | passthrough>, \\n            \\\"password_strength\\\": <string>,\\n            \\\"regen_passwords\\\": <boolean>,\\n            \\\"smtp_sent_limit\\\": <number>,\\n            \\\"spamfolder\\\": <folder>, \\n            \\\"spamheader\\\":<header>,\\n            \\\"spamtag\\\": <tag>,\\n            \\\"spamlevel\\\": <level>\\n        }\\n    },\\n    \\\"attributes\\\": {key value pairs} \\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\nIf the domain does not exist but the user could create it\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"success\\\": false,\\n    \\\"error_number\\\": 2,\\n    \\\"error\\\": \\\"The requested object does not exist\\\", \\n    \\\"settable_attribute\\\" [list of attribute names], \\n    \\\"metadata\\\":\\n    {\\n        \\\"options\\\": {key value pairs}\\n        \\\"defaults\\\": {key value pairs} \\n    },\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Request fields for get_domain\"\n}\n[/block]\nThe following fields can be used in the **get_domain** method:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Definition/Value\",\n    \"0-0\": \"domain\",\n    \"0-1\": \"Required\",\n    \"0-2\": \"The domain whose settings you want to view.\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response fields for get_domain\"\n}\n[/block]\nThe following fields may be returned in response to the **get_domain** method:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Description/Value\",\n    \"0-0\": \"attributes\",\n    \"0-1\": \"Returned if domain exists\",\n    \"0-2\": \"A list of the attributes and values associated with the domain.\\n\\nFor more information, see the **Attributes** table below.\",\n    \"1-0\": \"error\",\n    \"1-1\": \"Returned if **success = false**\",\n    \"1-2\": \"A text string that explains the error.\",\n    \"2-0\": \"error_number\",\n    \"2-1\": \"Returned if **success = false**\",\n    \"2-2\": \"A number that represents the error.\",\n    \"3-0\": \"metadata\",\n    \"3-1\": \"Returned if domain exists or can be created\",\n    \"3-2\": \"Allowed values are: **bulletins**, **createtime**, **defaults**, **inherit**, and **options**.\\n\\nFor more information, see the **Metadata** table below.\",\n    \"4-0\": \"settable_attribute\",\n    \"4-1\": \"Returned if domain exists or can be created\",\n    \"4-2\": \"The attributes that can be set and the services that can be enabled, disabled, or suspended.\\n\\nAllowed values are:\\n\\n**aliases, allow, block, brand, default_password_encoding, disabled, filterdelivery, filtermx, language, limit_aliases, limit_users, notes_external, quota, quota_maximum, regen_passwords, service_imap4, service_pop3, service_smtpin, service_smtprelay, service_smtprelay_webmail, service_webmail, spamfolder, spam_header, spamlevel, spamtag, stats_mailout, timezone, wm_domainalias,** and **workgroup**\",\n    \"5-0\": \"success\",\n    \"5-1\": \"Always returned\",\n    \"5-2\": \"Indicates whether the request was successful or not. Allowed values are **true** and **false**.\"\n  },\n  \"cols\": 3,\n  \"rows\": 6\n}\n[/block]\n## Attributes fields \n\nThe following fields may be returned within the **attributes** array.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Definition/Value\",\n    \"0-0\": \"account\",\n    \"0-1\": \"Always returned\",\n    \"0-2\": \"The domain name.\",\n    \"1-0\": \"aliases\",\n    \"1-1\": \"Optional\",\n    \"1-2\": \"A list of alternate names for the domain. Users in the domain can receive mail that is sent to an alias domain. For example, if example- corporation.com is an alias for example.com, so mail that is sent to joe_user:::at:::example- corporation.com will be delivered to joe_user@example.com The maximum number of aliases is 2000.\",\n    \"2-0\": \"allow\",\n    \"2-1\": \"Optional\",\n    \"2-2\": \"A list of senders whose messages are not scanned for spam; may include wildcards. For example joe_goodguy@bigmail.com and *@example.com. Maximum is 1000 addresses.\",\n    \"3-0\": \"block\",\n    \"3-1\": \"Optional\",\n    \"3-2\": \"A list of email addresses whose messages will always be identified as spam; may include wildcards. For example, bob_thejerk@othermail.com and *@spammers-inc.com. Messages from these addresses will always be considered to be spam. Maximum is 1000 addresses.\",\n    \"4-0\": \"brand\",\n    \"4-1\": \"Optional\",\n    \"4-2\": \"The default brand used for mailboxes in the domain. If undefined, the company brand is used.\",\n    \"5-0\": \"catchall\",\n    \"5-1\": \"Optional\",\n    \"5-2\": \"If set, any mail sent to a mailbox in the domain that does not exist will be sent to the specified mailbox.\\n\\n**Note**: This feature cannot be enabled for new domains.\",\n    \"6-0\": \"company\",\n    \"6-1\": \"Always returned\",\n    \"6-2\": \"The company to which the domain belongs.\",\n    \"7-0\": \"default_password _encoding\",\n    \"7-1\": \"Optional\",\n    \"7-2\": \"The type of password hashing/encoding to be performed when OpenSRS receives an unencrypted password to store for a user.\",\n    \"8-0\": \"disabled\",\n    \"8-1\": \"Optional\",\n    \"8-2\": \"If set to **true**, mailboxes in the domain will not function.\",\n    \"9-0\": \"filterdelivery\",\n    \"9-1\": \"Optional\",\n    \"9-2\": \"The way in which spam messages are handled by the OpenSRS email filter. Allowed values are:\\n\\n  * **quarantine** — Spam messages are stored locally in the user's spam folder.\\n\\n  * **passthrough** — Spam messages are delivered with the specified **spamtag** and **spamheader**.\\n \\nIf undefined, the company's value is used.\",\n    \"10-0\": \"filtermx\",\n    \"10-1\": \"Optional\",\n    \"10-2\": \"The mail server (and optionally SMTP port) to which messages received by filter users in this domain are sent after spam and virus scanning.\",\n    \"11-0\": \"language\",\n    \"11-1\": \"Optional\",\n    \"11-2\": \"The default Webmail UI language for new users in the domain. May be overridden by the user.\",\n    \"12-0\": \"limit_aliases\",\n    \"12-1\": \"Optional\",\n    \"12-2\": \"The maximum number of aliases that can be created for mailboxes in the domain. If this number is less than the number of aliases currently in the domain, no new aliases can be created. If not defined, any number of aliases can be created.\",\n    \"13-0\": \"limit_users\",\n    \"13-1\": \"Optional\",\n    \"13-2\": \"The maximum number of users that can be created in the domain. If this number is less than the number of users currently in the domain, no new users can be created. If undefined, any number of users can be created.\",\n    \"14-0\": \"notes_external\",\n    \"14-1\": \"Always returned\",\n    \"14-2\": \"Any notes that were added through the **change_domain** method. Maximum is 4096 characters. If there are no notes, returns **null**.\",\n    \"15-0\": \"password\",\n    \"15-1\": \"Optional\",\n    \"15-2\": \"Indicates whether a password is set.\\n\\nIf a password exists, it is displayed as ************\\n\\nIf there is no password, the returned value is **null**.\",\n    \"16-0\": \"quota\",\n    \"16-1\": \"Optional\",\n    \"16-2\": \"The default maximum amount of storage (in bytes) that new mailboxes may use, including mail and file storage.\",\n    \"17-0\": \"quota_maximum\",\n    \"17-1\": \"Optional\",\n    \"17-2\": \"The default maximum quota (in Megabytes) that can be assigned to any mailbox in the domain.\",\n    \"19-0\": \"regen_passwords\",\n    \"19-1\": \"Optional\",\n    \"19-2\": \"If set to **true**, the next time a user logs in, their passwords will be converted to the encoding specified in **default_password_encoding** (if their current encoding differs from the one specified in **default_password_encoding**).\",\n    \"20-0\": \"service_imap4\",\n    \"20-1\": \"Optional\",\n    \"20-2\": \"The default setting for new users in the domain (**enabled**, **disabled**, or **suspended**). If **enabled**, new users can log in via IMAP4.\",\n    \"21-0\": \"service_pop3\",\n    \"21-1\": \"Optional\",\n    \"21-2\": \"The default setting for new users in the domain (**enabled**, **disabled**, or **suspended**). If **enabled**, new users can log in via POP3.\",\n    \"22-0\": \"service_smtpin\",\n    \"22-1\": \"Optional\",\n    \"22-2\": \"The default setting for new users in the domain (**enabled**, **disabled**, or **suspended**). If **enabled**, new users can send email.\",\n    \"23-0\": \"service_smtprelay\",\n    \"23-2\": \"The default setting for new users in the domain (**enabled**, **disabled**, or **suspended**).\",\n    \"23-1\": \"Optional\",\n    \"24-0\": \"service_smtprelay_webmail\",\n    \"24-1\": \"Optional\",\n    \"24-2\": \"The default setting for new users in the domain (**enabled**, **disabled**, or **suspended**). If enabled, new users send email via Webmail.\",\n    \"25-0\": \"service_webmail\",\n    \"25-1\": \"Optional\",\n    \"25-2\": \"The default setting for new users in the domain (**enabled**, **disabled**, or **suspended**). If **enabled**, new users can log in via Webmail.\",\n    \"26-0\": \"smtp_sent_limit\",\n    \"26-1\": \"Optional\",\n    \"26-2\": \"The default maximum number of messages that the user can send in a 24 hour period. Maximum number is 10,000. If not defined, the company's **smtp_sent_limit** is used.\",\n    \"27-0\": \"spamfolder\",\n    \"27-1\": \"Optional\",\n    \"27-2\": \"The folder to which messages that have been identified as spam are delivered.\",\n    \"28-0\": \"spamheader\",\n    \"28-1\": \"Optional\",\n    \"28-2\": \"The tag that will be assigned to the header of spam messages. The format for the header must be [Capital letter]anything[:] anything. For example, XSpam: Spam detected.\",\n    \"29-0\": \"spamlevel\",\n    \"29-1\": \"Optional\",\n    \"29-2\": \"The level of aggressiveness for spam filtering. Allowed values are: **Normal**, **High**, and **Very High**.\",\n    \"30-0\": \"spamtag\",\n    \"30-1\": \"Optional\",\n    \"30-2\": \"The tag that is appended to an email message to identify it as spam.\",\n    \"31-0\": \"stats_mailout\",\n    \"31-1\": \"Optional\",\n    \"31-2\": \"The addresses to which snapshots of domain usage are sent. Maximum is 100 addresses.\",\n    \"32-0\": \"timezone\",\n    \"32-1\": \"Optional\",\n    \"32-2\": \"The default Webmail UI timezone for users in the domain.\",\n    \"33-0\": \"wm_domainalias\",\n    \"33-1\": \"Optional\",\n    \"33-2\": \"If set to **true**, Webmail will offer users different **From** addresses based on domain aliases.\",\n    \"34-0\": \"workgroup\",\n    \"34-1\": \"Optional\",\n    \"34-2\": \"The default workgroup to which new accounts in the domain will belong.\",\n    \"18-0\": \"password_strength\",\n    \"18-1\": \"Optional\",\n    \"18-2\": \"The minimum level at which the password strength checks must pass (see change_user).\\n\\nIf set to null, the value will be inherited from the company level.\"\n  },\n  \"cols\": 3,\n  \"rows\": 35\n}\n[/block]\n## Metadata fields \n\nThe following fields may be returned in the **metadata** array:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Obligation\",\n    \"0-0\": \"bulletins\",\n    \"0-1\": \"Returned if domain exists\",\n    \"0-2\": \"A hash of the manual and auto bulletins that exist in the domain. Includes the following:\\n \\n  * **count** — The number of users to whom the bulletin was delivered.\\n \\n  * **last** — The last time (date and time) that the bulletin was sent. \\n\\n  * **mtime** — The last time that the bulletin was sent, in UNIX Epoch time.\\n \\n  * **name** — The name of the bulletin.\\n \\n  * **total** — The number of users to whom the bulletin is being sent.\\n\\n**Note**: If the bulletin job has completed, the values for count and total will be the same.\",\n    \"1-0\": \"createtime\",\n    \"1-1\": \"Returned if domain exists\",\n    \"1-2\": \"The date and time when the domain was created, displayed in UNIX Epoch time.\",\n    \"2-0\": \"defaults\",\n    \"2-1\": \"Returned if domain doesn't exist but can be created\",\n    \"2-2\": \"The default settings and values that will be applied to newly created domains. \\n\\nIncludes:\\n\\n**disabled, language, quota, quota_maximum, service_pop3, service_imap4, service_smtpin, service_smtprelay, service_smtprelay_webmail, service_webmail, timezone, **and **workgroup**.\\n\\nFor an explanation of each of these settings, see the **Attributes** table above.\",\n    \"3-0\": \"inherit\",\n    \"3-1\": \"Returned if domain exists\",\n    \"3-2\": \"The company level values that will be assigned if they are not explicity set for this domain. Includes the following:\\n\\n  *  **brand** — The Webmail brand for this domain.\\n \\n  * **default_password_encoding**  — The type of password hashing/encoding to be performed when OpenSRS receives an unencrypted password.\\n \\n  * **filterdelivery** — The way in which spam messages are handled.\\n \\n  * **regen_passwords** — If set to true, the next time a user logs in, their passwords will be converted to the encoding specified in \\n  \\n  * **default_password_encoding**\\n \\n  * **smtp_sent_limit** — The number of messages that the domain is allowed to send in a 24 hour period.\\n \\n  * **spamfolder** — The folder into which messages identified as spam will be delivered.\\n \\n  * **spamheader** — The tag that is added to messages that are identified as spam. \\n\\n  * **spamtag** — The value of this field is prepended to the subject of any message that is identified as spam.\\n \\n  * **spamlevel** — The level of aggressiveness set for the spam filter.\",\n    \"4-2\": \"The list of settings that can be set or changed for a domain. Includes all available values for each setting to allow a UI client to populate a page of attributes and drop-down options. Allowed settings are** brand, default_password_encoding, language, quota, quota_maximum, spamlevel, timezone,** and **workgroup**.\\n\\nFor an explanation of each of these settings, see the **Attributes** table above.\",\n    \"4-1\": \"Returned if domain exists\",\n    \"4-0\": \"options\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples for get_domain\"\n}\n[/block]\n## Example 1\n\nRetrieves settings and information for an existing domain.\n\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"credentials\\\":{\\n        \\\"user\\\": \\\"company_admin@example.adm\\\",\\n        \\\"password\\\": \\\"seekrit\\\"\\n    }\\n    \\\"domain\\\": [\\n        \\\"example.com\\\",\\n    ] \\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\": true,\\n  \\\"settable_attributes\\\": [\\n    \\\"aliases\\\",\\n    \\\"allow\\\",\\n    \\\"block\\\",\\n    \\\"brand\\\",\\n    \\\"default_password_encoding”,\\n    \\\"disabled\\\",\\n    \\\"filterdelivery\\\",\\n    \\\"filtermx\\\",\\n    \\\"language\\\",\\n    \\\"limit_aliases\\\",\\n    \\\"limit_users\\\",\\n    \\\"notes_external\\\",\\n    \\\"quota\\\",\\n    \\\"quota_maximum\\\",\\n    \\\"regen_passwords”,\\n    \\\"service_imap4\\\",\\n    \\\"service_pop3\\\",\\n    \\\"service_smtpin\\\",\\n    \\\"service_smtprelay\\\",\\n    \\\"service_smtprelay_webmail\\\",\\n    \\\"service_webmail\\\",\\n    \\\"spamfolder\\\",\\n    \\\"spamheader\\\",\\n    \\\"spamlevel\\\",\\n    \\\"spamtag\\\",\\n    \\\"stats_mailout\\\",\\n    \\\"timezone\\\",\\n    \\\"wm_domainalias\\\",\\n    \\\"workgroup\\\"\\n  ],\\n  \\\"metadata\\\": {\\n  \\\"options\\\": {\\n    \\\"quota\\\": [\\n      0,\\n      15360 \\n    ],\\n    \\\"default_password_encoding\\\": [\\n      null,\\n      \\\"MD5\\\",\\n      \\\"SSHA224\\\",\\n      \\\"SSHA256\\\",\\n      \\\"SSHA384\\\",\\n      \\\"SSHA512\\\",\\n      \\\"BCRYPT-6\\\",\\n      \\\"BCRYPT-8\\\",\\n      \\\"BCRYPT-10\\\",\\n      \\\"BCRYPT-12\\\"\\n    ],\\n    \\\"workgroup\\\": [\\n      \\\"contract\\\",\\n      \\\"interns\\\",\\n      \\\"sales\\\",\\n      \\\"sales_europe\\\",\\n      \\\"staff\\\",\\n      \\\"stock_holders\\\",\\n      \\\"sysadmins\\\"\\n    ],\\n    \\\"quota_maximum\\\": [\\n      0,\\n      15360 \\n    ],\\n    \\\"timezone\\\": [\\n    \\\"Pacific/Wake\\\",\\n    \\\"Pacific/Niue\\\",\\n    \\\"Pacific/Honolulu\\\",\\n    \\\"America/Anchorage\\\",\\n    \\\"America/Vancouver\\\",\\n    \\\"America/Edmonton\\\",\\n    \\\"America/Phoenix\\\",\\n    \\\"America/Chicago\\\",\\n    \\\"America/Mexico_City\\\",\\n    \\\"America/Guatemala\\\",\\n    \\\"America/Montreal\\\",\\n    \\\"America/Havana\\\",\\n    \\\"America/Lima\\\",\\n    \\\"America/Caracas\\\",\\n\\t\\t\\\"America/Halifax\\\",\\n\\t\\t\\\"America/Asuncion\\\",\\n\\t\\t\\\"America/Santiago\\\",\\n\\t\\t\\\"America/Puerto_Rico\\\",\\n\\t\\t\\\"America/La_Paz\\\",\\n\\t\\t\\\"America/St_Johns\\\",\\n\\t\\t\\\"America/Sao_Paulo\\\",\\n\\t\\t\\\"America/Montevideo\\\",\\n\\t\\t\\\"America/Buenos_Aires\\\",\\n\\t\\t\\\"America/Noronha\\\",\\n\\t\\t\\\"Atlantic/South_Georgia\\\",\\n\\t\\t\\\"Atlantic/Azores\\\",\\n\\t\\t\\\"Atlantic/Cape_Verde\\\",\\n\\t\\t\\\"Europe/London\\\",\\n\\t\\t\\\"Africa/Casablanca\\\",\\n\\t\\t\\\"Atlantic/Reykjavik\\\",\\n\\t\\t\\\"Europe/Amsterdam\\\",\\n\\t\\t\\\"Africa/Algiers\\\",\\n\\t\\t\\\"Asia/Beirut\\\",\\n\\t\\t\\\"Europe/Helsinki\\\",\\n\\t\\t\\\"Europe/Minsk\\\",\\n\\t\\t\\\"Europe/Istanbul\\\",\\n\\t\\t\\\"Asia/Amman\\\",\\n\\t\\t\\\"Asia/Damascus\\\",\\n\\t\\t\\\"Asia/Jerusalem\\\",\\n\\t\\t\\\"Africa/Cairo\\\",\\n\\t\\t\\\"Africa/Johannesburg\\\",\\n\\t\\t\\\"Europe/Moscow\\\",\\n\\t\\t\\\"Asia/Baghdad\\\",\\n\\t\\t\\\"Asia/Tehran\\\",\\n\\t\\t\\\"Asia/Baku\\\",\\n\\t\\t\\\"Asia/Dubai\\\",\\n    \\\"Indian/Mauritius\\\",\\n  \\t\\\"Asia/Kabul\\\",\\n  \\t\\\"Asia/Karachi\\\",\\n  \\t\\\"Asia/Colombo\\\",\\n  \\t\\\"Asia/Calcutta\\\",\\n  \\t\\\"Asia/Kathmandu\\\",\\n  \\t\\\"Asia/Dhaka\\\",\\n  \\t\\\"Asia/Rangoon\\\",\\n  \\t\\\"Asia/Bangkok\\\",\\n  \\t\\\"Asia/Phnom_Penh\\\",\\n  \\t\\\"Asia/Hong_Kong\\\",\\n  \\t\\\"Australia/Perth\\\",\\n  \\t\\\"Asia/Tokyo\\\",\\n  \\t\\\"Australia/Adelaide\\\",\\n  \\t\\\"Australia/Darwin\\\",\\n  \\t\\\"Australia/Melbourne\\\",\\n  \\t\\\"Australia/Brisbane\\\",\\n  \\t\\\"Australia/Lord_Howe\\\",\\n  \\t\\\"Pacific/Guadalcanal\\\",\\n  \\t\\\"Pacific/Norfolk\\\",\\n  \\t\\\"Pacific/Fiji\\\",\\n  \\t\\\"Pacific/Auckland\\\",\\n  \\t\\\"Asia/Anadyr\\\",\\n  \\t\\\"Pacific/Chatham\\\",\\n  \\t\\\"Pacific/Tongatapu\\\",\\n  \\t\\\"Pacific/Kiritimati\\\"\\n  ],\\n  \\\"language\\\": [\\n    \\\"el\\\",\\n    \\\"en\\\",\\n  \\t\\\"es\\\",\\n  \\t\\\"fr\\\",\\n  \\t\\\"de\\\",\\n  \\t\\\"it\\\",\\n  \\t\\\"pt_BR\\\",\\n    \\\"nl\\\",\\n    \\\"da\\\",\\n    \\\"no\\\",\\n    \\\"sv\\\"\\n  ],  \\n  \\\"brand\\\": [\\n    null,\\n    \\\"Default Brand\\\",\\n    \\\"Example Co Brand\\\"\\n  ],\\n   \\\"spamlevel\\\": [\\n     null,\\n     \\\"Very High\\\",\\n     \\\"High\\\",\\n     \\\"Normal\\\"\\n   ] \\n },\\n \\\"bulletins\\\": {\\n   \\\"manual\\\": [],\\n   \\\"auto\\\": [\\n           {\\n             \\\"count\\\": \\\"8\\\",\\n             \\\"mtime\\\": 1325878560,\\n             \\\"last\\\": \\\"Fri Jan 6 19:52:24 2012\\\",\\n             \\\"name\\\": \\\"Welcome Message\\\",\\n             \\\"total\\\": \\\"8\\\"\\n           }\\n           ]\\n },\\n \\\"createtime\\\": \\\"1321901972\\\"\\n},\\n\\\"attributes\\\": {\\n  \\\"quota\\\": 5120,\\n  \\\"disabled\\\": false,\\n  \\\"quota_maximum\\\": 15360,\\n  \\\"spamfolder\\\": null,\\n  \\\"service_smtprelay\\\": \\\"enabled\\\", \\n  \\\"spamheader\\\": null,\\n  \\\"brand\\\": null,\\n\\t\\\"catchall\\\": null,\\n\\t\\\"service_smtpin\\\": \\\"enabled\\\", \\n\\t\\\"filterdelivery\\\": null,\\n\\t\\\"company\\\": \\\"Example Corp\\\", \\n  \\\"limit_users\\\": null,\\n\\t\\\"filtermx\\\": null,\\n\\t\\\"service_imap4\\\": \\\"enabled\\\", \\n  \\\"wm_domainalias\\\": null,\\n\\t\\\"language\\\": \\\"en\\\",\\n\\t\\\"password\\\": null,\\n\\t\\\"timezone\\\": \\\"America/Montreal\\\", \\n  \\\"smtp_sent_limit\\\": null, \\n  \\\"regen_passwords\\\": true, \\n  \\\"default_password_encoding\\\":\\\"BCRYPT-12\\\", \\n  \\\"account\\\": \\\"example.com\\\", \\n  \\\"service_pop3\\\": \\\"enabled\\\",\\n\\t\\\"workgroup\\\": \\\"staff\\\", \\n  \\\"service_smtprelay_webmail\\\": \\\"enabled\\\", \\n  \\\"spamtag\\\": null,\\n\\t\\\"aliases\\\": [\\n    \\\"schmemoco.com\\\"\\n  ],\\n\\t\\\"allow\\\": [\\n    \\\"*@example.com\\\",\\n    \\\"important_stuff@otherco.com\\\"\\n],\\n\\\"block\\\": [],\\n\\\"limit_aliases\\\": null,\\n\\\"service_webmail\\\": \\\"enabled\\\",\\n\\\"stats_mailout\\\": [],\\n\\\"notes_external\\\": \\\"Gold support for this domain\\\",\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n## Example 2 \n\nRetrieves information and settings for a domain that does not exist but that the admin can create.\n\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"credentials\\\": {\\n    \\\"user\\\": \\\"company_admin@example.adm\\\",\\n    \\\"password\\\": \\\"sw0rdf1sh\\\"\\n  },\\n  \\\"domain\\\": \\\"example3.com\\\"\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\": false,\\n  \\\"settable_attributes\\\": [\\n    \\\"aliases\\\",\\n    \\\"allow\\\",\\n    \\\"block\\\",\\n    \\\"brand\\\",\\n    \\\"default_password_encoding\\\",\\n    \\\"disabled\\\",\\n    \\\"filterdelivery\\\",\\n    \\\"filtermx\\\",\\n    \\\"language\\\",\\n    \\\"limit_aliases\\\",\\n    \\\"limit_users\\\",\\n    \\\"notes_external\\\",\\n    \\\"quota\\\",\\n    \\\"quota_maximum\\\",\\n    \\\"regen_passwords\\\",\\n    \\\"service_imap4\\\",\\n    \\\"service_pop3\\\",\\n  \\t\\\"service_smtpin\\\",\\n  \\t\\\"service_smtprelay\\\",\\n  \\t\\\"service_smtprelay_webmail\\\",\\n  \\t\\\"service_webmail\\\",\\n  \\t\\\"spamfolder\\\",\\n  \\t\\\"spamheader\\\",\\n  \\t\\\"spamlevel\\\",\\n  \\t\\\"spamtag\\\",\\n  \\t\\\"stats_mailout\\\",\\n  \\t\\\"timezone\\\",\\n  \\t\\\"wm_domainalias\\\",\\n  \\t\\\"workgroup\\\"\\n  ],\\n  \\\"error_number\\\": 2,\\n  \\\"error\\\": \\\"The requested object does not exist\\\", \\n  \\\"metadata\\\": {\\n  \\\"options\\\": {\\n    \\\"quota\\\": [\\n      0,\\n      1048576 \\n    ],\\n    \\\"workgroup\\\": [],\\n    \\\"quota_maximum\\\": [\\n      0,\\n      15360 \\n    ],\\n    \\\"timezone\\\": [\\n      \\\"Pacific/Wake\\\",\\n      \\\"Pacific/Niue\\\",\\n      \\\"Pacific/Honolulu\\\",\\n      \\\"America/Anchorage\\\",\\n      \\\"America/Vancouver\\\",\\n      \\\"America/Edmonton\\\",\\n      \\\"America/Phoenix\\\",\\n      \\\"America/Chicago\\\",\\n\\t\\t\\t\\\"America/Mexico_City\\\",\\n\\t\\t\\t\\\"America/Guatemala\\\",\\n\\t\\t\\t\\\"America/Montreal\\\",\\n\\t\\t\\t\\\"America/Havana\\\",\\n\\t\\t\\t\\\"America/Lima\\\",\\n\\t\\t\\t\\\"America/Caracas\\\",\\n\\t\\t\\t\\\"America/Halifax\\\",\\n\\t\\t\\t\\\"America/Asuncion\\\",\\n\\t\\t\\t\\\"America/Santiago\\\",\\n\\t\\t\\t\\\"America/Puerto_Rico\\\",\\n\\t\\t\\t\\\"America/La_Paz\\\",\\n\\t\\t\\t\\\"America/St_Johns\\\",\\n\\t\\t\\t\\\"America/Sao_Paulo\\\",\\n\\t\\t\\t\\\"America/Montevideo\\\",\\n\\t\\t\\t\\\"America/Buenos_Aires\\\",\\n\\t\\t\\t\\\"America/Noronha\\\",\\n\\t\\t\\t\\\"Atlantic/South_Georgia\\\",\\n\\t\\t\\t\\\"Atlantic/Azores\\\",\\n\\t\\t\\t\\\"Atlantic/Cape_Verde\\\",\\n\\t\\t\\t\\\"Europe/London\\\",\\n\\t\\t\\t\\\"Africa/Casablanca\\\",\\n\\t\\t\\t\\\"Atlantic/Reykjavik\\\",\\n\\t\\t\\t\\\"Europe/Amsterdam\\\",\\n\\t\\t\\t\\\"Africa/Algiers\\\",\\n\\t\\t\\t\\\"Asia/Beirut\\\",\\n\\t\\t\\t\\\"Europe/Helsinki\\\",\\n\\t\\t\\t\\\"Europe/Minsk\\\",\\n\\t\\t\\t\\\"Europe/Istanbul\\\",\\n\\t\\t\\t\\\"Asia/Amman\\\",\\n\\t\\t\\t\\\"Asia/Damascus\\\",\\n\\t\\t\\t\\\"Asia/Jerusalem\\\",\\n\\t\\t\\t\\\"Africa/Cairo\\\",\\n\\t\\t\\t\\\"Africa/Johannesburg\\\",\\n\\t\\t\\t\\\"Europe/Moscow\\\",\\n       \\\"Asia/Baghdad\\\",\\n  \\t\\t\\\"Asia/Tehran\\\",\\n  \\t\\t\\\"Asia/Baku\\\",\\n  \\t\\t\\\"Asia/Dubai\\\",\\n  \\t\\t\\\"Indian/Mauritius\\\",\\n  \\t\\t\\\"Asia/Kabul\\\",\\n  \\t\\t\\\"Asia/Karachi\\\",\\n  \\t\\t\\\"Asia/Colombo\\\",\\n  \\t\\t\\\"Asia/Calcutta\\\",\\n  \\t\\t\\\"Asia/Kathmandu\\\",\\n  \\t\\t\\\"Asia/Dhaka\\\",\\n  \\t\\t\\\"Asia/Rangoon\\\",\\n  \\t\\t\\\"Asia/Bangkok\\\",\\n  \\t\\t\\\"Asia/Phnom_Penh\\\",\\n  \\t\\t\\\"Asia/Hong_Kong\\\",\\n  \\t\\t\\\"Australia/Perth\\\",\\n  \\t\\t\\\"Asia/Tokyo\\\",\\n  \\t\\t\\\"Australia/Adelaide\\\",\\n  \\t\\t\\\"Australia/Darwin\\\",\\n  \\t\\t\\\"Australia/Melbourne\\\",\\n  \\t\\t\\\"Australia/Brisbane\\\",\\n  \\t\\t\\\"Australia/Lord_Howe\\\",\\n  \\t\\t\\\"Pacific/Guadalcanal\\\",\\n  \\t\\t\\\"Pacific/Norfolk\\\",\\n  \\t\\t\\\"Pacific/Fiji\\\",\\n  \\t\\t\\\"Pacific/Auckland\\\",\\n  \\t\\t\\\"Asia/Anadyr\\\",\\n  \\t\\t\\\"Pacific/Chatham\\\",\\n  \\t\\t\\\"Pacific/Tongatapu\\\",\\n  \\t\\t\\\"Pacific/Kiritimati\\\"\\n    ],\\n    \\\"language\\\": [\\n  \\t\\t\\\"el\\\",\\n  \\t\\t\\\"en\\\",\\n  \\t\\t\\\"es\\\",\\n      \\\"fr\\\",\\n    \\t\\\"de\\\",\\n    \\t\\\"it\\\",\\n    \\t\\\"pt_BR\\\",\\n    \\t\\\"nl\\\",\\n    \\t\\\"da\\\",\\n    \\t\\\"no\\\",\\n    \\t\\\"sv\\\"\\n    ],\\n    \\\"default_password_encoding\\\": [\\n      null,\\n      \\\"MD5\\\",\\n    \\t\\\"SSHA224\\\",\\n    \\t\\\"SSHA256\\\",\\n    \\t\\\"SSHA384\\\",\\n    \\t\\\"SSHA512\\\",\\n    \\t\\\"BCRYPT-6\\\",\\n    \\t\\\"BCRYPT-8\\\",\\n    \\t\\\"BCRYPT-10\\\",\\n    \\t\\\"BCRYPT-12\\\"\\n    ], \\n    \\\"brand\\\": [\\n    \\tnull,\\n    \\t\\\"Default Brand\\\",\\n    \\t\\\"Example Co Brand\\\"\\n  \\t],\\n    \\\"spamlevel\\\": [\\n      null,\\n      \\\"Very High\\\",\\n      \\\"High\\\",\\n    \\t\\\"Normal\\\"\\n\\t\\t] \\n\\t},\\n\\t\\\"defaults\\\": {\\n    \\\"service_imap4\\\": \\\"enabled\\\",\\n    \\\"quota\\\": 5120,\\n\\t\\t\\\"disabled\\\": false,\\n\\t\\t\\\"quota_maximum\\\": 15360,\\n\\t\\t\\\"timezone\\\": \\\"America/Montreal\\\", \\n    \\\"language\\\": \\\"en\\\",\\n\\t\\t\\\"service_smtprelay\\\": \\\"enabled\\\", \\n    \\\"service_pop3\\\": \\\"enabled\\\",\\n\\t\\t\\\"workgroup\\\": \\\"staff\\\", \\n    \\\"service_smtprelay_webmail\\\": \\\"enabled\\\", \\n    \\\"service_smtpin\\\": \\\"enabled\\\", \\n    \\\"service_webmail\\\": \\\"enabled\\\"\\n  } \\n }\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]","excerpt":"The **get_domain** method retrieves the settings and information for a specified domain.","slug":"get_domain","type":"basic","title":"get_domain"}

get_domain

The **get_domain** method retrieves the settings and information for a specified domain.

## Syntax **Request** [block:code] { "codes": [ { "code": "{\n <credentials object>, \n \"domain\": <domain name>\n}", "language": "perl", "name": " " } ] } [/block] **Response** If the domain exists and the user can access it [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"settable_attribute\": [list of attribute names], \n \"metadata\":\n\t\t{\n \"options\": {key value pairs} \n \"bulletins\":\n {\n \"manual\": [{bulletin info}, {bulletin info}, ...],\n \"auto\": [{bulletin info}, {bulletin info}, ...] \n },\n \"createtime\": <domain creation time> \n\t\t},\n \"inherit\":\n \"default_password_encoding\": <encoding type>, \n \"brand\": <brand>,\n \"filterdelivery\": <quarantine | passthrough>, \n \"password_strength\": <string>,\n \"regen_passwords\": <boolean>,\n \"smtp_sent_limit\": <number>,\n \"spamfolder\": <folder>, \n \"spamheader\":<header>,\n \"spamtag\": <tag>,\n \"spamlevel\": <level>\n }\n },\n \"attributes\": {key value pairs} \n}", "language": "perl", "name": " " } ] } [/block] If the domain does not exist but the user could create it [block:code] { "codes": [ { "code": "{\n \"success\": false,\n \"error_number\": 2,\n \"error\": \"The requested object does not exist\", \n \"settable_attribute\" [list of attribute names], \n \"metadata\":\n {\n \"options\": {key value pairs}\n \"defaults\": {key value pairs} \n },\n}", "language": "perl", "name": " " } ] } [/block] [block:api-header] { "type": "basic", "title": "Request fields for get_domain" } [/block] The following fields can be used in the **get_domain** method: [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Definition/Value", "0-0": "domain", "0-1": "Required", "0-2": "The domain whose settings you want to view." }, "cols": 3, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Response fields for get_domain" } [/block] The following fields may be returned in response to the **get_domain** method: [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Description/Value", "0-0": "attributes", "0-1": "Returned if domain exists", "0-2": "A list of the attributes and values associated with the domain.\n\nFor more information, see the **Attributes** table below.", "1-0": "error", "1-1": "Returned if **success = false**", "1-2": "A text string that explains the error.", "2-0": "error_number", "2-1": "Returned if **success = false**", "2-2": "A number that represents the error.", "3-0": "metadata", "3-1": "Returned if domain exists or can be created", "3-2": "Allowed values are: **bulletins**, **createtime**, **defaults**, **inherit**, and **options**.\n\nFor more information, see the **Metadata** table below.", "4-0": "settable_attribute", "4-1": "Returned if domain exists or can be created", "4-2": "The attributes that can be set and the services that can be enabled, disabled, or suspended.\n\nAllowed values are:\n\n**aliases, allow, block, brand, default_password_encoding, disabled, filterdelivery, filtermx, language, limit_aliases, limit_users, notes_external, quota, quota_maximum, regen_passwords, service_imap4, service_pop3, service_smtpin, service_smtprelay, service_smtprelay_webmail, service_webmail, spamfolder, spam_header, spamlevel, spamtag, stats_mailout, timezone, wm_domainalias,** and **workgroup**", "5-0": "success", "5-1": "Always returned", "5-2": "Indicates whether the request was successful or not. Allowed values are **true** and **false**." }, "cols": 3, "rows": 6 } [/block] ## Attributes fields The following fields may be returned within the **attributes** array. [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Definition/Value", "0-0": "account", "0-1": "Always returned", "0-2": "The domain name.", "1-0": "aliases", "1-1": "Optional", "1-2": "A list of alternate names for the domain. Users in the domain can receive mail that is sent to an alias domain. For example, if example- corporation.com is an alias for example.com, so mail that is sent to joe_user@example- corporation.com will be delivered to joe_user@example.com The maximum number of aliases is 2000.", "2-0": "allow", "2-1": "Optional", "2-2": "A list of senders whose messages are not scanned for spam; may include wildcards. For example joe_goodguy@bigmail.com and *@example.com. Maximum is 1000 addresses.", "3-0": "block", "3-1": "Optional", "3-2": "A list of email addresses whose messages will always be identified as spam; may include wildcards. For example, bob_thejerk@othermail.com and *@spammers-inc.com. Messages from these addresses will always be considered to be spam. Maximum is 1000 addresses.", "4-0": "brand", "4-1": "Optional", "4-2": "The default brand used for mailboxes in the domain. If undefined, the company brand is used.", "5-0": "catchall", "5-1": "Optional", "5-2": "If set, any mail sent to a mailbox in the domain that does not exist will be sent to the specified mailbox.\n\n**Note**: This feature cannot be enabled for new domains.", "6-0": "company", "6-1": "Always returned", "6-2": "The company to which the domain belongs.", "7-0": "default_password _encoding", "7-1": "Optional", "7-2": "The type of password hashing/encoding to be performed when OpenSRS receives an unencrypted password to store for a user.", "8-0": "disabled", "8-1": "Optional", "8-2": "If set to **true**, mailboxes in the domain will not function.", "9-0": "filterdelivery", "9-1": "Optional", "9-2": "The way in which spam messages are handled by the OpenSRS email filter. Allowed values are:\n\n * **quarantine** — Spam messages are stored locally in the user's spam folder.\n\n * **passthrough** — Spam messages are delivered with the specified **spamtag** and **spamheader**.\n \nIf undefined, the company's value is used.", "10-0": "filtermx", "10-1": "Optional", "10-2": "The mail server (and optionally SMTP port) to which messages received by filter users in this domain are sent after spam and virus scanning.", "11-0": "language", "11-1": "Optional", "11-2": "The default Webmail UI language for new users in the domain. May be overridden by the user.", "12-0": "limit_aliases", "12-1": "Optional", "12-2": "The maximum number of aliases that can be created for mailboxes in the domain. If this number is less than the number of aliases currently in the domain, no new aliases can be created. If not defined, any number of aliases can be created.", "13-0": "limit_users", "13-1": "Optional", "13-2": "The maximum number of users that can be created in the domain. If this number is less than the number of users currently in the domain, no new users can be created. If undefined, any number of users can be created.", "14-0": "notes_external", "14-1": "Always returned", "14-2": "Any notes that were added through the **change_domain** method. Maximum is 4096 characters. If there are no notes, returns **null**.", "15-0": "password", "15-1": "Optional", "15-2": "Indicates whether a password is set.\n\nIf a password exists, it is displayed as ************\n\nIf there is no password, the returned value is **null**.", "16-0": "quota", "16-1": "Optional", "16-2": "The default maximum amount of storage (in bytes) that new mailboxes may use, including mail and file storage.", "17-0": "quota_maximum", "17-1": "Optional", "17-2": "The default maximum quota (in Megabytes) that can be assigned to any mailbox in the domain.", "19-0": "regen_passwords", "19-1": "Optional", "19-2": "If set to **true**, the next time a user logs in, their passwords will be converted to the encoding specified in **default_password_encoding** (if their current encoding differs from the one specified in **default_password_encoding**).", "20-0": "service_imap4", "20-1": "Optional", "20-2": "The default setting for new users in the domain (**enabled**, **disabled**, or **suspended**). If **enabled**, new users can log in via IMAP4.", "21-0": "service_pop3", "21-1": "Optional", "21-2": "The default setting for new users in the domain (**enabled**, **disabled**, or **suspended**). If **enabled**, new users can log in via POP3.", "22-0": "service_smtpin", "22-1": "Optional", "22-2": "The default setting for new users in the domain (**enabled**, **disabled**, or **suspended**). If **enabled**, new users can send email.", "23-0": "service_smtprelay", "23-2": "The default setting for new users in the domain (**enabled**, **disabled**, or **suspended**).", "23-1": "Optional", "24-0": "service_smtprelay_webmail", "24-1": "Optional", "24-2": "The default setting for new users in the domain (**enabled**, **disabled**, or **suspended**). If enabled, new users send email via Webmail.", "25-0": "service_webmail", "25-1": "Optional", "25-2": "The default setting for new users in the domain (**enabled**, **disabled**, or **suspended**). If **enabled**, new users can log in via Webmail.", "26-0": "smtp_sent_limit", "26-1": "Optional", "26-2": "The default maximum number of messages that the user can send in a 24 hour period. Maximum number is 10,000. If not defined, the company's **smtp_sent_limit** is used.", "27-0": "spamfolder", "27-1": "Optional", "27-2": "The folder to which messages that have been identified as spam are delivered.", "28-0": "spamheader", "28-1": "Optional", "28-2": "The tag that will be assigned to the header of spam messages. The format for the header must be [Capital letter]anything[:] anything. For example, XSpam: Spam detected.", "29-0": "spamlevel", "29-1": "Optional", "29-2": "The level of aggressiveness for spam filtering. Allowed values are: **Normal**, **High**, and **Very High**.", "30-0": "spamtag", "30-1": "Optional", "30-2": "The tag that is appended to an email message to identify it as spam.", "31-0": "stats_mailout", "31-1": "Optional", "31-2": "The addresses to which snapshots of domain usage are sent. Maximum is 100 addresses.", "32-0": "timezone", "32-1": "Optional", "32-2": "The default Webmail UI timezone for users in the domain.", "33-0": "wm_domainalias", "33-1": "Optional", "33-2": "If set to **true**, Webmail will offer users different **From** addresses based on domain aliases.", "34-0": "workgroup", "34-1": "Optional", "34-2": "The default workgroup to which new accounts in the domain will belong.", "18-0": "password_strength", "18-1": "Optional", "18-2": "The minimum level at which the password strength checks must pass (see change_user).\n\nIf set to null, the value will be inherited from the company level." }, "cols": 3, "rows": 35 } [/block] ## Metadata fields The following fields may be returned in the **metadata** array: [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Obligation", "0-0": "bulletins", "0-1": "Returned if domain exists", "0-2": "A hash of the manual and auto bulletins that exist in the domain. Includes the following:\n \n * **count** — The number of users to whom the bulletin was delivered.\n \n * **last** — The last time (date and time) that the bulletin was sent. \n\n * **mtime** — The last time that the bulletin was sent, in UNIX Epoch time.\n \n * **name** — The name of the bulletin.\n \n * **total** — The number of users to whom the bulletin is being sent.\n\n**Note**: If the bulletin job has completed, the values for count and total will be the same.", "1-0": "createtime", "1-1": "Returned if domain exists", "1-2": "The date and time when the domain was created, displayed in UNIX Epoch time.", "2-0": "defaults", "2-1": "Returned if domain doesn't exist but can be created", "2-2": "The default settings and values that will be applied to newly created domains. \n\nIncludes:\n\n**disabled, language, quota, quota_maximum, service_pop3, service_imap4, service_smtpin, service_smtprelay, service_smtprelay_webmail, service_webmail, timezone, **and **workgroup**.\n\nFor an explanation of each of these settings, see the **Attributes** table above.", "3-0": "inherit", "3-1": "Returned if domain exists", "3-2": "The company level values that will be assigned if they are not explicity set for this domain. Includes the following:\n\n * **brand** — The Webmail brand for this domain.\n \n * **default_password_encoding** — The type of password hashing/encoding to be performed when OpenSRS receives an unencrypted password.\n \n * **filterdelivery** — The way in which spam messages are handled.\n \n * **regen_passwords** — If set to true, the next time a user logs in, their passwords will be converted to the encoding specified in \n \n * **default_password_encoding**\n \n * **smtp_sent_limit** — The number of messages that the domain is allowed to send in a 24 hour period.\n \n * **spamfolder** — The folder into which messages identified as spam will be delivered.\n \n * **spamheader** — The tag that is added to messages that are identified as spam. \n\n * **spamtag** — The value of this field is prepended to the subject of any message that is identified as spam.\n \n * **spamlevel** — The level of aggressiveness set for the spam filter.", "4-2": "The list of settings that can be set or changed for a domain. Includes all available values for each setting to allow a UI client to populate a page of attributes and drop-down options. Allowed settings are** brand, default_password_encoding, language, quota, quota_maximum, spamlevel, timezone,** and **workgroup**.\n\nFor an explanation of each of these settings, see the **Attributes** table above.", "4-1": "Returned if domain exists", "4-0": "options" }, "cols": 3, "rows": 5 } [/block] [block:api-header] { "type": "basic", "title": "Examples for get_domain" } [/block] ## Example 1 Retrieves settings and information for an existing domain. **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\":{\n \"user\": \"company_admin@example.adm\",\n \"password\": \"seekrit\"\n }\n \"domain\": [\n \"example.com\",\n ] \n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"settable_attributes\": [\n \"aliases\",\n \"allow\",\n \"block\",\n \"brand\",\n \"default_password_encoding”,\n \"disabled\",\n \"filterdelivery\",\n \"filtermx\",\n \"language\",\n \"limit_aliases\",\n \"limit_users\",\n \"notes_external\",\n \"quota\",\n \"quota_maximum\",\n \"regen_passwords”,\n \"service_imap4\",\n \"service_pop3\",\n \"service_smtpin\",\n \"service_smtprelay\",\n \"service_smtprelay_webmail\",\n \"service_webmail\",\n \"spamfolder\",\n \"spamheader\",\n \"spamlevel\",\n \"spamtag\",\n \"stats_mailout\",\n \"timezone\",\n \"wm_domainalias\",\n \"workgroup\"\n ],\n \"metadata\": {\n \"options\": {\n \"quota\": [\n 0,\n 15360 \n ],\n \"default_password_encoding\": [\n null,\n \"MD5\",\n \"SSHA224\",\n \"SSHA256\",\n \"SSHA384\",\n \"SSHA512\",\n \"BCRYPT-6\",\n \"BCRYPT-8\",\n \"BCRYPT-10\",\n \"BCRYPT-12\"\n ],\n \"workgroup\": [\n \"contract\",\n \"interns\",\n \"sales\",\n \"sales_europe\",\n \"staff\",\n \"stock_holders\",\n \"sysadmins\"\n ],\n \"quota_maximum\": [\n 0,\n 15360 \n ],\n \"timezone\": [\n \"Pacific/Wake\",\n \"Pacific/Niue\",\n \"Pacific/Honolulu\",\n \"America/Anchorage\",\n \"America/Vancouver\",\n \"America/Edmonton\",\n \"America/Phoenix\",\n \"America/Chicago\",\n \"America/Mexico_City\",\n \"America/Guatemala\",\n \"America/Montreal\",\n \"America/Havana\",\n \"America/Lima\",\n \"America/Caracas\",\n\t\t\"America/Halifax\",\n\t\t\"America/Asuncion\",\n\t\t\"America/Santiago\",\n\t\t\"America/Puerto_Rico\",\n\t\t\"America/La_Paz\",\n\t\t\"America/St_Johns\",\n\t\t\"America/Sao_Paulo\",\n\t\t\"America/Montevideo\",\n\t\t\"America/Buenos_Aires\",\n\t\t\"America/Noronha\",\n\t\t\"Atlantic/South_Georgia\",\n\t\t\"Atlantic/Azores\",\n\t\t\"Atlantic/Cape_Verde\",\n\t\t\"Europe/London\",\n\t\t\"Africa/Casablanca\",\n\t\t\"Atlantic/Reykjavik\",\n\t\t\"Europe/Amsterdam\",\n\t\t\"Africa/Algiers\",\n\t\t\"Asia/Beirut\",\n\t\t\"Europe/Helsinki\",\n\t\t\"Europe/Minsk\",\n\t\t\"Europe/Istanbul\",\n\t\t\"Asia/Amman\",\n\t\t\"Asia/Damascus\",\n\t\t\"Asia/Jerusalem\",\n\t\t\"Africa/Cairo\",\n\t\t\"Africa/Johannesburg\",\n\t\t\"Europe/Moscow\",\n\t\t\"Asia/Baghdad\",\n\t\t\"Asia/Tehran\",\n\t\t\"Asia/Baku\",\n\t\t\"Asia/Dubai\",\n \"Indian/Mauritius\",\n \t\"Asia/Kabul\",\n \t\"Asia/Karachi\",\n \t\"Asia/Colombo\",\n \t\"Asia/Calcutta\",\n \t\"Asia/Kathmandu\",\n \t\"Asia/Dhaka\",\n \t\"Asia/Rangoon\",\n \t\"Asia/Bangkok\",\n \t\"Asia/Phnom_Penh\",\n \t\"Asia/Hong_Kong\",\n \t\"Australia/Perth\",\n \t\"Asia/Tokyo\",\n \t\"Australia/Adelaide\",\n \t\"Australia/Darwin\",\n \t\"Australia/Melbourne\",\n \t\"Australia/Brisbane\",\n \t\"Australia/Lord_Howe\",\n \t\"Pacific/Guadalcanal\",\n \t\"Pacific/Norfolk\",\n \t\"Pacific/Fiji\",\n \t\"Pacific/Auckland\",\n \t\"Asia/Anadyr\",\n \t\"Pacific/Chatham\",\n \t\"Pacific/Tongatapu\",\n \t\"Pacific/Kiritimati\"\n ],\n \"language\": [\n \"el\",\n \"en\",\n \t\"es\",\n \t\"fr\",\n \t\"de\",\n \t\"it\",\n \t\"pt_BR\",\n \"nl\",\n \"da\",\n \"no\",\n \"sv\"\n ], \n \"brand\": [\n null,\n \"Default Brand\",\n \"Example Co Brand\"\n ],\n \"spamlevel\": [\n null,\n \"Very High\",\n \"High\",\n \"Normal\"\n ] \n },\n \"bulletins\": {\n \"manual\": [],\n \"auto\": [\n {\n \"count\": \"8\",\n \"mtime\": 1325878560,\n \"last\": \"Fri Jan 6 19:52:24 2012\",\n \"name\": \"Welcome Message\",\n \"total\": \"8\"\n }\n ]\n },\n \"createtime\": \"1321901972\"\n},\n\"attributes\": {\n \"quota\": 5120,\n \"disabled\": false,\n \"quota_maximum\": 15360,\n \"spamfolder\": null,\n \"service_smtprelay\": \"enabled\", \n \"spamheader\": null,\n \"brand\": null,\n\t\"catchall\": null,\n\t\"service_smtpin\": \"enabled\", \n\t\"filterdelivery\": null,\n\t\"company\": \"Example Corp\", \n \"limit_users\": null,\n\t\"filtermx\": null,\n\t\"service_imap4\": \"enabled\", \n \"wm_domainalias\": null,\n\t\"language\": \"en\",\n\t\"password\": null,\n\t\"timezone\": \"America/Montreal\", \n \"smtp_sent_limit\": null, \n \"regen_passwords\": true, \n \"default_password_encoding\":\"BCRYPT-12\", \n \"account\": \"example.com\", \n \"service_pop3\": \"enabled\",\n\t\"workgroup\": \"staff\", \n \"service_smtprelay_webmail\": \"enabled\", \n \"spamtag\": null,\n\t\"aliases\": [\n \"schmemoco.com\"\n ],\n\t\"allow\": [\n \"*@example.com\",\n \"important_stuff@otherco.com\"\n],\n\"block\": [],\n\"limit_aliases\": null,\n\"service_webmail\": \"enabled\",\n\"stats_mailout\": [],\n\"notes_external\": \"Gold support for this domain\",", "language": "perl", "name": " " } ] } [/block] ## Example 2 Retrieves information and settings for a domain that does not exist but that the admin can create. **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"company_admin@example.adm\",\n \"password\": \"sw0rdf1sh\"\n },\n \"domain\": \"example3.com\"\n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": false,\n \"settable_attributes\": [\n \"aliases\",\n \"allow\",\n \"block\",\n \"brand\",\n \"default_password_encoding\",\n \"disabled\",\n \"filterdelivery\",\n \"filtermx\",\n \"language\",\n \"limit_aliases\",\n \"limit_users\",\n \"notes_external\",\n \"quota\",\n \"quota_maximum\",\n \"regen_passwords\",\n \"service_imap4\",\n \"service_pop3\",\n \t\"service_smtpin\",\n \t\"service_smtprelay\",\n \t\"service_smtprelay_webmail\",\n \t\"service_webmail\",\n \t\"spamfolder\",\n \t\"spamheader\",\n \t\"spamlevel\",\n \t\"spamtag\",\n \t\"stats_mailout\",\n \t\"timezone\",\n \t\"wm_domainalias\",\n \t\"workgroup\"\n ],\n \"error_number\": 2,\n \"error\": \"The requested object does not exist\", \n \"metadata\": {\n \"options\": {\n \"quota\": [\n 0,\n 1048576 \n ],\n \"workgroup\": [],\n \"quota_maximum\": [\n 0,\n 15360 \n ],\n \"timezone\": [\n \"Pacific/Wake\",\n \"Pacific/Niue\",\n \"Pacific/Honolulu\",\n \"America/Anchorage\",\n \"America/Vancouver\",\n \"America/Edmonton\",\n \"America/Phoenix\",\n \"America/Chicago\",\n\t\t\t\"America/Mexico_City\",\n\t\t\t\"America/Guatemala\",\n\t\t\t\"America/Montreal\",\n\t\t\t\"America/Havana\",\n\t\t\t\"America/Lima\",\n\t\t\t\"America/Caracas\",\n\t\t\t\"America/Halifax\",\n\t\t\t\"America/Asuncion\",\n\t\t\t\"America/Santiago\",\n\t\t\t\"America/Puerto_Rico\",\n\t\t\t\"America/La_Paz\",\n\t\t\t\"America/St_Johns\",\n\t\t\t\"America/Sao_Paulo\",\n\t\t\t\"America/Montevideo\",\n\t\t\t\"America/Buenos_Aires\",\n\t\t\t\"America/Noronha\",\n\t\t\t\"Atlantic/South_Georgia\",\n\t\t\t\"Atlantic/Azores\",\n\t\t\t\"Atlantic/Cape_Verde\",\n\t\t\t\"Europe/London\",\n\t\t\t\"Africa/Casablanca\",\n\t\t\t\"Atlantic/Reykjavik\",\n\t\t\t\"Europe/Amsterdam\",\n\t\t\t\"Africa/Algiers\",\n\t\t\t\"Asia/Beirut\",\n\t\t\t\"Europe/Helsinki\",\n\t\t\t\"Europe/Minsk\",\n\t\t\t\"Europe/Istanbul\",\n\t\t\t\"Asia/Amman\",\n\t\t\t\"Asia/Damascus\",\n\t\t\t\"Asia/Jerusalem\",\n\t\t\t\"Africa/Cairo\",\n\t\t\t\"Africa/Johannesburg\",\n\t\t\t\"Europe/Moscow\",\n \"Asia/Baghdad\",\n \t\t\"Asia/Tehran\",\n \t\t\"Asia/Baku\",\n \t\t\"Asia/Dubai\",\n \t\t\"Indian/Mauritius\",\n \t\t\"Asia/Kabul\",\n \t\t\"Asia/Karachi\",\n \t\t\"Asia/Colombo\",\n \t\t\"Asia/Calcutta\",\n \t\t\"Asia/Kathmandu\",\n \t\t\"Asia/Dhaka\",\n \t\t\"Asia/Rangoon\",\n \t\t\"Asia/Bangkok\",\n \t\t\"Asia/Phnom_Penh\",\n \t\t\"Asia/Hong_Kong\",\n \t\t\"Australia/Perth\",\n \t\t\"Asia/Tokyo\",\n \t\t\"Australia/Adelaide\",\n \t\t\"Australia/Darwin\",\n \t\t\"Australia/Melbourne\",\n \t\t\"Australia/Brisbane\",\n \t\t\"Australia/Lord_Howe\",\n \t\t\"Pacific/Guadalcanal\",\n \t\t\"Pacific/Norfolk\",\n \t\t\"Pacific/Fiji\",\n \t\t\"Pacific/Auckland\",\n \t\t\"Asia/Anadyr\",\n \t\t\"Pacific/Chatham\",\n \t\t\"Pacific/Tongatapu\",\n \t\t\"Pacific/Kiritimati\"\n ],\n \"language\": [\n \t\t\"el\",\n \t\t\"en\",\n \t\t\"es\",\n \"fr\",\n \t\"de\",\n \t\"it\",\n \t\"pt_BR\",\n \t\"nl\",\n \t\"da\",\n \t\"no\",\n \t\"sv\"\n ],\n \"default_password_encoding\": [\n null,\n \"MD5\",\n \t\"SSHA224\",\n \t\"SSHA256\",\n \t\"SSHA384\",\n \t\"SSHA512\",\n \t\"BCRYPT-6\",\n \t\"BCRYPT-8\",\n \t\"BCRYPT-10\",\n \t\"BCRYPT-12\"\n ], \n \"brand\": [\n \tnull,\n \t\"Default Brand\",\n \t\"Example Co Brand\"\n \t],\n \"spamlevel\": [\n null,\n \"Very High\",\n \"High\",\n \t\"Normal\"\n\t\t] \n\t},\n\t\"defaults\": {\n \"service_imap4\": \"enabled\",\n \"quota\": 5120,\n\t\t\"disabled\": false,\n\t\t\"quota_maximum\": 15360,\n\t\t\"timezone\": \"America/Montreal\", \n \"language\": \"en\",\n\t\t\"service_smtprelay\": \"enabled\", \n \"service_pop3\": \"enabled\",\n\t\t\"workgroup\": \"staff\", \n \"service_smtprelay_webmail\": \"enabled\", \n \"service_smtpin\": \"enabled\", \n \"service_webmail\": \"enabled\"\n } \n }\n}", "language": "perl", "name": " " } ] } [/block]