(PowerBuilder) Yousign: Download File
Downloads a previously uploaded Yousign file. For more information, see https://dev.yousign.com/?version=latest#490b263d-a038-4871-acab-5ab73481fb2d
integer li_rc
oleobject loo_Http
integer li_Success
string ls_DownloadUrl
string ls_LocalFilePath
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
// Adds the "Authorization: Bearer YOUR_API_KEY" header.
loo_Http.AuthToken = "YOUR_API_KEY"
ls_DownloadUrl = "https://staging-api.yousign.com/files/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/download?alt=media"
ls_LocalFilePath = "qa_output/x.pdf"
li_Success = loo_Http.Download(ls_DownloadUrl,ls_LocalFilePath)
if li_Success = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
return
end if
Write-Debug "The PDF file is downloaded..."
destroy loo_Http
|