# Statistics

# Conversations

# New conversation distribution

Analyze amount of new conversations distributed per hour for whole week.





 
 
 
 

 
 
 
 












POST https://api.smartsupp.com/v2/statistics
{
  "my_data": {
    "name": "new_conversation",
    "range": {
      "from": "2021-12-19T00:00:00",
      "to": "2022-01-19T23:59:59"
    },
    "aggs": [
      {
        "type": "terms",
        "field": "group_id"
      },
      {
        "type": "date",
        "interval": "day_of_week"
      },
      {
        "type": "date",
        "interval": "hour_of_day"
      }
    ]
  }
}
  • field aggregation by group_id can be used to split data by groups
  • property range to filter only specific internal

# New conversation distribution with query

Similar to previous example, but now you analyze every group separately.









 
 
 
 

















 
 
 
 













POST https://api.smartsupp.com/v2/statistics
{
  "my_group_id_1": {
    "name": "new_conversation",
    "range": {
      "from": "2021-12-19T00:00:00",
      "to": "2022-01-19T23:59:59"
    },
    "query": [{
      "field": "group_id",
      "value": "my_group_id_1"
    }],
    "aggs": [
      {
        "type": "date",
        "interval": "day_of_week"
      },
      {
        "type": "date",
        "interval": "hour_of_day"
      }
    ]
  },
  "my_group_id_2": {
    "name": "new_conversation",
    "range": {
      "from": "2021-12-19T00:00:00",
      "to": "2022-01-19T23:59:59"
    },
    "query": [{
      "field": "group_id",
      "value": "my_group_id_2"
    }],
    "aggs": [
      {
        "type": "date",
        "interval": "day_of_week"
      },
      {
        "type": "date",
        "interval": "hour_of_day"
      }
    ]
  }
}
  • property query is used to filter only specific group