JSON API » cards » cards/groups/create
Creates a new card group.
Input parameters
Requires authentication and the cards role privilege.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
name | String | Name. | Yes | |
plan | Integer | ID of rate plan for pricing outbound calls. | Yes | |
allow_balance | Integer | 1 to allow the caller to hear their balance, 0 not to. | No | 1 |
balance | Decimal | Default balance for new cards. | No | 0.00 |
callerid | String | The callerid to send on outbound calls. | No | Empty string. |
card_length | Integer | Length of new card numbers. | No | 12 |
change_pin | Integer | 1 if users may change their PIN, 0 if they may not. | No | 1 |
charge | Decimal | Amount to charge all cards each charge_period period. | No | 0.00 |
charge_after | String | After which event the cards are charged. "create" or "firstuse". | No | "firstuse" |
charge_locked | Integer | 1 to charge locked card, 0 not to. | No | 0 |
charge_period | String | How often to charge. "daily", "weekly", "monthly", "annually", or empty string for never. | No | "monthly" |
clock | Integer | Percent of real time to give card users. | No | 100 |
credit | Decimal | Default credit limit for new cards. | No | 0.00 |
currency | String | Currency costs are in. | No | System currency. |
customer | Integer | ID of customer to create in. | No | Customer of authentication user. |
description | String | Description. | No | Empty string. |
dialplan | String | Dial plan for outbound calls. | No | Default. |
dnumber | String | Always dial this number. Empty string to ask the caller. | No | Empty string. |
expires | String | The number of days after which cards expire. 0 for never. | No | 0 |
expires_after | String | After which event the cards expire. "create" or "firstuse". | No | "create" |
hide_expired | Integer | 1 if expired cards seem not to exist, else 0. | No | 0 |
hide_locked | Integer | 1 if locked cards seem not to exist, else 0. | No | 0 |
language | String | Language to play menus in. Empty string for system default. | No | Empty string. |
locked | Integer | 1 if all cards in group are locked, 0 if not. | No | 0 |
method | String | Method for allocating card numbers. "random" or "sequential". | No | "random" |
pin_maximum | Integer | Maximum PIN length. | No | 8 |
pin_minimum | Integer | Minimum PIN length. | No | 0 |
play_balance | Integer | 1 to always play balance to callers, 0 not to. | No | 0 |
play_time | Integer | 1 to play time available to callers, 0 not to. | No | 0 |
warn_called | Integer | 1 to warn called party before call is cut off. | No | 1 |
warn_caller | Integer | 1 to warn caller before call is cut off. | No | 1 |
warn_repeat | Integer | Repeats cutoff warning this number of seconds. 0 to disable. | No | 30 |
warn_time | Integer | Number of seconds before cutoff to play first warning. 0 to disable. | No | 60 |
validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 |
Responses
Code | Description |
---|---|
200 | Success. |
201 | Input passed validation. Only returned if validation=1. |
400 | Invalid input parameters specified. Check the key and message fields for more details. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
403 | Your rate plan does not allow this. |
500 | An 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
Version | Changes |
---|---|
3.13 | Function added. |