Sample code for 30+ languages & platforms
Lua

Yousign: Download File to Memory

See more Yousign Examples

Downloads a previously uploaded Yousign file (PDF) to memory.

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 pdfData = chilkat.BinData.new()
local success = http:download_bd(downloadUrl, pdfData)
if not success then
    print(http.last_error_text)
    return
end

-- Your application may now access the data contained in "pdfData".

print("Success")