Creating attributes
Creates attributes of customers and orders When creating custom attributes, don't use the IDs of system attributes. To get the list of IDs of system attributes, use the method GET /cdp/api/v1/counter/{counterId}/schema/attributes.
Request syntax
counterId
: Tag ID.
https://api-metrika.yandex.net/cdp/api/v1/counter/{counterId}/schema/attributes
? entity_type=<system_entity_namespace>
entity_type * | Attribute ownership. Acceptable values:
|
entity_type * | Attribute ownership. Acceptable values:
|
* Required
In the request body
--data '{
"attributes": [
{
"name": "dates_of_meetings",
"type_name": "date",
"multivalued": true,
"humanized": "Dates of contacts with the shop"
},
{
"name": "age",
"type_name": "numeric",
"multivalued": false,
"humanized": "Age"
},
{
"name": "first_seen",
"type_name": "date",
"multivalued": false,
"humanized": "First order"
}
]
}'
Parameters | Description |
---|---|
attributes | List of attributes. |
attributes | |
name | Attribute ID. |
type_name | Attribute type ID. |
type_group | Group of this attribute type. Can be calculated automatically based on the type_name field value. Case insensitive.Possible values:
|
multivalued | Determines whether the attribute can have multiple values. |
humanized | Attribute name. |
Parameters | Description |
---|---|
attributes | List of attributes. |
attributes | |
name | Attribute ID. |
type_name | Attribute type ID. |
type_group | Group of this attribute type. Can be calculated automatically based on the type_name field value. Case insensitive.Possible values:
|
multivalued | Determines whether the attribute can have multiple values. |
humanized | Attribute name. |
Sample request
POST https://api-metrika.yandex.net/cdp/api/v1/counter/{counterId}/schema/attributes?entity_type=CONTACT
Response format
{
"success" : < boolean >
}
Parameters | Description |
---|---|
success | Result of performing the action. |
Parameters | Description |
---|---|
success | Result of performing the action. |