Payload for /tools/create-archive REST API Call

Hi,

Can anyone tell me or point me in the direction of any documentation that says what the body payload of a call to the /tools/create-archive REST API should be. I need to create a ZIP file of a number of unrelated studies and it seems this is the way to do it but I can’t find anything that tells me what the body of the POST request should look like.

Thanks

Steve

Hello,

Have a look at the integration tests (in Python):
https://hg.orthanc-server.com/orthanc-tests/file/default/Tests/Tests.py

HTH,
Sébastien-

Hi Sébastien,

Thanks for that link.

I have taken a look at the code and my Python knowledge is not great but from what I can gather the payload is simply an array of the IDs that you want to export. So this piece of code:

s = DoPost(_REMOTE, ‘/tools/create-archive’, [
‘ca29faea-b6a0e17f-067743a1-8b778011-a48b2a17’,
‘0a9b3153-2512774b-2d9580de-1fc3dcf6-3bd83918’,
‘1e2c125c-411b8e86-3f4fe68e-a7584dd3-c6da78f0’
])

would translate to an equivalent curl call of:

curl http://localhost:8042/tools/create-archive -d ‘[“ca29faea-b6a0e17f-067743a1-8b778011-a48b2a17”,“0a9b3153-2512774b-2d9580de-1fc3dcf6-3bd83918”,“1e2c125c-411b8e86-3f4fe68e-a7584dd3-c6da78f0”]’ > myarchive.zip

Thanks
Steve

Hello,

Yes, your translation should indeed work.

Sébastien-