Exporter les analyses de campagne
/campagnes/séries_de_données
Utilisez cet endpoint pour récupérer quotidiennement une série de diverses statistiques pour une campagne sur la durée.
Les données renvoyées comprennent le nombre de messages envoyés, ouverts, cliqués ou convertis par canal de communication.
Conditions préalables
Pour utiliser cet endpoint, vous aurez besoin d’une clé API avec l’autorisation campaigns.data_series
.
Limite de débit
This endpoint has a rate limit of 50,000 requests per minute.
Paramètres de demande
Paramètre | Requis | Type de données | Description |
---|---|---|---|
campaign_id |
Requis | Chaîne de caractères | Voir l’identifiant API de la campagne. Vous trouverez l’adresse campaign_id pour les campagnes API sur la page Clés API et la page Détails de la campagne dans votre tableau de bord, ou vous pouvez utiliser l’endpoint Liste des campagnes. |
length |
Requis | Entier | Nombre maximum de jours avant ending_at à inclure dans la série renvoyée. Doit être compris entre 1 et 100 (inclus). |
ending_at |
Facultatif | DateTime chaîne (ISO-8601) |
Date à laquelle la série de données doit se terminer. Par défaut, l’heure de la demande. |
Exemple de demande
1
2
curl --location -g --request GET 'https://rest.iad-01.braze.com/campaigns/data_series?campaign_id={{campaign_identifier}}&length=7&ending_at=2020-06-28T23:59:59-5:00' \
--header 'Authorization: Bearer YOUR-REST-API-KEY'
Réponses
Réponse multicanaux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
{
"message": (required, string) the status of the export, returns 'success' when completed without errors,
"data" : [
{
"time" : (string) the date as ISO 8601 date,
"messages" : {
"ios_push" : [
{
"variation_name": (string) the name of the message in the dashboard (eg., "iOS_Push"),
"sent" : (int) the number of sends,
"direct_opens" : (int) the number of direct opens,
"total_opens" : (int) the number of total opens,
"bounces" : (int) the number of bounces,
"body_clicks" : (int) the number of body clicks,
"revenue": (float) the number of dollars of revenue (USD),
"unique_recipients": (int) the number of unique recipients,
"conversions": (int) the number of conversions,
"conversions_by_send_time": (int) the number of conversions attributed to the date the campaign was sent,
"conversions1": (optional, int) the number of conversions for the second conversion event,
"conversions1_by_send_time": (optional, int) the number of conversions for the second conversion event attributed to the date the campaign was sent,
"conversions2": (optional, int) the number of conversions for the third conversion event,
"conversions2_by_send_time": (optional, int) the number of conversions for the third conversion event attributed to the date the campaign was sent,
"conversions3": (optional, int) the number of conversions for the fourth conversion event,
"conversions3_by_send_time": (optional, int) the number of conversions for the fourth conversion event attributed to the date the campaign was sent
"carousel_slide_[NUM]_[TITLE]_click": (optional, int) the number of carousel slide clicks,
"notif_button_[NUM]_[TITLE]_click": (optional, int) the number of notification button clicks
}
],
"android_push" : [
{
"sent" : (int) the number of sends,
"direct_opens" : (int) the number of direct opens,
"total_opens" : (int)the number of total opens,
"bounces" : (int) the number of bounces,
"body_clicks" : (int) the number of body clicks
}
],
"webhook": [
{
"sent": (int) the number of sends,
"errors": (int) the number of errors
}
],
"email" : [
{
"sent": (int) the number of sends,
"opens": (int) the number of opens,
"unique_opens": (int) the number of unique opens,
"clicks": (int) the number of clicks,
"unique_clicks": (int) the number of unique clicks,
"unsubscribes": (int) the number of unsubscribes,
"bounces": (int) the number of bounces,
"delivered": (int) the number of messages delivered,
"reported_spam": (int) the number of messages reported as spam
}
],
"sms" : [
{
"sent": (int) the number of sends,
"sent_to_carrier" : (int) the number of messages sent to the carrier,
"delivered": (int) the number of delivered messages,
"rejected": (int) the number of rejected messages,
"delivery_failed": (int) the number of failed deliveries,
"clicks": (int) the number of clicks on shortened links,
"opt_out" : (int) the number of opt outs,
"help" : (int) the number of help messages received
}
],
"whats_app": [
{
"variation_name": (string) the name of the message in the dashboard,
"variation_api_id": (string) the variation API identifier,
"sent": (int) the number of sends,
"delivered": (int) the number of delivered messages,
"failed": (int) the number of failed deliveries,
"read": (int) the number of opened messages,
"revenue": (float) the number of dollars of revenue (USD),
"unique_recipients": (int) the number of unique recipients,
"conversions": (int) the number of conversions,
"conversions_by_send_time": (int) the number of conversions attributed to the date the campaign was sent,
"conversions1": (optional, int) the number of conversions for the second conversion event,
"conversions1_by_send_time": (optional, int) the number of conversions for the second conversion event attributed to the date the campaign was sent,
"conversions2": (optional, int) the number of conversions for the third conversion event,
"conversions2_by_send_time": (optional, int) the number of conversions for the third conversion event attributed to the date the campaign was sent,
"conversions3": (optional, int) the number of conversions for the fourth conversion event,
"conversions3_by_send_time": (optional, int) the number of conversions for the fourth conversion event attributed to the date the campaign was sent
},
{
"variation_name": (string) the name of the message in the dashboard,
"variation_api_id": (string) the variation API identifier,
"enrolled": (optional, int) the number of enrolled users,
"revenue": (float) the number of dollars of revenue (USD),
"unique_recipients": (int) the number of unique recipients,
"conversions": (int) the number of conversions,
"conversions_by_send_time": (int) the number of conversions attributed to the date the campaign was sent,
"conversions1": (optional, int) the number of conversions for the second conversion event,
"conversions1_by_send_time": (optional, int) the number of conversions for the second conversion event attributed to the date the campaign was sent,
"conversions2": (optional, int) the number of conversions for the third conversion event,
"conversions2_by_send_time": (optional, int) the number of conversions for the third conversion event attributed to the date the campaign was sent,
"conversions3": (optional, int) the number of conversions for the fourth conversion event,
"conversions3_by_send_time": (optional, int) the number of conversions for the fourth conversion event attributed to the date the campaign was sent
}
]
},
"conversions_by_send_time": (optional, int),
"conversions1_by_send_time": (optional, int),
"conversions2_by_send_time": (optional, int),
"conversions3_by_send_time": (optional, int),
"conversions": (optional, int),
"conversions1": (optional, int),
"conversions2": (optional, int),
"conversions3": (optional, int),
"unique_recipients": (int),
"revenue": (optional, float)
}
],
"content_cards" : [
{
"variation_name": (string) the variation name,
"variation_api_id": (string) the variation API identifier,
"sent": (int) the number of sends,
"total_impressions": (int) the number of total impressions,
"unique_impressions": (int) the number of unique impressions,
"total_clicks": (int) the number of total clicks,
"unique_clicks": (int) the number of unique clicks,
"total_dismissals": (int) the number of total dismissals,
"unique_dismissals": (int) the number of unique dismissals,
"revenue": (float) the number of dollars of revenue (USD),
"unique_recipients": (int) the number of unique recipients,
"conversions": (int) the number of conversions,
"conversions_by_send_time": (int) the number of conversions attributed to the date the campaign was sent,
"conversions1": (optional, int) the number of conversions for the second conversion event,
"conversions1_by_send_time": (optional, int) the number of conversions for the second conversion event attributed to the date the campaign was sent,
"conversions2": (optional, int) the number of conversions for the third conversion event,
"conversions2_by_send_time": (optional, int) the number of conversions for the third conversion event attributed to the date the campaign was sent,
"conversions3": (optional, int) the number of conversions for the fourth conversion event,
"conversions3_by_send_time": (optional, int) the number of conversions for the fourth conversion event attributed to the date the campaign was sent
}
]
},
"conversions_by_send_time": (optional, int),
"conversions1_by_send_time": (optional, int),
"conversions2_by_send_time": (optional, int),
"conversions3_by_send_time": (optional, int),
"conversions": (int),
"conversions1": (optional, int),
"conversions2": (optional, int),
"conversions3": (optional, int),
"unique_recipients": (int),
"revenue": (optional, float)
},
...
],
...
}
Réponse multivariées
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
{
"data" : [
{
"time" : (string) the date as ISO 8601 date,
"conversions" : (int) the number of conversions,
"revenue": (float) the number of dollars of revenue (USD),
"conversions_by_send_time": (int) the number of conversions attributed to the date the campaign was sent,
"messages" : {
"trigger_in_app_message": [{
"variation_name": (optional, string) the variation name,
"impressions": (int) the number of impressions,
"clicks": (int) the number of clicks,
"first_button_clicks": (int) the number of first button clicks,
"second_button_clicks": (int) the number of second button clicks,
"revenue": (float) the number of dollars of revenue (USD),
"unique_recipients": (int) the number of unique recipients,
"conversions": (int) the number of conversions,
"conversions_by_send_time": (int) the number of conversions attributed to the date the campaign was sent,
"conversions1": (optional, int) the number of conversions for the second conversion event,
"conversions1_by_send_time": (optional, int) the number of conversions for the second conversion event attributed to the date the campaign was sent,
"conversions2": (optional, int) the number of conversions for the third conversion event,
"conversions2_by_send_time": (optional, int) the number of conversions for the third conversion event attributed to the date the campaign was sent,
"conversions3": (optional, int) the number of conversions for the fourth conversion event,
"conversions3_by_send_time": (optional, int) the number of conversions for the fourth conversion event attributed to the date the campaign was sent
}, {
"variation_name": (optional, string) the variation name,
"impressions": (int) the number of impressions,
"clicks": (int) the number of clicks,
"first_button_clicks": (int) the number of first button clicks,
"second_button_clicks": (int) the number of second button clicks,
"revenue": (float) the number of dollars of revenue (USD),
"unique_recipients": (int) the number of unique recipients,
"conversions": (int) the number of conversions,
"conversions_by_send_time": (int) the number of conversions attributed to the date the campaign was sent,
"conversions1": (optional, int) the number of conversions for the second conversion event,
"conversions1_by_send_time": (optional, int) the number of conversions for the second conversion event attributed to the date the campaign was sent,
"conversions2": (optional, int) the number of conversions for the third conversion event,
"conversions2_by_send_time": (optional, int) the number of conversions for the third conversion event attributed to the date the campaign was sent,
"conversions3": (optional, int) the number of conversions for the fourth conversion event,
"conversions3_by_send_time": (optional, int) the number of conversions for the fourth conversion event attributed to the date the campaign was sent
}, {
"variation_name": (optional, string) the variation name,
"revenue": (float) the number of dollars of revenue (USD),
"unique_recipients": (int) the number of unique recipients,
"conversions": (int) the number of conversions,
"conversions_by_send_time": (int) the number of conversions attributed to the date the campaign was sent,
"conversions1": (optional, int) the number of conversions for the second conversion event,
"conversions1_by_send_time": (optional, int) the number of conversions for the second conversion event attributed to the date the campaign was sent,
"conversions2": (optional, int) the number of conversions for the third conversion event,
"conversions2_by_send_time": (optional, int) the number of conversions for the third conversion event attributed to the date the campaign was sent,
"conversions3": (optional, int) the number of conversions for the fourth conversion event,
"conversions3_by_send_time": (optional, int) the number of conversions for the fourth conversion event attributed to the date the campaign was sent
"enrolled": (optional, int) the number of enrolled users
}]
},
"conversions_by_send_time": (optional, int),
"conversions1_by_send_time": (optional, int),
"conversions2_by_send_time": (optional, int),
"conversions3_by_send_time": (optional, int),
"conversions": (optional, int),
"conversions1": (optional, int),
"conversions2": (optional, int),
"conversions3": (optional, int),
"unique_recipients": (int),
"revenue": (optional, float)
}],
...
}
Les types de messages possibles sont email
, in_app_message
, webhook
, android_push
, ios_push
, kindle_push
et web_push
. Tous les types de messages des notifications push auront les mêmes statistiques que celles d’android_push
.
Pour obtenir de l’aide sur les exportations CSV et de l’API, consultez la section Résolution des problèmes d’exportation.