POST /api/source/loadAccounts

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:

curl -L 'https://sailpoint.api.identitynow.com/beta/sources/:id/load-accounts' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d 'disableOptimization=true'
3 Likes

Has anybody successfully implemented this in a workflow?

Something like this: Run Unoptimized Aggregation Workflow

@colin_mckibben is this possible?

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.

1 Like

I havenā€™t set up the one from the CoLab but I have one that I have written using the new API that works.

Yes it works. I noticed you need to specify the internal ID of the source instead of the external cloud ID.

Mike

1 Like

Thanks Tyler. Can you point me to the SailPoint python SDK reference documentation?

@MeghaM

  1. 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.
  2. Now, if you are getting 400 bad request, remove ā€˜disableOptimizationā€™ key in the form-data if already added.
  3. After this modifications, hopefully the API should work.
1 Like

@spetursson the python SDK docs can be found here:

1 Like

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.

Hello @dominick-miller,

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)

Hope itā€™s help,
Have a good day,
Thomas

1 Like