API Cloud (METRICS)
Las plantillas pueden analizarse obteniendo datos importantes como el número de mensajes enviados desde un número de teléfono de empresa, el número de conversaciones y su coste para una cuenta de WhatsApp Business (WABA) o el número de veces que se ha leído una plantilla determinada.
La variable VERSION se debe expresar con la letra ‘v’ y sus valores serán: v16.0, v17.0, v18.0, v19.0
METRICS Análisis de mensajería
Path:
GET /metrics/VERSION/{did}?fields=analytics.start(1543543200).end(1544148000).granularity(DAY)
Response
Status Code 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"
}
METRICS Análisis de conversaciones
Path:
GET /metrics/VERSION/{did}?fields=conversation_analytics.start(1685602800).end(1688194800) .granularity(MONTHLY).phone_numbers([]).dimensions([“CONVERSATION_CATEGORY”,“CONVERSATION_TYPE”,“COUNTRY”,“PHONE”])
Response
Status Code 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_category": "MARKETING",
"cost": 26.36
},
{
"start": 1685602800,
"end": 1688194800,
"conversation": 2238,
"phone_number": "15550458206",
"country": "US",
"conversation_type": "REGULAR",
"conversation_category": "SERVICE",
"cost": 22.38
}
]
}
]
},
"id": "102290129340398"
}
METRICS Análisis de conversaciones
Path:
GET /metrics/VERSION/{did}?fields=conversation_analytics.start(1643702400).end(1646121600).granularity(MONTHLY).phone_numbers([]).dimensions([CONVERSATION_TYPE])
Response
Status Code 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_category": "MARKETING",
"cost": 26.36
},
{
"start": 1685602800,
"end": 1688194800,
"conversation": 2238,
"phone_number": "15550458206",
"country": "US",
"conversation_type": "REGULAR",
"conversation_category": "SERVICE",
"cost": 22.38
}
]
}
]
},
"id": "102290129340398"
}
METRICS Análisis de conversaciones
Path:
GET /metrics/VERSION/{did}?fields=conversation_analytics.start(1685527200).end(1685613600).granularity(HALF_HOUR).conversation_categories([“MARKETING”,“AUTHENTICATION”]).dimensions([“CONVERSATION_CATEGORY”])
Response
Status Code 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_category": "MARKETING",
"cost": 26.36
},
{
"start": 1685602800,
"end": 1688194800,
"conversation": 2238,
"phone_number": "15550458206",
"country": "US",
"conversation_type": "REGULAR",
"conversation_category": "SERVICE",
"cost": 22.38
}
]
}
]
},
"id": "102290129340398"
}
METRICS Análisis de conversaciones
Path:
GET /metrics/VERSION/{did}?fields=conversation_analytics.start(1685527200).end(1685613600).granularity(HALF_HOUR).conversation_categories([“MARKETING”,“AUTHENTICATION”]).dimensions([“CONVERSATION_CATEGORY”,“CONVERSATION_TYPE”])
Response
Status Code 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_category": "MARKETING",
"cost": 26.36
},
{
"start": 1685602800,
"end": 1688194800,
"conversation": 2238,
"phone_number": "15550458206",
"country": "US",
"conversation_type": "REGULAR",
"conversation_category": "SERVICE",
"cost": 22.38
}
]
}
]
},
"id": "102290129340398"
}