SIGN UP

Role System

Methods

AddSubUser

Creates a subuser.

Parameters

  • Follow link for authentication parameter names and details.

  • new_subuser_name:

    string

    Login of a new subuser, should be unique within the Voximplant account. The login specified is always converted to lowercase.

  • new_subuser_password:

    string

    Password of a new subuser, plain text.

  • role_id:

    intlist
    OPTIONAL

    The role id list separated by the ';' symbol.

  • role_name:

    stringlist
    OPTIONAL

    The role name list separated by the ';' symbol.

  • description:

    string
    OPTIONAL

    Description of a new subuser.

Returns

Examples

request:

Create a new subuser for account_id = 1

https://api.voximplant.com/platform_api/AddSubUser/?account_id=1&api_key=eec70d6c-a1eb-60b5-a106-2c2b65403bac&new_subuser_name=test_login&new_subuser_password=test_pass

response:

{
    "result": {
        "subuser_id": 109
    }
}

CreateKey

Creates a public/private key pair. You can optionally specify one or more roles for the key, see this article for details.

Parameters

  • Follow link for authentication parameter names and details.

  • description:

    string
    OPTIONAL

    The key's description.

  • role_id:

    intlist
    OPTIONAL

    The role ID list separated by the ';' symbol. Use it instead of role_name, but not combine with.

  • role_name:

    stringlist
    OPTIONAL

    The role name list separated by the ';' symbol. Use it instead of role_id, but not combine with.

Returns

Examples

request:

Create a key pair.

https://api.voximplant.com/platform_api/CreateKey/?account_id=1&api_key=eec30d6c-a0eb-46b5-a006-1c2b65343bac

response:

{
    "result": {
        "key_id": "ab80c76e-573e-4346-9af9-115269dfafca",
        "account_id": 9606,
        "private_key": "key in the .pem format",
        "account_email": "user@voximplant.com"
    }
}

DelSubUser

Deletes a subuser.

Parameters

  • Follow link for authentication parameter names and details.

  • subuser_id:

    number

    The subuser's ID.

Returns

  • result:

    number

Examples

request:

Delete the subuser with id = 12 from account_id = 1

https://api.voximplant.com/platform_api/DeleteSubUser/?account_id=1&api_key=eec76d6c-a0eb-16b5-a206-9c2b65343bac&subuser_id=12

response:

{
    "result": 1
}

DeleteKey

Deletes the specified key.

Parameters

  • Follow link for authentication parameter names and details.

  • key_id:

    string

    The key's ID.

Returns

  • result:

    number

Examples

request:

https://api.voximplant.com/platform_api/DeleteKey/?account_id=1&api_key=eec30d6c-a1eb-64b5-a006-1c2b65343bac&key_id=ab81c66e-570e-4446-9af9-105269dfafca

response:

{
    "result": 1
}

GetKeyRoles

Gets roles of the specified key.

Parameters

  • Follow link for authentication parameter names and details.

  • key_id:

    string

    The key's ID.

Returns

Examples

request:

Get roles of the key.

https://api.voximplant.com/platform_api/GetKeyRoles/?account_id=1&api_key=eec63d6c-a0eb-46b5-a006-1c2b65343bac&key_id=ab81c50e-573e-4446-9af9-105269dfafca

response:

{
    "result": [
        {
            "role_id": 3,
            "gui_only": true,
            "inherited": true,
            "role_name": "Support",
            "parent_role_id": [
                1,
                2
            ]
        },
        {
            "role_id": 7,
            "gui_only": true,
            "inherited": false,
            "role_name": "Accountant",
            "parent_role_id": []
        },
        {
            "role_id": 14,
            "gui_only": false,
            "inherited": false,
            "role_name": "TestRole",
            "parent_role_id": []
        }
    ]
}

GetKeys

Gets key info of the specified account.

Parameters

  • Follow link for authentication parameter names and details.

  • key_id:

    string
    OPTIONAL

    The key's ID.

  • with_roles:

    boolean
    OPTIONAL

    Show roles for the key.

  • offset:

    number
    OPTIONAL

    The first N records will be skipped in the output.

  • count:

    number
    OPTIONAL

    The max returning record count.

Returns

Examples

request:

Get keys info of the specified account.

https://api.voximplant.com/platform_api/GetKeys/?account_id=1&api_key=eec30d6c-a1eb-48b5-a006-1c2b65343bac

response:

{
    "count": 3,
    "result": [
        {
            "roles": [
                {
                    "role_id": 7,
                    "role_name": "Accountant"
                },
                {
                    "role_id": 3,
                    "role_name": "Support"
                },
                {
                    "role_id": 14,
                    "role_name": "TestRole"
                }
            ],
            "key_id": "8fef2dfc-500d-4923-847d-28062d6dad16",
            "description": null
        },
        {
            "roles": [],
            "key_id": "fae19af6-9960-4091-a7fe-a8b88c15aaec",
            "subuser": {
                "subuser_id": 276,
                "subuser_name": "tt"
            },
            "description": null
        },
        {
            "roles": [],
            "key_id": "6fb5e821-3760-4373-9610-f0694fa326e8",
            "description": null
        }
    ],
    "total count": 3
}

GetRoleGroups

Gets role groups

Parameters

Returns

Examples

request:

Get all role groups.

https://api.voximplant.com/platform_api/GetRoleGroups/?account_id=1&api_key=eec36d6c-a2eb-46b5-a126-1c2b67343bac

response:

{
    "result": [
        {
            "id": 2,
            "name": "test_group"
        },
        {
            "id": 3,
            "name": "test_group1"
        }
    ]
}

GetRoles

Gets all roles.

Parameters

  • Follow link for authentication parameter names and details.

  • group_name:

    string
    OPTIONAL

    The role group.

Returns

Examples

request:

Get all roles.

https://api.voximplant.com/platform_api/GetRoles/?account_id=1&api_key=eec36d6c-a2eb-46b5-a126-1c2b67343bac

response:

{
    "result": [
        {
            "name": "role5",
            "role_id": 5,
            "gui_only": false
        },
        {
            "name": "role7",
            "role_id": 7,
            "gui_only": true
        }
    ]
}

GetSubUserRoles

Gets the subuser's roles.

Parameters

  • Follow link for authentication parameter names and details.

  • subuser_id:

    number

    The subuser's ID.

  • with_expanded_roles:

    boolean
    OPTIONAL

    Show expanded roles

Returns

Examples

request:

Get subuser's roles.

https://api.voximplant.com/platform_api/GetSubUserRoles/?account_id=1&api_key=eec36d6c-a2eb-46b5-a126-1c2b67343bac&subuser_id=12

response:

{
    "result": [
        {
            "role_id": 3,
            "gui_only": true,
            "inherited": true,
            "role_name": "Support",
            "parent_role_id": [
                1,
                2
            ]
        },
        {
            "role_id": 7,
            "gui_only": true,
            "inherited": false,
            "role_name": "Accountant",
            "parent_role_id": []
        },
        {
            "role_id": 14,
            "gui_only": false,
            "inherited": false,
            "role_name": "TestRole",
            "parent_role_id": []
        }
    ]
}

GetSubUsers

Gets subusers.

Parameters

  • Follow link for authentication parameter names and details.

  • subuser_id:

    number
    OPTIONAL

    The subuser's ID.

  • with_roles:

    boolean
    OPTIONAL

    Show subuser's roles

  • offset:

    number
    OPTIONAL

    The first N records will be skipped in the output.

  • count:

    number
    OPTIONAL

    The max returning record count.

Returns

Examples

request:

Get subusers info

https://api.voximplant.com/platform_api/GetSubUsers/?account_id=1&api_key=eec36d6c-a0eb-89b5-a106-1c2b65343bac

response:

{
    "count": 4,
    "result": [
        {
            "login": "test_login3",
            "roles": [],
            "subuser_id": 104,
            "description": null
        },
        {
            "login": "test_login_2",
            "roles": [
                {
                    "name": "UserManager",
                    "role_id": 8
                }
            ],
            "subuser_id": 57,
            "description": "dd2"
        },
        {
            "login": "test_login5",
            "roles": [],
            "subuser_id": 105,
            "description": null
        },
        {
            "login": "test_login4",
            "roles": [],
            "subuser_id": 59,
            "description": null
        }
    ],
    "total count": 4
}

RemoveKeyRoles

Removes the specified roles of a key.

Parameters

  • Follow link for authentication parameter names and details.

  • key_id:

    string

    The key's ID.

  • role_id:

    intlist

    The role id list separated by the ';' symbol.

  • role_name:

    stringlist

    The role name list separated by the ';' symbol.

Returns

  • result:

    number

Examples

request:

Remove the roles 1, 2, 3 from the key.

https://api.voximplant.com/platform_api/RemoveKeyRoles/?account_id=1&api_key=eec49d6c-a0eb-46b5-a006-1c2b65343bac&key_id=ab81c90e-543e-4446-9af9-105269dfafca&role_id=1;2;3

response:

{
    "result": 1
}

RemoveSubUserRoles

Removes the specified roles of a subuser.

Parameters

  • Follow link for authentication parameter names and details.

  • subuser_id:

    number

    The subuser's ID.

  • role_id:

    intlist

    The role id list separated by the ';' symbol.

  • role_name:

    stringlist

    The role name list separated by the ';' symbol.

  • force:

    boolean
    OPTIONAL

    Remove roles from all subuser keys.

Returns

  • result:

    number

Examples

request:

Remove roles 1,2,3 from the subuser with id = 12

https://api.voximplant.com/platform_api/RemoveSubUserRoles/?account_id=1&api_key=eec00d6c-a3eb-77b5-a006-1c2b65343bac&subuser_id=12&role_id=1;2;3

response:

{
    "result": 1
}

SetKeyRoles

Set roles for the specified key.

Parameters

  • Follow link for authentication parameter names and details.

  • key_id:

    string

    The key's ID.

  • role_id:

    intlist

    The role id list separated by the ';' symbol.

  • role_name:

    stringlist

    The role name list separated by the ';' symbol.

Returns

  • result:

    number

Examples

request:

Set roles 1, 2, 3 for the key.

https://api.voximplant.com/platform_api/SetKeyRoles/?account_id=1&api_key=eec36d6c-a0eb-49b5-a006-1c2b65343bac&key_id=ab81c76e-573e-4046-9af9-105269dfafca&role_id=1;2;3

response:

{
    "result": 1
}

SetSubUserInfo

Edits a subuser.

Parameters

  • Follow link for authentication parameter names and details.

  • subuser_id:

    number

    The subuser's ID.

  • old_subuser_password:

    string
    OPTIONAL

    The subuser old password. It is required if new_subuser_password is specified.

  • new_subuser_password:

    string
    OPTIONAL

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

  • description:

    string
    OPTIONAL

    The new subuser description.

Returns

  • result:

    number

Examples

request:

Edit the password and description for the subuser with id = 12 from account_id = 1

https://api.voximplant.com/platform_api/SetSubUserInfo/?account_id=1&api_key=eec36d6c-a0eb-46b5-a226-1c2b65343bac&subuser_id=12&old_subuser_password=old_test_password&new_subuser_password=test_pass&description=test_desc

response:

{
    "result": 1
}

SetSubUserRoles

Adds the specified roles for a subuser.

Parameters

  • Follow link for authentication parameter names and details.

  • subuser_id:

    number

    The subuser's ID.

  • role_id:

    intlist

    The role id list separated by the ';' symbol.

  • role_name:

    stringlist

    The role name list separated by the ';' symbol.

Returns

  • result:

    number

Examples

request:

Add the roles 1, 2, 3 to the subuser with id = 12

https://api.voximplant.com/platform_api/SetSubUserRoles/?account_id=1&api_key=eec78d6c-a0eb-49b5-a016-1c2b65343bac&subuser_id=12&role_id=1;2;3

response:

{
    "result": 1
}

UpdateKey

Updates info of the specified key.

Parameters

  • Follow link for authentication parameter names and details.

  • key_id:

    string

    The key's ID

  • description:

    string

    The key's description.

Returns

  • result:

    number

Examples

request:

Create a new subuser for account_id = 1.

https://api.voximplant.com/platform_api/UpdateKey/?account_id=1&api_key=eec36d0c-a1eb-46b5-a006-6c2b65343bac&key_id=ab98c70e-573e-4446-9af9-105269dfafca&description=test_desc

response:

{
    "result": 1
}