Connector Improvement: Extend Ironclad connector to support Exports endpoint
AnsweredIronclad has a post endpoint (https://iconcladdapp.com/public/api/v1/exports) through which we can export reports. This API is not exposed through Fivetran currently. We are unable to get the data we need through the API's that fivetran currently supports.
Here is how the API works
api_key = secrets.get(...)
# API key is used directly as a Bearer token in the HTTP Authentication header.
headers = {
"Authentication": f"Bearer {api_key}",
"Accept": "application/json",
}
request_payload = {
"exportType": "workflow_activities", # I think this must be the report name
# Apparently, reports can also take parameters. Examples for this custom
# report follow, but I assume each exportable entity might have its own
# possibly custom parameters.
"startDate": "2024-02-01", # optional; can be omitted
"endDate": "2024-02-28" # Also optional
}
response = requests.post("https://iconcladdapp.com/public/api/v1/exports",
headers=headers, json=request_payload)
The response JSON object contains:
- a
jobIdkey that identifies the running job that is generating the report -
jobStatuskey indicating the status (“pending” or “done” are the two values I’m aware of, though there may be more, like “failed”)
You then have to poll for job completion using:
requests.get(f"https://iconcladdapp.com/public/api/v1/exports/{job_id}"
Finally, once the job_status comes back as “done”, you call the following URL to download the object (which, in the case of a report, is CSV data):
requests.get(f"https://iconcladdapp.com/public/api/v1/exports/{job_id}/download")
-
Official comment
Hi Krishna,
Missed a response here.
We have added this to our active backlog and will keep you posted as we make progress, basis the demand for the feature.
Thanks.
Please sign in to leave a comment.
Comments
1 comment