Sample code for 30+ languages & platforms
Lua

Yousign: Download File

See more Yousign Examples

Downloads a previously uploaded Yousign file.

Chilkat Lua Downloads

Lua
local chilkat = require("chilkat")

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

local http = chilkat.Http.new()

-- Adds the "Authorization: Bearer YOUR_API_KEY" header.
http.auth_token = "YOUR_API_KEY"

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

local success = http:download(downloadUrl, localFilePath)
if not success then
    print(http.last_error_text)
    return
end

print("The PDF file is downloaded...")