google / google/googleapis.dart

DriveApi.files.export - DetailedApiRequestError(status: 403, message: Export requires alt=media to download the exported content.)

Open
#78 1 comment 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
Dart
Stars
419
Forks
136
Avg merge
1h 21m
Merged PRs (30d)
5

Description

I tried fetching a spreadsheet from Google Docs, I got a result back indicating the following error:

E/flutter ( 9786): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: DetailedApiRequestError(status: 403, message: Export requires alt=media to download the exported content.)
E/flutter ( 9786): #0 _validateResponse (package:_discoveryapis_commons/src/clients.dart:875:9)
E/flutter ( 9786):
E/flutter ( 9786): #1 ApiRequester.request (package:_discoveryapis_commons/src/clients.dart:69:22)
E/flutter ( 9786):

Code below:
clientViaServiceAccount(_credentials, _SCOPES).then((httpClient) {
var driveApi = CustomDriveApi(httpClient);
final spreadSheetId = '';
final mimeType = 'application/pdf';
driveApi.files
.exportWithAlt(spreadSheetId, mimeType, alt: 'media')
.then((document) => print(document));
});

Was playing around with the mimeTypes -(csv/text, applciation/pdf)
![image](https://user-images.githubusercontent.com/1386863/62840197-778d2100-bc64-11e9-9187-ccbadffa68e2.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.