Skip to main content

fetch_google_doc

Function fetch_google_doc 

Source
pub async fn fetch_google_doc(
    url: &str,
    format: &str,
    api_token: Option<&str>,
) -> Result<GDocsResult>
Expand description

Fetch a Google Docs document via the export URL.

For public documents, pass None for api_token. For private documents, pass a Bearer token string.

§Arguments

  • url - Google Docs URL (edit URL or any URL containing the document ID)
  • format - Export format (html, txt, md, pdf, docx, epub)
  • api_token - Optional API token for private documents

§Errors

Returns an error if the URL is not a valid Google Docs URL, or if the fetch fails.