The API specification for the beta load accounts endpoint has been updated to include the x-www-form-urlencoded content type. An example cURL command using this new content type would be as follows:
Yes - the colab workflow looks to have been updated a week ago to use the beta api. Iāve run it successfully today in my environment, after amending the api paths and source id.
You should remove the extra content type you should have added in the header. Postman automatically calculates the content-type based upon the body. You could see one content-type already added.
Now, if you are getting 400 bad request, remove ādisableOptimizationā key in the form-data if already added.
After this modifications, hopefully the API should work.
Can someone share a working example in Python for hitting this endpoint and passing in a CSV file for a CSV source aggregation? I am unable to upload a file using Python.
A simple example to push .csv during aggregation :
import requests
url = f"https://{tenant}.api.identitynow.com/beta/sources/{id}/load-accounts" # api endpoint url
file_path = r"C:\Users\Thomas\Downloads\import.csv" # File to upload
proxies = {"http": "", "https": ""} # proxies if needed, remove if you don't need
access_token = "" # i suppose you know how to generate this
headers = {"Authorization": f"Bearer {access_token}"}
with open(file_path, "rb") as file:
files = {"file": ("file.csv", file, "text/csv")}
response = requests.post(url, files=files, proxies=proxies, verify=False, headers=headers) # If you don't use proxies, remove "proxies" and "verify" args
print(response.status_code)
print(response.text)