Hello,
I have the following code, but can't seem to figure out why I can't export all my optout customers.
# List Contacts in Mailing List
import time
from datetime import date
import null as null
import pandas as pd
import requests
# Setting user Parameters
from pandas.io import json
rm = []
today = date.today()
filename = f"contactsDowloaded_{today}"
apiToken = "
dataCenter = "
directoryId = "
nextPage = "https://{0}.qualtrics.com/API/v3/directories/{1}/contacts/optedOutContacts".format(dataCenter, directoryId)
headers = {
"x-api-token": apiToken,
}
count = 0
while nextPage is not None:
time.sleep(.1)
if count % 25 == 0:
print(count)
time.sleep(.5)
response = requests.get(nextPage, headers=headers)
time.sleep(.1)
json_data = json.loads(response.text)
time.sleep(.1)
nextPage = json_data['result']['nextPage']
time.sleep(.1)
df = pd.DataFrame(response.json()['result']['elements'])
time.sleep(.1)
if 'email' not in df.columns:
print(count, df.columns)
else:
df_list = list(df['email'])
rm += df_list
count += 1
time.sleep(.2)
pd.DataFrame({'email': rm}).to_csv(f'FILE_PATH_LOCATION\\\\{filename}.csv', index=False)
I can pull about 40K contacts but need to get close to 200K?
Not sure if this has been answer already but wanted to get some insight on how others might be exporting this data.
Export OptOut Contacts via api and python
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
