JSON API » cards » cards/groups/create

Creates a new card group.

Input parameters

Requires authentication and the cards role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
nameStringName.Yes
planIntegerID of rate plan for pricing outbound calls.Yes
allow_balanceInteger1 to allow the caller to hear their balance, 0 not to.No1
balanceDecimalDefault balance for new cards.No0.00
calleridStringThe callerid to send on outbound calls.NoEmpty string.
card_lengthIntegerLength of new card numbers.No12
change_pinInteger1 if users may change their PIN, 0 if they may not.No1
chargeDecimalAmount to charge all cards each charge_period period.No0.00
charge_afterStringAfter which event the cards are charged. "create" or "firstuse".No"firstuse"
charge_lockedInteger1 to charge locked card, 0 not to.No0
charge_periodStringHow often to charge. "daily", "weekly", "monthly", "annually", or empty string for never.No"monthly"
clockIntegerPercent of real time to give card users.No100
creditDecimalDefault credit limit for new cards.No0.00
currencyStringCurrency costs are in.NoSystem currency.
customerIntegerID of customer to create in.NoCustomer of authentication user.
descriptionStringDescription.NoEmpty string.
dialplanStringDial plan for outbound calls.NoDefault.
dnumberStringAlways dial this number. Empty string to ask the caller.NoEmpty string.
expiresStringThe number of days after which cards expire. 0 for never.No0
expires_afterStringAfter which event the cards expire. "create" or "firstuse".No"create"
hide_expiredInteger1 if expired cards seem not to exist, else 0.No0
hide_lockedInteger1 if locked cards seem not to exist, else 0.No0
languageStringLanguage to play menus in. Empty string for system default.NoEmpty string.
lockedInteger1 if all cards in group are locked, 0 if not.No0
methodStringMethod for allocating card numbers. "random" or "sequential".No"random"
pin_maximumIntegerMaximum PIN length.No8
pin_minimumIntegerMinimum PIN length.No0
play_balanceInteger1 to always play balance to callers, 0 not to.No0
play_timeInteger1 to play time available to callers, 0 not to.No0
warn_calledInteger1 to warn called party before call is cut off.No1
warn_callerInteger1 to warn caller before call is cut off.No1
warn_repeatIntegerRepeats cutoff warning this number of seconds. 0 to disable.No30
warn_timeIntegerNumber of seconds before cutoff to play first warning. 0 to disable.No60
validationInteger1 to validate input then return, 0 for full action.No0

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.
500An internal error occurred. Check the key and message fields for more details.

Data returned

The ID of the created card group.

Example: With required parameters

http://enswitch.example.com/api/json/cards/groups/create/?auth_username=user;auth_password=password;name=example;plan=1234

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

Change history

VersionChanges
3.13Function added.