Sample code for 30+ languages & platforms
Dart

Yousign: Download File

See more Yousign Examples

Downloads a previously uploaded Yousign file.

Chilkat Dart Downloads

Dart
import 'package:chilkat/chilkat.dart';

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

  final http = CkHttp();

  // Adds the "Authorization: Bearer YOUR_API_KEY" header.
  http.authToken = 'YOUR_API_KEY';

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

  try {
    http.download(downloadUrl, localFilePath);
  } on ChilkatException catch (e) {
    print(e.lastErrorText);
    return;
  }

  print('The PDF file is downloaded...');
}