There seems to be an issue with the Python requests library when setting Content-Type
to ‘multipart/form-data’ that is causing the internal fault error. Content-Type
is automatically set correctly by the files
parameter, so you can utilize that for an unoptimized aggregation even if you are aggregating a direct connected source.
import requests
headers = {
# requests won't add a boundary if this header is set when you pass files=
# 'Content-Type': 'multipart/form-data',
'Authorization': 'Bearer <token>'
}
files = {
'disableOptimization': (None, 'true'),
}
response = requests.post(
'https://<org>.identitynow.com/beta/sources/<sourceid>/load-accounts',
headers=headers,
files=files,
)