图谱 API 版

WhatsApp Business Account Analytics

Represents analytics information about a specific WhatsApp Business Account (WABA).

对话导向型定价已更改。请参阅定价,了解我们的新对话导向型定价模式如何运作。

此外,自 2023 年 7 月 1 日起,开发者可访问 metric_types。详情请参阅“对话分析”表

读取

WhatsApp Business Account (WABA) Analytics

Example

Requirements

  • whatsapp_business_management permission

  • whatsapp_business_messaging permission

  • public_profile permission

  • WhatsApp Business Account (WABA) ID

  • USER ACCESS TOKEN

Request

curl -i -X GET \
"https://graph.facebook.com/LATEST-VERSION/WHATSAPP-BUSINESS-ACCOUNT-ID?fields=analytics.start(1641024000).end(1651094880).granularity(DAY)&
access_token=USER-ACCESS-TOKEN"
GraphRequest request = GraphRequest.newGraphPathRequest(
  accessToken,
  "/WHATSAPP-BUSINESS-ACCOUNT-ID",
  new GraphRequest.Callback() {
    @Override
    public void onCompleted(GraphResponse response) {
      // Insert your code here
    }
});

Bundle parameters = new Bundle();
parameters.putString("fields", "analytics.start(1641024000).end(1651094880).granularity(DAY)");
request.setParameters(parameters);
request.executeAsync();
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
    initWithGraphPath:@"/WHATSAPP-BUSINESS-ACCOUNT-ID"
           parameters:@{ @"fields": @"analytics.start(1641024000).end(1651094880).granularity(DAY)",}
           HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
    // Insert your code here
}];

Response

{
  "analytics": {
    "phone_numbers": [
      "PHONE-NUMBER"
    ],
    "granularity": "DAY",
    "data_points": [
      {
        "start": 1647327600,
        "end": 1647414000,
        "sent": 1,
        "delivered": 1
      },
      {
        "start": 1648710000,
        "end": 1648796400,
        "sent": 4,
        "delivered": 4
      },
      {
        "start": 1648796400,
        "end": 1648882800,
        "sent": 1,
        "delivered": 1
      },
      {
        "start": 1650265200,
        "end": 1650351600,
        "sent": 1,
        "delivered": 1
      },
      {
        "start": 1650351600,
        "end": 1650438000,
        "sent": 1,
        "delivered": 1
      }
    ]
  },
  "id": "WHATSAPP-BUSINESS-ACCOUNT-ID"
}

参数

这个端点不包含任何参数。

字段

字段描述
country_codes
list<string>

List of ISO 3166 country codes (e.g. US, IN)

data_points

List of analytics data points (e.g. {start: 0, end: 10000, sent: 10, delivered: 9})

granularity
string

Granularity of data (options are half_hour, day, month)

phone_numbers
list<numeric string>

List of WhatsApp normalized phone numbers (e.g. [16315551000])

创建

你无法在此端点执行该操作。

更新

你无法在此端点执行该操作。

删除

你无法在此端点执行该操作。