SIGN UP

Users

Methods

AddUser

Adds a new user.

Parameters

  • Follow link for authentication parameter names and details.

  • user_name:

    string

    The user name in format a-z0-9{2,49}

  • user_display_name:

    string

    The user display name. The length must be less than 256.

  • user_password:

    string

    The user password. The length must be at least 6 symbols.

  • application_id:

    number

    The application ID which new user will be bound to. Could be used instead of the application_name parameter.

  • application_name:

    string

    The application name which new user will be bound to. Could be used instead of the application_id parameter.

  • mobile_phone:

    string
    OPTIONAL

    The user mobile phone. The length must be less than 50.

  • user_active:

    boolean
    OPTIONALDEFAULTS TO:  true

    The user enable flag

  • user_custom_data:

    string
    OPTIONAL

    Any string

  • parent_accounting:

    boolean
    OPTIONAL

    'True' if the user will use the parent account's money, 'false' if the user will have a separate balance.

Returns

  • result:

    number

    1

  • user_id:

    number

    The new user ID.

Examples

request:

Add a new user.

https://api.voximplant.com/platform_api/AddUser/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&user_name=iden1&user_display_name=iden1&user_password=1234567&application_id=1

response:

{
    "result": 1,
    "user_id": 1
}

DelUser

Deletes the specified user(s).

Parameters

  • Follow link for authentication parameter names and details.

  • user_id:

    intlist

    The user ID list separated by the ';' symbol or the 'all' value.

  • user_name:

    stringlist

    The user name list separated by the ';' symbol that can be used instead of user_id.

  • application_id:

    number
    OPTIONAL

    Delete the specified users bound to the application ID. It is required if the user_name is specified.

  • application_name:

    string
    OPTIONAL

    Delete the specified users bound to the application name. Could be used instead of the application_id parameter.

Returns

  • result:

    number

    1

Examples

request:

Delete two users with ID 3 and 55.

https://api.voximplant.com/platform_api/DelUser/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&user_id=3%3B55

Delete all the users bound to the 'myapp1' application.

https://api.voximplant.com/platform_api/DelUser/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&user_id=all&application_name=myapp1

response:

Success

{
    "result": 1
}

GetUsers

Shows the users of the specified account.

Parameters

  • Follow link for authentication parameter names and details.

  • application_id:

    number

    The application ID to filter.

  • application_name:

    string

    The application name part to filter.

  • skill_id:

    number
    OPTIONAL

    The skill ID to filter.

  • excluded_skill_id:

    number
    OPTIONAL

    The excluded skill ID to filter.

  • acd_queue_id:

    number
    OPTIONAL

    The ACD queue ID to filter.

  • excluded_acd_queue_id:

    number
    OPTIONAL

    The excluded ACD queue ID to filter.

  • user_id:

    number
    OPTIONAL

    The user ID to filter.

  • user_name:

    string
    OPTIONAL

    The user name part to filter.

  • user_active:

    boolean
    OPTIONAL

    The user active flag to filter.

  • user_display_name:

    string
    OPTIONAL

    The user display name part to filter.

  • with_skills:

    boolean
    OPTIONALDEFAULTS TO:  false

    Set true to get the bound skills.

  • with_queues:

    boolean
    OPTIONALDEFAULTS TO:  false

    Set true to get the bound queues.

  • acd_status:

    stringlist
    OPTIONAL

    The ACD status list separated by the ';' symbol to filter. The following values are possible: OFFLINE, ONLINE, READY, BANNED, IN_SERVICE, AFTER_SERVICE, TIMEOUT, DND.

  • showing_skill_id:

    number
    OPTIONAL

    The skill to show in the 'skills' field output.

  • count:

    number
    OPTIONALDEFAULTS TO:  20

    The max returning record count.

  • offset:

    number
    OPTIONALDEFAULTS TO:  0

    The first N records will be skipped in the output.

  • order_by:

    string
    OPTIONALDEFAULTS TO:  user_name

    The following values are available: 'user_id', 'user_name' and 'user_display_name'.

  • return_live_balance:

    boolean
    OPTIONALDEFAULTS TO:  true

    Set true to get the user live balance.

Returns

  • result:

    [ UserInfoType ]

    The UserInfoType records.

  • total_count:

    number

    The total found user count.

  • count:

    number

    The returned user count.

Examples

request:

Get two first identities.

https://api.voximplant.com/platform_api/GetUsers/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&application_id=1&count=2

response:

{
    "count": 2,
    "result": [
        {
            "frozen": false,
            "balance": 1,
            "user_id": 1,
            "modified": "2013-09-09 11:26:31",
            "user_name": "iden-1",
            "user_active": true,
            "user_display_name": "iden-1"
        },
        {
            "frozen": false,
            "balance": 0,
            "user_id": 2,
            "modified": "2013-09-09 15:22:13",
            "user_name": "iden-2",
            "user_active": true,
            "user_display_name": "iden-2"
        }
    ],
    "total_count": 2
}

SetUserInfo

Edits the user.

Parameters

  • Follow link for authentication parameter names and details.

  • user_id:

    number

    The user to edit.

  • user_name:

    string

    Can be used instead of user_id.

  • application_id:

    number
    OPTIONAL

    The application ID. It is required if the user_name is specified.

  • application_name:

    string
    OPTIONAL

    The application name that can be used instead of application_id.

  • new_user_name:

    string
    OPTIONAL

    The new user name in format a-z0-9{2,49}

  • user_display_name:

    string
    OPTIONAL

    The new user display name. The length must be less than 256.

  • user_password:

    string
    OPTIONAL

    The new user password. The length must be at least 6 symbols.

  • user_active:

    boolean
    OPTIONALDEFAULTS TO:  true

    The user enable flag

  • user_custom_data:

    string
    OPTIONAL

    Any string

  • mobile_phone:

    string
    OPTIONAL

    The new user mobile phone. The length must be less than 50.

  • parent_accounting:

    boolean
    OPTIONAL

    Set 'true' to use the parent account's money, 'false' to use a separate user balance.

Returns

  • result:

    number

    1

Examples

request:

Edit the user password.

https://api.voximplant.com/platform_api/SetUserInfo/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&user_id=1&user_password=7654321

response:

Success

{
    "result": 1
}

TransferMoneyToUser

Transfer the account's money to the user or transfer the user's money to the account if the money amount is negative.

Parameters

  • Follow link for authentication parameter names and details.

  • user_id:

    intlist

    The user ID list separated by the ';' symbol or the 'all' value.

  • user_name:

    stringlist

    The user name list separated by the ';' symbol that can be used instead of user_id.

  • amount:

    decimal

    The money amount, $. The absolute amount value must be equal or greater than 0.01

  • application_id:

    number
    OPTIONAL

    The application ID. It is required if the user_name is specified.

  • application_name:

    string
    OPTIONAL

    The application name that can be used instead of application_id.

  • currency:

    string
    OPTIONAL

    The amount currency. Examples: RUR, EUR, USD.

  • strict_mode:

    boolean
    OPTIONALDEFAULTS TO:  true

    Returns error if strict_mode is true and a user or the account hasn't enough money.

  • user_transaction_description:

    string
    OPTIONALDEFAULTS TO:  From account/To account

    The user transaction description.

  • account_transaction_description:

    string
    OPTIONALDEFAULTS TO:  From user: ${user_name}/To user: ${user_name}

    The account transaction description. The following macro available: ${user_id}, ${user_name}

Returns

  • result:

    number

    1

  • balance:

    decimal

    The new account balance.

Examples

request:

Transfer 5.67 $ to the user 1 and transfer 5.67 $ to the user 2 too. The account spends 2*5.67= 11.34 $ in total.

https://api.voximplant.com/platform_api/TransferMoneyToUser/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&user_id=1%3B2&amount=5.67&currency=USD

Transfer 5.67 $ from the user 1 to the account.

https://api.voximplant.com/platform_api/TransferMoneyToUser/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&user_id=1&amount=-5.67&currency=USD

Transfer the all money from the user 1 to the parent account.

https://api.voximplant.com/platform_api/TransferMoneyToUser/?account_id=1&api_key=eec36d6c-a0eb-46b5-a006-1c2b65343bac&user_id=1&amount=-10000000&strict_mode=false

response:

Success

{
    "result": 1,
    "balance": 105.8977
}