« Back to Documentation Overviewadd_account
Section: Servers
Version: 1.5.0
Add new account to server.
Conditions:
- password (mandatory) – Must be at least 8 characters including lowercase letter, uppercase letter, digit or special character. Note for polish users: this conforms GIODO increased and high security levels.
- first_name (mandatory) – At least one character.
- last_name (mandatory) – At least one character.
- email (mandatory) – Valid email address.
- company_name (optional) – At least one character.
- phone (mandatory) – At least one character. No format is forced.
- country_code (mandatory) – Two letter country code as described in ISO 3166-1.
- country (mandatory) – Name of country as described in ISO 3166-1. Must match country_code.
- city (mandatory) – At least one character.
- state (optional) – At least one character.
- street (mandatory) – At least one character.
- zip_code (mandatory) – At least one character. No format is forced.
- campaign (mandatory) – Every account created must also have default campaign. Conditions are explained on add_campaign method with few differences:
- campaign from_field / reply_to_field – Are not passed because default campaign inherits account email address.
- campaign confirmation_subject (mandatory) – CONFIRMATION_SUBJECT_ID obtained from get_confirmation_subjects. Used in confirmation messages sent from this campaign.
- campaign confirmation_body (mandatory) – CONFIRMATION_BODY_ID obtained from get_confirmation_bodies. Used in confirmation messages sent from this campaign.
- campaign optin (optional) – Allows to set campaign optin mode to single (unconfirmed) or double (confirmed). Note that campaign confirmation_subject / confirmation_body are mandatory even if optin is single.
Every account added through API has its own API KEY generated by default.
Parameters
|
---|
string | API_KEY |
object | string | password | 12#$qwER | string | first_name | John | string | last_name | Doe | string | email | john.doe@example.mail | string | company_name | Implix | string | phone | +48111111111 | string | country_code | PL | string | country | Poland | string | city | Gdau0144sk | string | state | pomorskie | string | street | u017babianska | string | zip_code | 24-213 | object | campaign | string | name | trains | string | description | Fani pociu0105gu00f3w. | string | confirmation_subject | CONFIRMATION_SUBJECT_ID | string | confirmation_body | CONFIRMATION_BODY_ID | string | language_code | PL | string | optin | single |
|
|
Return Value
|
---|
string | ACCOUNT_ID | abc123 |
integer | added | 1 |
Example Request JSON
[
"API_KEY",
{
"password": "12#$qwER",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.mail",
"company_name": "Implix",
"phone": "+48111111111",
"country_code": "PL",
"country": "Poland",
"city": "Gdau0144sk",
"state": "pomorskie",
"street": "u017babianska",
"zip_code": "24-213",
"campaign": {
"name": "trains",
"description": "Fani pociu0105gu00f3w.",
"confirmation_subject": "CONFIRMATION_SUBJECT_ID",
"confirmation_body": "CONFIRMATION_BODY_ID",
"language_code": "PL",
"optin": "single"
}
}
]
Example Response JSON
{
"ACCOUNT_ID": "abc123",
"added": 1
}
Example Error Response JSON
{
"code": -1,
"message": "Invalid country"
}
Method-specific Errors
|
---|
Owner privilege missing |
Invalid email syntax |
Email already taken |
Password too weak |
Invalid country |
API-wide Errors
|
---|
API key verification failed
| API key verification failed |
API client IP not allowed
| API client IP not allowed |
Invalid params
| Attribute params must be reference to hash |