Using the Imago Application Programming Interface (API) and some basic web service tools it is possible to generate a list of Data Entities (HoleID's) available for a project.
Here is a the code of from the example bat file:
SETLOCAL ENABLEDELAYEDEXPANSION
echo off
set im_user="ImagoDemo1"
set im_password="ImagoDemo1"
set im_file_out="list.txt"
echo "PROJECT DATASET DATASETID ENTITY" > %im_file_out%
FOR /F "tokens=* USEBACKQ" %%F IN (`curl -X PUT -d username^=%im_user% -d password^=%im_password% https://io.imago.live/integrate/1/session ^| jq -r ".apiToken"`) DO (
set varApiToken=%%F
)
rem echo "The API Token is: %varApiToken%"
FOR /F "tokens=1,2,3 delims=$$$ USEBACKQ" %%G IN (`curl -H "imago-api-token: %varApiToken%" -X GET https://io.imago.live/integrate/1/context ^| jq -r "foreach .projects[] as $item ([];foreach $item.datasets[] as $dset([];$item.name + \"$$$\" + $dset.name + \"$$$\" + $dset.id))"`) DO (
FOR /F "tokens=* USEBACKQ" %%J IN (`curl -H "imago-api-token: %varApiToken%" -X GET https://io.imago.live/integrate/1/dataentity?datasetid^=%%I ^| jq -r ".dataEntities[].name"`) DO (
echo "%%G %%H %%I %%J" >> %im_file_out%
)
)
You will need to call the webservice (curl.exe) and manage the JSON (jq.exe).
To try it out:
- Download DownloadList.zip and extract the contents to a local directory.
- Then run "DownoadList.bat".
Contact Support if you require more information.
SKIP AHEAD TO |
Export a List of Collections or Images |
Comments
0 comments
Please sign in to leave a comment.