How to download Questionnaire Attachments via the API

Questionnaire Attachments are available for download via the UpGuard API. You may, for example, want to back your files up to disk.

Written by Steve Cossell

Overview

UpGuard allows you to download Questionnaire Attachments via the API. You may want to automate the backup of submitted documents and evidence attached to completed questionnaires to another source, or ingest them into another tool like ServiceNow as part of your Vendor Assessment Process. This guide shows how to access Questionnaire Attachments via the API.

The examples provided here are given in Python. Please contact UpGuard Support if you would like a similar tutorial written in your language of choice.

Prerequisites

To use the UpGuard API you will need to generate or find your account's API key. For more information around locating your API key, please see our guide on Locating your API Key.

Accessing Questionnaire Attachments

The following code example shows you how to locate a particular vendor, then iterate through all questionnaires completed by that vendor, downloading each attachment to the local folder.

# pip install upguard                                                                                                                                                                                
import upguard

o = upguard.Account("your-api-key")

v = o.vendor_by_domain("upguard.com")

print("Found vendor " + str(v.name))

for qn in v.questionnaires():
print("Checking attachments for Qn " + qn.name)

for a in qn.attachments():
print("saving attachment " + a.file_name + " to file")
a.save_to_file()

What Next?

You can also export other vendor information from the API. For more information about exporting vendors to CSV, or accessing vendor scores, please see our guide on How to bulk export vendor information.

 

See also: