-
Notifications
You must be signed in to change notification settings - Fork 3
/
loadChannelsStats.py
28 lines (23 loc) · 1008 Bytes
/
loadChannelsStats.py
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
import ElasticEmail
from ElasticEmail.apis.tags import statistics_api
from pprint import pprint
# Defining the host is optional and defaults to https://api.elasticemail.com/v4
configuration = ElasticEmail.Configuration()
# Configure API key authorization: apikey
configuration.api_key['apikey'] = 'YOUR_API_KEY'
"""
Load channels stats
Example api call that loads a list of your channels' stats.
"""
with ElasticEmail.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = statistics_api.StatisticsApi(api_client)
query_params = {
'limit': 100, # int | Maximum number of returned items. (optional)
'offset': 0 # int | How many items should be returned ahead. (optional)
}
try:
api_response = api_instance.statistics_channels_get(query_params = query_params)
pprint(api_response)
except ElasticEmail.ApiException as e:
print("Exception when calling StatisticsApi->statistics_channels_get: %s\n" % e)