Use URL parameter to specify file to be embedded on page

Our site has several dozen “gated content” assets - basically just PDF files where the user must submit a simple form in order to view/download the PDF file.

These forms are managed/hosted in Salesforce, so we’re using the Custom Code component to embed them in the landing pages using an iframe. When the form is submitted, the user is redirected to a “Thank You” page.

I’m trying to create a single “Thank You” page and pass an ID in the URL to identify the PDF file associated with the form that was submitted.

My initial thought was to just pass the URL of the PDF file from the Builder.io Asset Library and use JavaScript to set that as the source of the iframe on the Thank You page.

Explicitly defining src="https://cdn.builder.io/o/assets%2Fce1ea832308e45d1a9079c87c4bdd80f%2Fcb509dc396be410e82ce1ebe27cebaba?alt=media&token=08532c4f-1f9d-4f88-b1d7-866634ee12b4&apiKey=ce1ea832308e45d1a9079c87c4bdd80f" of the iframe in a Custom Code component works.

But when I pass that same value as a URL parameter, e.g., website.com/thank-you?assetURL=https://cdn.builder.io/o/assets%2Fce1ea832308e45d1a9079c87c4bdd80f%2Fcb509dc396be410e82ce1ebe27cebaba?alt=media&token=08532c4f-1f9d-4f88-b1d7-866634ee12b4&apiKey=ce1ea832308e45d1a9079c87c4bdd80f I get the following error:

{“error”:{“code”:400,“message”:“Invalid HTTP method/URL pair.”}}

Is there a better way to go about this? From reading through the Knowledge Base and Forum, it seems like the recommendation might be to:

  1. Create a data model with ID and URL (or File?) fields
  2. Create a content entry for each of the PDF files
  3. Pass the ID to the Thank You page via URL
  4. Use JavaScript to retrieve the ID from the URL
  5. Bind a Custom Code to the data model created in #1 above
  6. Somehow query the data model to retrieve the URL associated with the ID passed to the page and set that URL as the src of the iframe.

I’m struggling to get this to work, so I’m wondering if I’m over-complicating things or if I’m on the right path but haven’t gotten all the pieces together yet.

Has anyone needed to solve for a similar use case? If so, how?

Thanks in advance!