Enables one to retrieve the conversation based pricing analytics data for this WhatsApp Business Account
Requirements
whatsapp_business_management permission
whatsapp_business_messaging permission
public_profile permission
WHATSAPP BUSINESS ACCOUNT ID
USER ACCESS TOKEN
Request
Formatted for readability.
curl -i -X GET \
"https://graph.facebook.com/LATEST-VERSION/WHATSAPP-BUSINESS-ACCOUNT-ID?fields=conversation_analytics.start(1651698000).end(1652302800).granularity(DAILY).phone_numbers(PHONE-NUMBER).country_codes().metric_types().conversation_types().conversation_directions().dimensions(CONVERSATION_DIRECTIONCONVERSATION_TYPECOUNTRYPHONE)&
access_token=USER-ACCESS-TOKEN"
Response
{ "conversation_analytics": { "data": [ { "data_points": [ { "start": 1651698000, "end": 1651784400, "conversation": 281, "phone_number": "PHONE-NUMBER", "country": "US", "conversation_type": "FREE_TIER", "conversation_direction": "BUSINESS_INITIATED", "cost": 0 }, { "start": 1652130000, "end": 1652216400, "conversation": 631, "phone_number": "PHONE-NUMBER", "country": "US", "conversation_type": "FREE_TIER", "conversation_direction": "BUSINESS_INITIATED", "cost": 0 } ] } ] }, "id": "WHATSAPP-BUSINESS-ACCOUNT-ID" }
參數 | 描述 |
---|---|
conversation_categories array<enum {MARKETING, UTILITY, AUTHENTICATION, SERVICE, AUTHENTICATION_INTERNATIONAL, MARKETING_LITE}> | 預設值: [] list of conversation categories |
conversation_directions array<enum {UNKNOWN, BUSINESS_INITIATED, USER_INITIATED}> | 預設值: [] list of conversation directions |
conversation_types array<enum {UNKNOWN, REGULAR, FREE_ENTRY_POINT, FREE_TIER}> | 預設值: [] list of conversation types |
country_codes array<string> | 預設值: [] list of country codes |
dimensions array<enum {UNKNOWN, PHONE, COUNTRY, CONVERSATION_TYPE, CONVERSATION_DIRECTION, CONVERSATION_CATEGORY}> | 預設值: [] list of breakdown dimensions |
end int64 | end time 必填 |
granularity enum {HALF_HOUR, DAILY, MONTHLY} | data granularity 必填 |
metric_types array<enum {UNKNOWN, CONVERSATION, COST}> | 預設值: [] list of metric types |
phone_numbers array<string> | 預設值: [] list of phone numbers |
start int64 | start time 必填 |
由此關係連線進行的閱讀將回傳 JSON 格式結果:
{ "
data
": [], "paging
": {} }
data
paging
錯誤 | 說明 |
---|---|
200008 | WhatsApp Business Account has no linked phone numbers. |
100 | Invalid parameter |