Domains - Add new domain
This method is used to add a new domain. The domain code is returned in the location header field.
posthttps://api.qboxmail.com/api/domains
Header
Field | Type | Description |
---|---|---|
X-Api-Token | String |
Authorization token. |
Accept | String |
Accepted response format. Allowed values:
|
Content-Type | String |
Content type of the request. Allowed values:
|
{
Accept: application/json
X-Api-Token: 123456789
Content-Type: application/json
}
Parameter
Field | Type | Description |
---|---|---|
name | String |
Domain name without www. |
postmaster_password | String |
Password for the user Postmaster (min 8 chars and at least one number). |
postmaster_password_confirmation | String |
Repeat the password. |
plan optional | String |
the plan of the domain. Default value: Allowed values:
|
catch_all_enabled optional | Boolean |
true if you want to active the catch all for the domain. Available only for non trial users. Default value: |
catch_all_destination optional | String |
valid email address, must be present if catch_all_enabled is true. Available only for non trial users. |
max_email_accounts optional | Integer |
Max number of email accounts for the domain, -1 = no-limit. |
max_email_accounts_archive optional | Integer |
Max number of email accounts with the archive option activated for the domain, -1 = no-limit. |
max_email_accounts_25gb optional | Integer |
Max number of email accounts with 25GB of storage for the domain, -1 = no-limit. |
max_email_quota optional | Integer |
Max quota in bytes for the email accounts of the domain Default value: Allowed values:
|
antispam_level optional | Integer |
Level of the antispam. 0: disabled, 1: permissive, 2: standard, 3: aggressive Default value: Allowed values:
|
default_quota optional | Integer |
Default quota used at the creation of new email for the domain. Default value: Allowed values:
|
imap_disabled optional | Boolean |
Disable IMAP protocol on all email accounts of the domain. Default value: |
pop_disabled optional | Boolean |
Disable POP protocol on all email accounts of the domain. Default value: |
archive_disabled optional | Boolean |
Disable archive on all email accounts of the domain. Default value: |
webmail_disabled optional | Boolean |
Disable webmail access on all email accounts of the domain. Default value: |
smtp_disabled optional | Boolean |
Disable SMTP protocol on all email accounts of the domain. Default value: |
chat optional | Boolean |
Enable chat on the Qboxmail webmail. Only available on domain with plan "enterprise" Default value: |
activesync optional | Boolean |
Enable activesync service on domain accounts. Only available on domain with plan "professional" or "enterprise". Default value: |
meeting optional | Boolean |
Enable meeting video chat on the Qboxmail webmail. Only available on domain with plan "enterprise" Default value: |
calendar optional | Boolean |
Enable calendar on the Qboxmail webmail. Only available on domain with plan "enterprise" Default value: |
xmpp optional | Boolean |
Enable xmpp service on domain accounts. Only available on domain with plan "professional" or "enterprise" Default value: |
dav optional | Boolean |
Enable dav service on domain accounts. Only available on domain with plan "professional" or "enterprise" Default value: |
api_enabled optional | Boolean |
Enable API access on domain accounts. Only available on domain with plan "professional" or "enterprise" Default value: |
password_change_disabled optional | Boolean |
Disable the password change from the user. Only the domain owner will be able to change users passwords. This is the default value that will be applied on new email accounts that have not set this option explicitly, but it can be overwritten in the settings of the single email account. Only available on domain with plan "professional" or "enterprise" Default value: |
password_recovery_disabled optional | Boolean |
Disable the password recovery from the user. This is the default value that will be applied on new email accounts that have not set this option explicitly, but it can be overwritten in the settings of the single email account. Only available on domain with plan "professional" or "enterprise" Default value: |
password_expiration optional | Integer |
Set the number of months before the password will expire and will need to be changed. This is the default value that will be applied on new email accounts that have not set this option explicitly, but it can be overwritten in the settings of the single email account. Only available on domain with plan "professional" or "enterprise" Default value: Allowed values:
|
force_password_first_login optional | Boolean |
If true, every account will need to set a new password on the first login. This is the default value that will be applied on new email accounts that have not set this option explicitly, but it can be overwritten in the settings of the single email account. Only available on domain with plan "professional" or "enterprise" Default value: |
block_old_password optional | Boolean |
If true, the users will not be able to choose a password that has been already used in the past. This is the default value that will be applied on new email accounts that have not set this option explicitly, but it can be overwritten in the settings of the single email account. Only available on domain with plan "enterprise" Default value: |
force_otp optional | Boolean |
If true, every users must have to use 2 factor authentication to login to Qboxmail services. This is the default value that will be applied on new email accounts that have not set this option explicitly, but it can be overwritten in the settings of the single email account. Only available on domain with plan "enterprise" Default value: |
allow_nets optional | String[] |
List of valid ip addresses. Default value: |
company optional | String |
Name of the company associated with the domain |
telephone optional | String |
Telephone number of the company |
address optional | String |
Address of the company |
city optional | String |
City of the company |
zip optional | String |
Zip code of the company |
state optional | String |
State of the company |
country optional | String |
Country of the company |
language optional | String |
Language for the users of the domains. it = Italian, en = English. By default the language of the customer is applied. Allowed values:
|
timezone optional | String |
Timezone. You can find the list of valid timezones here: https://gist.githubusercontent.com/ciaoben/f926d7ae8d1387b439de17f4fb9d308f/raw/03d719e51be724a327b665d53f00dc1a45aeab20/qboxmail_timezones.txt By the timezone of the customer is applied. |
Created 201
Field | Type | Description |
---|---|---|
message | String |
Confirmation message and newly created resource code. |
/*
* Create a domain with all the default settings
* sending only the name and the password of the postmaster accoun
*/
curl -v \
-H "Content-Type: application/json" \
-H "X-Api-Token: 3u2eIGWX2oN_Z2TRxZOp5Si8hzrDF6vpyxYcdWAX-WUnbBroqNmphw9PUBbGNolP" \
-X POST -d '{
"name":"hello1.com",
"postmaster_password":"Qwertyuiop0",
"postmaster_password_confirmation":"Qwertyuiop0" }' \
https://api.qboxmail.com/api/domains
> POST /api/domains HTTP/1.1
> Host: api.qboxmail.com
> User-Agent: curl/7.51.0
> Accept: */*
> Content-Type: application/json
> X-Api-Token: 3u2eIGWX2oN_Z2TRxZOp5Si8hzrDF6vpyxYcdWAX-WUnbBroqNmphw9PUBbGNolP
> Content-Length: 97
< HTTP/1.1 201 Created
< Location: https://api.qboxmail.com/domains/D072048005
< Content-Type: application/json
< Content-Length: 28
< Etag: W/"a0d00fe50a65a8b47780d2dce5029fb4"
< Cache-Control: max-age=0, private, must-revalidate
< X-Request-Id: a4fc6b0f-bc05-47c5-be04-021848b52dea
< X-Runtime: 0.030012
< Vary: Origin
< Server: WEBrick/1.3.1 (Ruby/2.3.3/2016-11-21)
< Date: Mon, 28 Nov 2016 10:58:00 GMT
< Connection: Keep-Alive
Body:
{
"message": "risorsa creata",
"resource_code":"D477048238"
}
/*
* Create a domain with the enterprise plan, the company name
*/
curl -v \
-H "Content-Type: application/json" \
-H "X-Api-Token: 3u2eIGWX2oN_Z2TRxZOp5Si8hzrDF6vpyxYcdWAX-WUnbBroqNmphw9PUBbGNolP" \
-X POST -d '{
"name":"hello2.com",
"postmaster_password":"Qwertyuiop0",
"postmaster_password_confirmation":"Qwertyuiop0",
"plan": "enterprise",
"company": 'Qboxmail' }' \
https://api.qboxmail.com/api/domains
> POST /api/domains HTTP/1.1
> Host: api.qboxmail.com
> User-Agent: curl/7.51.0
> Accept: */*
> Content-Type: application/json
> X-Api-Token: 3u2eIGWX2oN_Z2TRxZOp5Si8hzrDF6vpyxYcdWAX-WUnbBroqNmphw9PUBbGNolP
> Content-Length: 290
< HTTP/1.1 201 Created
< Location: https://api.qboxmail.com/domains/D727264119
< Content-Type: application/json
< Content-Length: 28
< Etag: W/"a0d00fe50a65a8b47780d2dce5029fb4"
< Cache-Control: max-age=0, private, must-revalidate
< X-Request-Id: 4473c7ac-e843-47d6-8bbf-2318a7e7e939
< X-Runtime: 0.045450
< Vary: Origin
< Server: WEBrick/1.3.1 (Ruby/2.3.3/2016-11-21)
< Date: Mon, 28 Nov 2016 11:54:46 GMT
< Connection: Keep-Alive
Body:
{
"message": "risorsa creata",
"resource_code":"D477048238"
}
Error 400
Name | Type | Description |
---|---|---|
BadRequest | json |
Invalid JSON. |
Error 401
Name | Type | Description |
---|---|---|
Unauthorized | json |
Invalid token. |
Error 422
Name | Type | Description |
---|---|---|
ValidationError | json |
Validation failed. |
{
"error": "Unauthorized"
}
{
"message": "Validazione Fallita",
"errors": [
{
"field": "max_email_quota",
"description": "non è un valore valido"
},
{
"field": "default_quota",
"description": "non è un valore valido"
}
]
}