From 45200ddd72ca0769d3a85112ebfc45d9bfe96762 Mon Sep 17 00:00:00 2001 From: brycegrier <167581938+brycegrier@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:46:10 -0800 Subject: [PATCH] Update mailinglists.py Added includeCount parameter to request query url. This is needed to return an accurate list item count. --- QualtricsAPI/XM/mailinglists.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QualtricsAPI/XM/mailinglists.py b/QualtricsAPI/XM/mailinglists.py index 95c8440..65c5bf9 100644 --- a/QualtricsAPI/XM/mailinglists.py +++ b/QualtricsAPI/XM/mailinglists.py @@ -47,7 +47,7 @@ def list_lists(self, page_size=100): mailing_lists = pd.DataFrame() headers, base_url = self.header_setup(xm=True) - url = base_url + f"/mailinglists/?pageSize={page_size}" + url = base_url + f"/mailinglists/?pageSize={page_size}&includeCount=true" try: def get_page(mailing_lists=mailing_lists, url=url): ''' This method is a nested method that extracts a single page of mailing lists. ''' @@ -264,4 +264,4 @@ def create_contact_in_list(self, mailing_list=None, **kwargs): print(f"ServerError: {response['meta']['httpStatus']}\nError Code: {response['meta']['error']['errorCode']}\nError Message: {response['meta']['error']['errorMessage']}") else: contact_list_id = response['result']['contactLookupId'] - return contact_id, contact_list_id \ No newline at end of file + return contact_id, contact_list_id