How can i use pdf Generator api with the data?

Hi, does anyone know how to link a data collection to a pdf generator document with: pdf generator api via container. I have to insert the data from this collection in my pdf.

This is the code I use to do it without dynamic data.

import {getPdfUrl} from 'backend/pdfGenerator'
import wixLocation from 'wix-location';

$w.onReady(function () {
    
});

export async function pdfButton_click(event) {
    const firstName = $w('#firstNameInput').value
    const lastName = $w('#lastNameInput').value

    const pdfUrl = await getPdfUrl({firstName, lastName})
    wixLocation.to(pdfUrl);
}

backend:

import PDFGeneratorAPI from 'pdf-generator-api'

const apiKey = '< API KEY from pdfgeneratorapi account settings >';
const apiSecret = '< API SECRET from pdfgeneratorapi account settings >';
const baseUrl = 'https://us1.pdfgeneratorapi.com/api/v3/';
const workspace = "<workspace is the user's pdfgeneratorapi account email";
const templateID = "< ID number of the template >";

let Client = new PDFGeneratorAPI(apiKey, apiSecret)
Client.setBaseUrl(baseUrl)
Client.setWorkspace(workspace)

export async function getPdfUrl(data) {
    const {response} = await Client.output(templateID, data, undefined, undefined, {output: 'url'})
    return response
}

Thanks a lot for the answer!