Creating attributes
Creates attributes of customers and orders. When creating custom attributes, don't use the IDs of system attributes. You can get the list of IDs of system attributes using the GET /cdp/api/v1/counter/{counterId}/schema/attributes method.
Sample request body
--data '{
"attributes": [
{
"name": "dates_of_meetings",
"type_name": "date",
"multivalued": true,
"humanized": "Даты обращений в магазин"
},
{
"name": "age",
"type_name": "numeric",
"multivalued": false,
"humanized": "Возраст"
},
{
"name": "first_seen",
"type_name": "date",
"multivalued": false,
"humanized": "Первый заказ"
}
]
}'
Request
POST
https://api-metrika.yandex.net/cdp/api/v1/counter/{counterId}/schema/attributes
Path parameters
Name |
Description |
counterId* |
Type: integer<int32> Counter ID. |
Query parameters
Name |
Description |
entity_type* |
Type: string Attribute ownership.
|
Body
application/json
{
"attributes": [
{
"name": "string",
"type_name": "string",
"type_group": "string",
"type_humanized": "string",
"multivalued": false,
"humanized": "string"
}
]
}
Name |
Description |
attributes* |
Type: Attribute[] List attributes. |
Attribute
Description of the Attribute
object.
Name |
Description |
multivalued* |
Type: boolean Determines whether the attribute can have multiple values. |
name* |
Type: string Attribute ID. Min length: Max length: Pattern: |
humanized |
Type: string Attribute name. Min length: Max length: |
type_group |
Type: string Attribute type group. Possible values:
|
type_humanized |
Type: string Attribute type name. |
type_name |
Type: string Attribute type ID. |
Responses
200 OK
OK
Body
application/json
{
"success": true
}
Name |
Description |
success |
Type: boolean Result of performing the action. Default: |
No longer supported, please use an alternative and newer version.