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 role and access level of the manager, which determine the availability of a method.
- 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-Token | header | string | Required | API token of a manager that performs the operation (see Viewing and updating manager's information) |
Content-Type | header | string | Required | Media type of the request. Specify the following: application/vnd.api+json |
Accept | header | string | Required | Supported media types of the answer. Specify the following: application/vnd.api+json |
base_url | path | string | Required | ActivePlatform URL |
reseller_id | path | integer | Required | ID of the current reseller or any of its downstream resellers (see Viewing and updating reseller general information) |
Response model
Name | Data type | Description | |||
---|---|---|---|---|---|
account_types | array of objects | List of account types with the account attributes | |||
id | integer | Account type ID (см. Типы клиентов) | |||
key | string | Account type key | |||
name | string | Account type name | |||
attributes | array of objects | List of account attributes for the specified account type A required attribute with | |||
name | string | Attribute name | |||
key | string | Attribute key | |||
optional | bool | Indicates whether the attribute is optional:
| |||
type | string | Data type of the attribute:
| |||
default_value | string | Attribute default value. For custom attributes with the list data type, returns the default key value | |||
available_values | array | 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_attribute | bool | Indicates whether the attribute is custom:
| |||
client_readonly | bool | Indicates whether the custom attribute is read-only for an account:
Included in the response for custom attributes only | |||
admin_readonly | bool | Indicates whether the custom attribute is read-only for a manager:
Included in the response for custom attributes only | |||
custom_attribute_category_id | integer | Attribute category ID of the custom attribute. Included in the response for custom attributes only | |||
format | string | Regular 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": [...
]
}
]
}