Add analytic attribute value for an entity
Learn how to add analytic attribute values to an entity.
This API operation enables you to add an analytic attribute.
Request
POST {{tenantURL}}/entities/118mtgD8/_analyticsAttributes
Parameter | Required | Description | |
---|---|---|---|
Headers | Authorization
| Yes | Information about authentication access token in the format "Bearer <accessToken> ". For more information, see Authentication API. |
Query | returnObjects | No | Denotes if the response must contain created entities. This field defaults to true . |
Body | Yes | JSON object specifying the different analytic attributes. |
Response
An array with results for each element of a request, which will contain the following properties:
-
index - The index of the entity object in JSON array of entities to be created. This is mandatory.
-
uri - The URI of the entity object that is created. This is returned only if the object is successfully created.
-
object - The entity object that is updated. This parameter is returned only if the
returnObjects
query parameter in the request istrue
and the object was successfully created.Note: By default, hidden attributes are not included in the response. To include hidden attributes, add the options=sendHidden parameter in the request. -
error - The details of the error when the object is not created, which can be one of the following:
warning
- if the object is created but with some problems.status
- result of the operation, which can be OK or failed.
Example - Request
POST {TenantURL}/entities/10/_analyticsAttributes
Headers: Authorization: Bearer 204938ca-2cf7-44b0-b11a-1b4c59984512, Content-Type: application/json
Body:
{
"attribute1":{
"value":"1.7"
},
"attribute2":{
"value":"2.8"
}
}
Response
{
"index": 0,
"uri": "entities/10",
"object": {
"uri": "entities/10",
"type": "configuration/entityTypes/Employee",
"tags": [
"sport",
"movies"
],
"analyticsAttributes": {
"Tenure1": [
{
"type": "configuration/entityTypes/Employee/analyticsAttributes/attribute1",
"value": "2.8",
"uri": "entities/10/analyticsAttributes/attribute1/0"
}
],
"Tenure": [
{
"type": "configuration/entityTypes/Employee/analyticsAttributes/attribute2",
"value": "1.7",
"uri": "entities/10/analyticsAttributes/attribute2/0"
}
]
},
},
"status": "OK"
}