0

The file has 100 histories. And Code is like below:

                            $request = $this->service->files->export(
                                $item['file_id'],
                                $item['export_mime_type'],
                                [
                                    'alt' => 'media',
                                ]
                            );
                            $request = $request
                                ->withUri(new Uri($item->get('downloadUrl')))
                                ->withHeader('X-Php-Expected-Class', null);

"downloadrl" is exportedLink of google doc history. And This requests always return 429 unknown. "This file might be unavailable right now due to heavy traffic" Is there any ways to resolve it

I have tried to wait a few seconds. but finally it will return 400

4
  • What is $item? Can you provide the original script for obtaining $item? From "downloadrl" is exportedLink of google doc history. And This requests always return 429 unknown., I'm worried that the reason for your current issue might be the script for obtaining $item.
    – Tanaike
    Commented Jun 27 at 4:31
  • $Item is variable directly passed in this function. I don't think it is due to obtaining $item. Because this code works when history number is small like 6. The compele response is like below. Thanks for looking into it. ```
    – 吴婕妤
    Commented Jun 27 at 5:49
  • """guzzle.INFO: API redirect 307 Temporary Redirect: GET docs.google.com/feeds/download/documents/export/… {"status":"redirect","method":"GET","uri":"docs.google.com/feeds/download/documents/export/…""" """guzzle.WARNING: API fail 429 unknown: GET doc-0g-2k-docstext.googleusercontent.com/export/… {"status":"fail","method":"GET","uri":"doc-0g-2k-docstext.googleusercontent.com/export/xx"""
    – 吴婕妤
    Commented Jun 27 at 6:04
  • Thank you for replying. About I don't think it is due to obtaining $item., I deeply apologize that my guess was not correct for your situation.
    – Tanaike
    Commented Jun 27 at 6:07

1 Answer 1

0

I don't believe the issue is with your code. It looks like a quota issue with the request given the 429 response.

The file might be too large to export. Some Google documents mention a 10 MB limit for exports [1]

Exported content is limited to 10 MB.

Google documents don't support partial downloads, so it really looks like your best bet may be to reduce the file size of the export across multiple documents.

[1] https://developers.google.com/drive/api/guides/manage-downloads#export-content

1
  • Thanks a lot. but the file size is only 6kb, but the history number is big, which is 100. It seems not hit quota since it still returns 429 in the new day. And the reason returned in 429 response was "unknown". It was strange
    – 吴婕妤
    Commented Jun 28 at 2:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.