getSignedUrl method

Future<String> getSignedUrl(
  1. String fileId, {
  2. int expirySeconds = 3600,
})

Generates a signed URL for a file

Implementation

Future<String> getSignedUrl(
  String fileId, {
  int expirySeconds = 3600,
}) async {
  final response = await _client.get(
    Uri.parse('$baseUrl/files/$fileId/signed-url?expiry=$expirySeconds'),
    headers: {
      ..._headers,
      'Content-Type': 'application/json',
    },
  );

  final data = _handleResponse(response);
  return data['url'] as String;
}