Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Download secure attachments from confiforms

Peter August 14, 2025

I built a confiforms app where users can upload documents. To retrieve these, I query the data via the REST API and get the following content: 
{
"total": 1, "list": {
"entry": [
{
"recordId": 121,
"createdBy": "heusch",
"created": 1755163242079,
"id": "18f26577-15e6-4023-8745-1c2302f7c39a",
"fields": {
"Fakultaet": "C",
"Email": "peter.heusch@hft-stuttgart.de",
"Matrikelnummer": 123456,
"Fullname": "Peter Heusch",
"FakultaetTest": "C",
"StudiengangFakC": "e25f9f73-d783-4aca-8cdb-57732c785d75",
"Praesentation": false,
"Nachname": "heusch",
"Studiengang": "Bachelor Informatik",
"Auslandssemester": false,
"BPSStatus": "default",
"Stellenbeschreibung": "[{\"fileName\":\"merkblatt.pdf\",\"id\":\"150409792\",\"contentType\":\"application/pdf\",\"version\":\"1\"}]"
},"ownedBy": "heusch"}]}}

However, to download the attachment "merkblatt.pdf", the URL is https://wiki.hft-stuttgart.de/download/attachments/150409791/merkblatt.pdf?version=1&modificationDate=1755163242128&api=v2, which is off by one. How do I get from 150409792 to  150409791? 
Any help greatly appreciated

2 answers

0 votes
Alex Medved _ConfiForms_
Community Champion
August 15, 2025

Hi @Peter 

It is not off by one - the one in the URL is the id of the page where attachment is stored and an id in the JSON returned by ConfiForms API is the attachment id

Alex

Peter August 19, 2025

Hi Alex,
indeed, my question was how to retrieve this info. As of now, I only see the following steps: 
1) Query Page using curl:

curl https://site.hft-stuttgart.de/rest/confiforms/1.0/search/123456789/BetreutesPraktischesStudienprojekt

2) From the answer retrieve the ID:
"id": "18f26577-15e6-4023-8745-1c2302f7c39a"
3) Query all child pages using curl:  

curl https://site.hft-stuttgart.de/rest/api/content/123456789/child/page

4) From the lengthy answer, find the id from point the answer to prefixed by storage 1)

{
    "id": "987654321", <<<<< This ID is important!
    "type": "page",
    "status": "current",
    "title": "storage_18f26577-15e6-4023-8745-1c2302f7c39a",
    .....
etc. etc. etc.
}

 5) Retrieve document using curl:
 curl 'https://site.hft-stuttgart.de/download/attachments/987654321/merkblatt.pdf'

Is there any shorter way to do this?

Alex Medved _ConfiForms_
Community Champion
August 20, 2025

This sounds a bit complex to me... you can access attachment's metadata and it's container with one request

https://YOUR_SERVER/rest/api/content/ATTACHMENTID?expand=container

You will get the page id it belongs to and  could easily craft the download URL you want, or just use what is provided in the REST API call response

0 votes
John Funk
Community Champion
August 14, 2025

Hi Peter - Welcome to the Atlassian Community!

It's best to contact the vendor directly to get assistance. 

@Alex Medved _ConfiForms_ 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events