3. Iterate through each submission. For each one, check if it has the attachment you are looking for, and if it does, export it. In this example, we are exporting pdfs and naming them with the format paper#.pdf.
for note in notes:
if(note.content.get("pdf",{}).get('value')):
f = client.get_attachment(note.id,'pdf')
with open(f'submission{note.number}.pdf','wb') as op:
op.write(f)
4. If you wanted to extract a field called supplementary_material which authors uploaded as zip files, you could do the following instead:
for note in notes:
if(note.content.get("supplementary_material",{}).get('value')):
f = client.get_attachment(note.id,'supplementary_material')
with open(f'submission{note.number}_supplementary_material.zip','wb') as op:
op.write(f)