directLink method
Get a direct link preview for a shared file.
Returns a Future containing a DynamiteResponse with the status code, deserialized body and headers. Throws a DynamiteApiException if the API call does not return an expected status code.
Parameters:
token
Token of the share.oCSAPIRequest
Required to be true for the API request to pass. Defaults totrue
.
Status codes:
- 200: Preview returned
- 400: Getting preview is not possible
- 403: Getting preview is not allowed
- 404: Share or preview not found
See:
- directLinkRaw for an experimental operation that returns a DynamiteRawResponse that can be serialized.
Implementation
Future<DynamiteResponse<Uint8List, void>> directLink({
required String token,
bool? oCSAPIRequest,
}) async {
final rawResponse = directLinkRaw(
token: token,
oCSAPIRequest: oCSAPIRequest,
);
return rawResponse.future;
}