Populate button links

Hi Everyone,

I’m using jotform and I’m trying to figure out how to populate button download link with the recent pdf file from jot form.

This is the link they have provided. But i need to populate the Submission ID and Form ID.
https://www.jotform.com/server.php?action=getSubmissionPDF&sid=SubmissionID&formID=FormID

Any help is greatly appreciated!