JSON API » access » access/create

Creates a new remote access account.

Input parameters

Requires authentication and the administrator or wholesale role privileges.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
nameStringName.Yes
typeString"callback", "direct", or "menu".Yes
accountStringAccount number to authenticate caller.NoEmpty string.
calleridStringCallerid to match.NoNone.
callerid_externalStringCallerid to transmit on external calls.NoEmpty string.
callerid_internalStringCallerid to transmit on internal calls.NoEmpty string.
cosIntegerID of class of service. 0 for none.No0
customerIntegerID of customer to create in.NoCustomer of authentication user.
descriptionStringDescription.NoEmpty string.
dialplanStringDial plan. Empty string for default.NoEmpty string.
dnumberStringNumber to automatically dial. Empty string for none.NoEmpty string.
dtmf_connect_callerStringDTMF to play to caller when outbound call connects.NoEmpty string.
lockedInteger1 to lock the account, 0 not to.No0
ownerIntegerID of owning person. 0 for none.No0
passwordStringPIN to authenticate caller.NoEmpty string.
play_balanceInteger1 to play the balance to caller, 0 not to.No0
prefixStringCalled number prefix to match. Empty string for none.NoEmpty string.
presentation_externalInteger1 to allow callerid presentation on external calls, 32 to forbid it.No1
recordgroupIntegerID of record group. 0 for none.No0
sourceStringSource IP address to match. Empty string for none.NoEmpty string.
stripIntegerNumber of digits to strip from called number. Normally only used with prefix.No0
validationInteger1 to validate input then return, 0 for full action.No0

If the type is "callback", the a callerid must be specified. If the type is "menu", then either an account or a callerid must be specified.

Responses

CodeDescription
200Success.
201Input passed validation. Only returned if validation=1.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
403Your rate plan does not allow this.

Data returned

The ID of the created account.

Example: With required parameters

http://enswitch.example.com/api/json/access/create/?auth_username=user;auth_password=password;name=example;type=menu;account=12345

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "id":123 } }

Change history

VersionChanges
3.13Function added.