You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print('Hey there! It looks like your Mailing List ID is incorrect. You can find the Mailing List ID on the Qualtrics site under your account settings. It will begin with "CG_". Please try again.')
print(f'Your mailing list "{mailing_list}" has been renamed in the XM Directory')
117
+
print(f'Your mailing list "{mailing_list}" has been renamed to {name}in the XM Directory.')
106
118
exceptMailingListIDError:
107
119
print('Hey there! It looks like your Mailing List ID is incorrect. You can find the Mailing List ID on the Qualtrics site under your account settings. It will begin with "CG_". Please try again.')
108
120
return
109
121
110
122
defdelete_list(self,mailing_list=None):
111
-
'''This function deletes a mailing list from the XM Directory.
123
+
'''This method will delete the specified mailing list from the given users XM Directory.
112
124
113
-
:param mailing_list: the mailing list id
114
-
:return: nothing, but prints a if successful and errors if unsuccessful.
125
+
:param mailing_list: Your mailing list id that you are interested in deleting.
126
+
:type mailing_list: str
127
+
:return: A string confirming that you successfully deleted the list.
115
128
'''
116
129
assertlen(mailing_list) ==18, 'Hey there! The parameter for "mailing_list" that was passed is the wrong length. It should have 18 characters.'
117
130
assertmailing_list[:3] =='CG_', 'Hey there! It looks like your Mailing List ID is incorrect. You can find the Mailing List ID on the Qualtrics site under your account settings. Please try again.'
print(f'Your mailing list "{mailing_list}" has been deleted from the XM Directory')
139
+
print(f'Your mailing list "{mailing_list}" has been deleted from the XM Directory.')
127
140
exceptMailingListIDError:
128
141
print('Hey there! It looks like your Mailing List ID is incorrect. You can find the Mailing List ID on the Qualtrics site under your account settings. It will begin with "CG_". Please try again.')
129
142
return
130
143
131
-
deflist_contacts(self, mailing_list=None):
132
-
'''This function lists the contacts within the defined mailing list.
'''This method creates a pandas DataFrame of all the contacts information within the defined mailing list.
133
146
134
147
:param mailing_list: the mailing list id
135
-
:return: a pandas DataFrame containing the contact information.
148
+
:type mailing_list: str
149
+
:param page_size: The number of contacts in the mailing list to return per call.
150
+
:type page_size: int
151
+
:param offset: The index offset that you would like to apply in you call.
152
+
:type offset: int
153
+
:param to_df: if True, returns the contacts in the mailing list and their member objects in a pandas DataFrame.
154
+
:return: a pandas DataFrame, or a dictionary containing the contacts information.
136
155
'''
137
156
assertlen(mailing_list) ==18, 'Hey, the parameter for "mailing_list" that was passed is the wrong length. It should have 18 characters.'
138
157
assertmailing_list[:3] =='CG_', 'Hey there! It looks like your Mailing List ID is incorrect. You can find the Mailing List ID on the Qualtrics site under your account settings. Please try again.'
print('Hey there! It looks like your Mailing List ID is incorrect. You can find the Mailing List ID on the Qualtrics site under your account settings. It will begin with "CG_". Please try again.')
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -37,8 +37,8 @@ This will generate environment variables that will be used to populate the HTTP
37
37
Now the generation of the necessary HTTP headers will be handled automatically, so we don't have to worry about it. We have 2 modules available to work with Contact Data. The first is `XMDirectory()`, and `MailingList()`. We import each as follows below.
0 commit comments