Перейти до вмісту

Create an account

Цей контент ще не доступний вашою мовою.

createAccount creates an account that belongs to the authenticated customer. The parameters below are the account fields; updateAccount and getAccountInfo use the same names.

The method supports trusted mode with i_customer, the customer the new account belongs to.

The fields are grouped as on the tabs of the account form in the panel; the panel label is given in bold. A required field must be present in the request, but a string may be empty (""). Send None (<nil/>) where the description says nil.

Any parameter value can contain the patterns of the accounts generator, for example ${N:[1-9][0-9][0-9][0-9]} for random digits or ${P:12} for a random password. In ${C:xxx}, xxx is the name of another parameter, not a column number: "authname": "${C:username}" copies the generated username. The response returns the generated credentials.

Name Type Required Description
username string yes Login for the self-care portal (Account Name)
web_password string yes Password for the self-care portal (Web Password). Must satisfy i_password_policy
authname string yes SIP login (VoIP Login). The panel sets it to username unless Separate VoIP Login and VoIP password is ticked
voip_password string yes SIP password (VoIP Password)
i_password_policy int yes Password policy for web_password (Password Policy)
description string no Free text shown in the account list (Description)
batch_tag string no Label for accounts created together, used in filters (Batch Tag)
i_account_class int no Account class (Account Class)
blocked int no 1 = blocked, 0 = active (Blocked). To block an existing account, use blockAccount
Name Type Required Description
i_billing_plan int yes Service plan (Service Plan). It sets the tariff the account’s calls are rated with, so there is no separate tariff parameter
i_routing_group int no Routing group for outgoing calls (Routing Group). Required for accounts of the root customer. nil = Default
balance double yes Opening balance in the payment currency (Balance). Set on creation only
credit_limit double yes How far below zero the balance may go (Credit Limit). 0 for a prepaid account
lifetime int yes Days the account stays usable after its first call (Lifetime (days)). -1 = unlimited
on_payment_action int yes What a payment does (On Payment Action): nil = No Action, 0 = Extend Lifetime, 1 = Clear First Use, 2 = Restart Billing
i_commission_agent int no i_customer of the reseller that earns a commission on this account (Commission Agent). nil = none
commission_size double no Commission in percent (Commission Size (%))
invoicing_enabled boolean no Issue invoices for this account (Invoicing Enabled)
i_invoice_template int no Invoice template, used when invoicing_enabled is True (Invoice Template)
Name Type Required Description
max_sessions int yes Simultaneous calls (Max Sessions). -1 = unlimited
max_calls_per_second double no Call attempts per second (Max Calls Per Second). nil = unlimited
max_credit_time int yes Longest single call in seconds (Max Credit Time (sec))
translation_rule string yes Rule applied to the called number (CLD Translation Rule)
cli_translation_rule string yes Rule applied to the calling number (CLI Translation Rule)
reg_allowed int yes 1 = accept REGISTER from the account (Registration Allowed)
i_media_relay_type int yes Media relay use (Media Relay Type). IDs from the media_relay_types dictionary
preferred_codec int yes Payload type of the preferred codec (Preferred Codec), see below. nil = Any
use_preferred_codec_only int yes 1 = offer only the preferred codec (Use Preferred Codec Only)
trust_cli int yes 1 = trust the caller identity sent by the account (Trust Caller Info)
disallow_loops int yes 1 = reject calls that loop back to the account (Disallow Loops)
cpe_number string yes Device identifier (CPE Number)
i_provisioning int no Auto-provisioning profile (Provisioning ID): 1 = Linksys. nil = disabled
hide_own_cli boolean no Make outgoing calls anonymous (Hide CLI)
block_incoming_anonymous boolean no Block incoming anonymous calls (Block Incoming Anonymous)
i_incoming_anonymous_action int no What happens to a blocked anonymous call (Incoming Anonymous Action): 1 = reject (default), 2 = play a prompt and reject, 3 = send to voicemail
dnd_enabled boolean no Do-not-disturb mode (Do Not Disturb)
followme_enabled boolean no Call forwarding (Follow-Me Enabled). See Follow Me
i_caller_name_type int no Caller name sent to the called party (Caller Name): 1 = pass through unchanged (default), 2 = the account’s first_name mid_init last_name, 3 = caller_name, 4 = the CLI
caller_name string no Fixed caller name, used when i_caller_name_type is 3
pass_p_asserted_id boolean no Pass on the P-Asserted-Identity header received from the account (Pass P-Asserted-Identity)
p_assrt_id_translation_rule string no Rule applied to the incoming P-Asserted-Identity (P-Asserted-Id Translation Rule)
privacy_schemas array no Privacy header schemas as strings, for example ["pai", "rpid"] (Privacy Schemas)
trust_privacy_hdrs boolean no Trust the privacy headers sent by the account (Trust Privacy Headers)
dncl_lookup boolean no Check called numbers against the Do-Not-Call list (DNCL Lookup). Only when DNC list lookups are enabled on the switch
generate_ringbacktone boolean no Generate a ringback tone on 180/181 received after 183 (Generate Ringback Tone)
allow_free_onnet_calls boolean no Allow on-net calls priced 0 while the balance is below zero (Allow Free On-net Calls)
Name Type Required Description
vm_enabled int yes 1 = voicemail on (Voicemail Enabled)
vm_password string yes Voicemail PIN, digits 0-9 only (PIN Code)
vm_timeout int no Seconds of ringing before a call goes to voicemail (VM Timeout (sec))
vm_check_number string no Number the account dials to reach its voicemail, for example *98 (VM Check Number)
vm_dialin_access boolean no Allow access to the voicemail from outside (Dial-in Access)
vm_notify_emails string yes Addresses notified of new messages (VM Notify Emails)
vm_forward_emails string yes Addresses that receive the recording (VM Forward Emails)
vm_del_after_fwd int yes 1 = delete a message after forwarding it (Delete After Forward)
welcome_call_ivr int yes Welcome call (Welcome Call IVR): nil = System Default, 0 = None
Name Type Required Description
i_time_zone int yes Time zone of the portal and CDRs (Time Zone). IDs from the timezones dictionary
i_lang string yes Two-letter language code of the portal, for example en or ru (Language). Codes from the languages dictionary
i_export_type int yes Download format (Export Type). IDs from the export_types dictionary
start_page int no Page shown after login (Start Page): 1 = Calls History, 4 = My Preferences
payment_currency string yes ISO 4217 currency of online payments (Payment Currency)
payment_method int yes Preferred card type for online payments (Payment Method)
min_payment_amount double yes Smallest online payment accepted (Min Payment Amount)

All contact fields are strings and required; send "" for the ones you do not use. They appear on invoices.

Name Type Required Description
company_name string yes Company Name
salutation string yes Salutation: Mr., Ms. and so on
first_name string yes First Name
mid_init string yes M.I. (middle initial)
last_name string yes Last Name
street_addr string yes Street Address
city string yes City
state string yes Province/State
postal_code string yes Postal Code
country string yes Country
contact string yes Contact
phone string yes Phone
fax string yes Fax
alt_phone string yes Alt. Phone
alt_contact string yes Alt. Contact
email string yes E-mail. authAccount can log in by it
cc string yes Cc for e-mails to the account
bcc string yes Bcc for e-mails to the account
Value Codec
nil Any codec
0 G.711u
3 GSM
4 G.723
8 G.711a
9 G.722
15 G.728
18 G.729
Name Type Description
result string OK
i_account int ID of the new account
username string Web login, with patterns resolved
web_password string Web password
authname string SIP login
voip_password string SIP password
vm_password string Voicemail PIN

Store the passwords now: getAccountInfo does not return them.

A prepaid SIP account with a generated web password, the SIP login equal to the account name and voicemail on:

request
call("createAccount", {
"username": "1001",
"web_password": "${P:12}",
"authname": "${C:username}",
"voip_password": "${P:16}",
"i_password_policy": 1,
"description": "Reception desk",
"i_billing_plan": 42,
"balance": 10.0,
"credit_limit": 0.0,
"lifetime": -1,
"on_payment_action": None,
"max_sessions": 2,
"max_credit_time": 3600,
"translation_rule": "",
"cli_translation_rule": "",
"reg_allowed": 1,
"i_media_relay_type": 1,
"preferred_codec": None,
"use_preferred_codec_only": 0,
"trust_cli": 0,
"disallow_loops": 1,
"cpe_number": "",
"vm_enabled": 1,
"vm_password": "4821",
"vm_timeout": 30,
"vm_check_number": "*98",
"vm_notify_emails": "reception@example.com",
"vm_forward_emails": "",
"vm_del_after_fwd": 0,
"welcome_call_ivr": None,
"i_time_zone": 288,
"i_lang": "en",
"i_export_type": 2,
"payment_currency": "USD",
"payment_method": 1,
"min_payment_amount": 5.0,
"company_name": "Example Ltd", "salutation": "", "first_name": "Ann",
"mid_init": "", "last_name": "Lee", "street_addr": "", "city": "",
"state": "", "postal_code": "", "country": "", "contact": "",
"phone": "", "fax": "", "alt_phone": "", "alt_contact": "",
"email": "reception@example.com", "cc": "", "bcc": "",
})
response
{
"result": "OK",
"i_account": 3092,
"username": "1001",
"web_password": "kq7Rm2xVt9Lp",
"authname": "1001",
"voip_password": "Zr4tW8nYb2Qh6sKe",
"vm_password": "4821",
}
faultCode Cause
400 A required parameter is missing. The panel reports it as “Please fill in all required fields”