Skip to content

API Cloud (METRICS)

Templates can be analyzed by getting important data such as the number of messages sent from a business phone number, the number of conversations and their cost for a WhatsApp Business Account (WABA), or the number of times a given template was read.

The VERSION variable must be expressed with the letter ‘v’: v16.0, v17.0, v18.0, v19.0.

Messaging analytics

Request

GET /metrics/{VERSION}/{did}?fields=analytics.start(1543543200).end(1544148000).granularity(DAY)

curl --request GET \
  --url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/metrics/{VERSION}/{did}?fields=analytics.start(1543543200).end(1544148000).granularity(DAY)' \
  --header 'Authorization: <JWT>'

Response

Success (200)

{
  "analytics": {
    "phone_numbers": [
      "16505550111",
      "16505550112",
      "16505550113"
    ],
    "country_codes": [
      "US",
      "BR"
    ],
    "granularity": "DAY",
    "data_points": [
      {
        "start": 1543543200,
        "end": 1543629600,
        "sent": 196093,
        "delivered": 179715
      },
      {
        "start": 1543629600,
        "end": 1543716000,
        "sent": 147649,
        "delivered": 139032
      }
    ]
  },
  "id": "102290129340398"
}

Conversation analytics

The conversation_analytics field supports multiple combinations of granularity, conversation_categories and dimensions. All variants return the same response structure.

By category, type, country and phone (monthly)

Request

curl --request GET \
  --url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/metrics/{VERSION}/{did}?fields=conversation_analytics.start(1685602800).end(1688194800).granularity(MONTHLY).phone_numbers([]).dimensions(["CONVERSATION_CATEGORY","CONVERSATION_TYPE","COUNTRY","PHONE"])' \
  --header 'Authorization: <JWT>'

Response

Success (200)

{
  "conversation_analytics": {
    "data": [
      {
        "data_points": [
          {
            "start": 1685602800,
            "end": 1688194800,
            "conversation": 1558,
            "phone_number": "15550458206",
            "country": "US",
            "conversation_type": "REGULAR",
            "conversation_direction": "UNKNOWN",
            "conversation_category": "AUTHENTICATION",
            "cost": 15.58
          },
          {
            "start": 1685602800,
            "end": 1688194800,
            "conversation": 2636,
            "phone_number": "15550458206",
            "country": "US",
            "conversation_type": "REGULAR",
            "conversation_direction": "UNKNOWN",
            "conversation_category": "MARKETING",
            "cost": 26.36
          },
          {
            "start": 1685602800,
            "end": 1688194800,
            "conversation": 2238,
            "phone_number": "15550458206",
            "country": "US",
            "conversation_type": "REGULAR",
            "conversation_direction": "UNKNOWN",
            "conversation_category": "SERVICE",
            "cost": 22.38
          }
        ]
      }
    ]
  },
  "id": "102290129340398"
}

By conversation type (monthly)

Request

curl --request GET \
  --url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/metrics/{VERSION}/{did}?fields=conversation_analytics.start(1643702400).end(1646121600).granularity(MONTHLY).phone_numbers([]).dimensions([CONVERSATION_TYPE])' \
  --header 'Authorization: <JWT>'

By category (half-hour granularity)

Request

curl --request GET \
  --url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/metrics/{VERSION}/{did}?fields=conversation_analytics.start(1685527200).end(1685613600).granularity(HALF_HOUR).conversation_categories(["MARKETING","AUTHENTICATION"]).dimensions(["CONVERSATION_CATEGORY"])' \
  --header 'Authorization: <JWT>'

By category and type (half-hour granularity)

Request

curl --request GET \
  --url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/metrics/{VERSION}/{did}?fields=conversation_analytics.start(1685527200).end(1685613600).granularity(HALF_HOUR).conversation_categories(["MARKETING","AUTHENTICATION"]).dimensions(["CONVERSATION_CATEGORY","CONVERSATION_TYPE"])' \
  --header 'Authorization: <JWT>'

Response

Success (200)

All conversation analytics variants return the same response structure as the first example (200).