-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Labels
Description
The current Caesar() class allows a user to use Caesar.http_post() and Caesar.http_get() functions to request and fetch data exports (e.g., subject reduction exports). It would be useful to add these as built-in supported (workflow?) functions.
Example Script and API calls: see https://gist.github.com/lcjohnso/9456ed1e434c8f32d171c3ee84e7c0bb
# POST: request data export
response = caesar.http_post('workflows/14662/data_requests', json={'data_request': {'requested_data': 'subject_reductions'}})[0]
request_id = response['id']
# GET: fetch data request info, including status and download URL
data_request = caesar.http_get('workflows/26783/data_requests/{}'.format(request_id))[0]
If folks don't know their data request ID, they can use the index GET to list all requests for that workflow; it might be useful to automatically filter for the most recent (based on updated_at timestamp) export of a particular type.