tavasjn24
3 years agoGuide
Bulk Data API v2
Does anyone know why when I run my python3 bulk data api request I am getting a not found message.
import requests
# Place the "Bulk API access token" from Community Analytics here
access_token = 'ACCESSTOKEN'
# Place the "Client ID" from Community Analytics here
client_id = 'CLIENTID'
response = requests.get(
params={'fromDate': '20220411', # Set the start date in YYYYMMDD format
'toDate': '20220417'}, # Set the end date in YYYYMMDD format
auth=(access_token, ''),
headers={'client-id': client_id, # TODO: place the "Client ID" from Community Analytics here
'Accept': 'text/csv'} # OPTIONAL: this could also be set to "application/json" to receive JSON results, or even left unset to receive CSV
)
# Use "response.json()" incase you need json response (set 'Accept' header as mentioned above).
data = response.text
print(data)