Sample code for 30+ languages & platforms
React Native

Yousign: Download File

See more Yousign Examples

Downloads a previously uploaded Yousign file.

Chilkat React Native Downloads

React Native
import { Http } from '@chilkat/react-native'

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

  const http = new Http();

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

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

  try {
    await http.downloadAsync(downloadUrl, localFilePath);
  } catch {
    console.log(http.lastErrorText);
    return;
  }

  console.log('The PDF file is downloaded...');
}