Get list of account attributes

The Get list of account attributes method returns the list of all attributes applied to an account of the current reseller or any of its downstream resellers.

The list includes the following attributes for every account type:

  • System attributes available in the platform by default for creating a new account.
  • Additional (custom) attributes that can be added to the account entity (see Creating an Attribute).

An API token of a manager is required for authorization. To get an API token via the Operator Control Panel, see Viewing and updating Manager's information

The manager's API token specified in an API request determines the current reseller and downstream resellers accessible within a method.

GET {base_url}/api/v3/resellers/{reseller_id}/account_attributes

Arguments

Name

Parameter type

Data type

Required/Optional

Description

X-Api-TokenheaderstringRequiredAPI token of a manager that performs the operation (see Viewing and updating Manager's information)
Content-TypeheaderstringRequiredMedia type of the request. Specify the following: application/vnd.api+json
AcceptheaderstringRequired

Supported media types of the answer. Specify the following: application/vnd.api+json

base_urlpathstringRequiredActivePlatform URL
reseller_idpathintegerRequiredID of the current reseller or any of its downstream resellers (see Viewing and updating Reseller general information)

Response model

NameData typeDescription
account_typesarray of objectsList of account types with the account attributes

idintegerAccount type ID (см. Account Types)

keystringAccount type key

namestringAccount type name

attributesarray of objects

List of account attributes for the specified account type

A required attribute with key = agreement_terms_conditions is included in the response if only the Request agreement with Terms and Conditions option is selected in the system settings (see General system settings)



namestringAttribute name


keystringAttribute key


optionalbool

Indicates whether the attribute is optional:

  • true — the attribute is optional.
  • false — the attribute is required.


typestring

Data type of the attribute:

  • string
  • text
  • checkbox
  • date
  • password
  • list


default_valuestringAttribute default value. For custom attributes with the list data type, returns the default key value


available_valuesarray

List of available values of the attribute (for example, IDs, country codes). For custom attributes with the list data type, returns pairs of the key and name values



is_custom_attributebool

Indicates whether the attribute is custom:

  • true — the attribute is custom (see Managing Attributes).
  • false — the attribute is system.


client_readonlybool

Indicates whether the custom attribute is read-only for an account:

  • true — the custom attribute is read-only for an account.
  • false — the custom attribute can be edited by an account.

Included in the response for custom attributes only



admin_readonlybool

Indicates whether the custom attribute is read-only for a manager:

  • true — the custom attribute is read-only for a manager.
  • false — the custom attribute can be edited by a manager.

Included in the response for custom attributes only



custom_attribute_category_idintegerAttribute category ID of the custom attribute. Included in the response for custom attributes only


formatstringRegular expression for the customer attribute validation. Included in the response for custom attributes only

Request example

GET /api/v3/resellers/1/account_attributes
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetest3gJXZH5uHCw
Accept: application/vnd.api+json

Response example

{
    "account_types": [
        {
            "id": 1,
            "key": "business",
            "name": "business",			
            "attributes": [
                {
                    "name": "Agreement with Terms and Conditions",
                    "key": "agreement_terms_conditions",
                    "optional": false,
                    "type": "checkbox",
                    "default_value": null,
                    "available_values": [],
                    "is_custom_attribute": false
                },			
                {
                    "name": "Manager",
                    "key": "manager_id",
                    "optional": true,
                    "type": "list",
                    "default_value": null,
                    "available_values": [
                        188,
                        296,
                        261
                    ],
                    "is_custom_attribute": false
                },
                {
                    "name": "Account class",
                    "key": "account_class_key",
                    "optional": false,
                    "type": "list",
                    "default_value": null,
                    "available_values": [
                        "default",
                        "prepay",
                        "postpay"
                    ],
                    "is_custom_attribute": false
                },
                {
                    "name": "First name",
                    "key": "first_name",
                    "optional": false,
                    "type": "string",
                    "default_value": null,
                    "available_values": [],
                    "is_custom_attribute": false
                },
                {
                    "name": "Last name",
                    "key": "last_name",
                    "optional": false,
                    "type": "string",
                    "default_value": null,
                    "available_values": [],
                    "is_custom_attribute": false
                },
                {
                    "name": "Middle name",
                    "key": "middle_name",
                    "optional": true,
                    "type": "string",
                    "default_value": null,
                    "available_values": [],
                    "is_custom_attribute": false
                },
                {
                    "name": "Email",
                    "key": "email",
                    "optional": false,
                    "type": "email",
                    "default_value": null,
                    "available_values": [],
                    "is_custom_attribute": false
                },
                {
                    "name": "Country",
                    "key": "country",
                    "optional": false,
                    "type": "list",
                    "default_value": "RU",
                    "available_values": [
                        "BY",
                        "RU"
                    ],
                    "is_custom_attribute": false
                },
                {
                    "name": "Region",
                    "key": "region",
                    "optional": false,
                    "type": "string",
                    "default_value": null,
                    "available_values": [],
                    "is_custom_attribute": false
                },
                {
                    "name": "City",
                    "key": "city",
                    "optional": false,
                    "type": "string",
                    "default_value": null,
                    "available_values": [],
                    "is_custom_attribute": false
                },
                {
                    "name": "Street",
                    "key": "street",
                    "optional": false,
                    "type": "string",
                    "default_value": null,
                    "available_values": [],
                    "is_custom_attribute": false
                },
                {
                    "name": "Building",
                    "key": "building",
                    "optional": true,
                    "type": "string",
                    "default_value": null,
                    "available_values": [],
                    "is_custom_attribute": false
                },
                {
                    "name": "Office",
                    "key": "office",
                    "optional": true,
                    "type": "string",
                    "default_value": null,
                    "available_values": [],
                    "is_custom_attribute": false
                },
                {
                    "name": "Zip",
                    "key": "zip",
                    "optional": false,
                    "type": "string",
                    "default_value": null,
                    "available_values": [],
                    "is_custom_attribute": false
                },
                {
                    "name": "Phone",
                    "key": "phone",
                    "optional": false,
                    "type": "phone",
                    "default_value": null,
                    "available_values": [],
                    "is_custom_attribute": false
                },
                {
                    "name": "Contact person's ID",
                    "key": "new_owner_id",
                    "optional": true,
                    "type": "list",
                    "default_value": null,
                    "available_values": [
                        990,
                        991,
                        992
                    ],
                    "is_custom_attribute": false
                },
                {
                    "name": "Contact person's first name",
                    "key": "new_owner_first_name",
                    "optional": false,
                    "type": "string",
                    "default_value": null,
                    "available_values": [],
                    "is_custom_attribute": false
                },
                {
                    "name": "Contact person's last name",
                    "key": "new_owner_last_name",
                    "optional": false,
                    "type": "string",
                    "default_value": null,
                    "available_values": [],
                    "is_custom_attribute": false
                },
                {
                    "name": "Contact person's middle name",
                    "key": "new_owner_middle_name",
                    "optional": true,
                    "type": "string",
                    "default_value": null,
                    "available_values": [],
                    "is_custom_attribute": false
                },
                {
                    "name": "Contact person's email",
                    "key": "new_owner_email",
                    "optional": false,
                    "type": "email",
                    "default_value": null,
                    "available_values": [],
                    "is_custom_attribute": false
                },
                {
                    "name": "Tenant Name",
                    "key": "tenantname",
                    "optional": true,
                    "type": "text",
                    "default_value": "",
                    "available_values": [],
                    "is_custom_attribute": true,
                    "client_readonly": false,
                    "admin_readonly": false,
                    "custom_attribute_category_id": null,
                    "format": null
                },
                {
                    "name": "Tenant ID",
                    "key": "tenantID",
                    "optional": true,
                    "type": "string",
                    "default_value": "",
                    "available_values": [],
                    "is_custom_attribute": true,
                    "client_readonly": true,
                    "admin_readonly": true,
                    "custom_attribute_category_id": 2,
                    "format": ""
                },
                {
                    "name": "E-mail подписанта",
                    "key": "signer_email",
                    "optional": true,
                    "type": "string",
                    "default_value": "",
                    "available_values": [],
                    "is_custom_attribute": true,
                    "client_readonly": false,
                    "admin_readonly": false,
                    "custom_attribute_category_id": null,
                    "format": ""
                },
                {
                    "name": "AccountPassword",
                    "key": "AccountPassword",
                    "optional": true,
                    "type": "password",
                    "default_value": "",
                    "available_values": [],
                    "is_custom_attribute": true,
                    "client_readonly": false,
                    "admin_readonly": false,
                    "custom_attribute_category_id": null,
                    "format": ""
                },
                {
                    "name": "AccountCheckbox",
                    "key": "AccountCheckbox",
                    "optional": true,
                    "type": "checkbox",
                    "default_value": "",
                    "available_values": [
                        1,
                        0
                    ],
                    "is_custom_attribute": true,
                    "client_readonly": false,
                    "admin_readonly": false,
                    "custom_attribute_category_id": null,
                    "format": ""
                },
                {
                    "name": "AccountList",
                    "key": "AccountList",
                    "optional": true,
                    "type": "list",
                    "default_value": "value_1",
                    "available_values": [
                        {
                            "key": "value_1",
                            "name": "v1"
                        },
                        {
                            "key": "value_2",
                            "name": "v2"
                        }
                    ],
                    "is_custom_attribute": true,
                    "client_readonly": false,
                    "admin_readonly": false,
                    "custom_attribute_category_id": null,
                    "format": null
                }
            ]
        },
        {
            "id": 2,
            "key": "business_vat",
            "name": "business vat",			
            "attributes": [...
			]
		}
    ]
}

Отзыв | Feedback