Sample code for 30+ languages & platforms
Java

Yousign: Download File

See more Yousign Examples

Downloads a previously uploaded Yousign file.

Chilkat Java Downloads

Chilkat2 Java
import com.chilkatsoft.chilkat2.ChilkatException;
import com.chilkatsoft.chilkat2.Http;

public class ChilkatExample {

    public static void main(String[] args) {
        // This example assumes the Chilkat API to have been previously unlocked.
        // See Global Unlock Sample for sample code.

        Http http = new Http();

        // Adds the "Authorization: Bearer YOUR_API_KEY" header.
        http.setAuthToken("YOUR_API_KEY");

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

        try {
            http.download(downloadUrl, localFilePath);
        } catch (ChilkatException e) {
            System.out.println(e.getLastErrorText());
            return;
        }

        System.out.println("The PDF file is downloaded...");
    }
}