Sample code for 30+ languages & platforms
Visual FoxPro

Yousign: Download File

See more Yousign Examples

Downloads a previously uploaded Yousign file.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loHttp
LOCAL lcDownloadUrl
LOCAL lcLocalFilePath

lnSuccess = 0

* This example assumes the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.

loHttp = CreateObject('Chilkat.Http')

* Adds the "Authorization: Bearer YOUR_API_KEY" header.
loHttp.AuthToken = "YOUR_API_KEY"

lcDownloadUrl = "https://staging-api.yousign.com/files/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/download?alt=media"
lcLocalFilePath = "qa_output/x.pdf"

lnSuccess = loHttp.Download(lcDownloadUrl,lcLocalFilePath)
IF (lnSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    CANCEL
ENDIF

? "The PDF file is downloaded..."

RELEASE loHttp