0

i am trying to perform mail merge with google docs and sheets this is the link to my project. https://github.com/EyadZaeim/MDS

however, i keep encountering this error

<HttpError 400 when requesting https://docs.googleapis.com/v1/documents/1ON3u_SSf33ow-AkzAf01yMl0RrgXIdUT:batchUpdate?fields=&alt=json returned "This operation is not supported for this document". Details: "This operation is not supported for this document">
  File "C:\Users\BAU\Desktop\MDS\Merge.py", line 100, in merge_template
    documentId=copy_id, fields='').execute()
  File "C:\Users\BAU\Desktop\MDS\Merge.py", line 132, in <module>
    i+1, merge_template(DOCS_FILE_ID, SOURCE, DRIVE))) ```

in this line ``` # send requests to Docs API to do actual merge
    DOCS.documents().batchUpdate(body={'requests': reqs},
            documentId=copy_id, fields='').execute()
    return copy_id ```
 
what can i do ? thank you so much
Hani
  • 1
  • 2
  • When your error occurs at `DOCS.documents().batchUpdate(body={'requests': reqs}, documentId=copy_id, fields='').execute()`, I thought that your request body can be worked. I cannot understand your current issue. So, can I ask you about the detailed flow for correctly replicating your issue? But if my understanding of your error line, I apologize. – Tanaike Nov 22 '21 at 00:20
  • @Tanaike I am encountering the error of now being able to access the new generated DOC file with URL:HttpError 400 when requesting https://docs.googleapis.com/v1/documents/1ON3u_SSf33ow-AkzAf01yMl0RrgXIdUT:batchUpdate?fields=&alt=json After it's merged has completed – Hani Nov 23 '21 at 13:48
  • Thank you for replying. I have to apologize for my poor English skill, again. Unfortunately, I cannot still understand your question. But I would like to try to understand it. When I could correctly understand it, I would like to think of the solution. I would be grateful if you can forgive my poor English skill. – Tanaike Nov 23 '21 at 22:56
  • @Tanaike That is absolutely fine sir, my question is: i am trying to implement MailMerge function using google docs and google sheets. I have used all code requirements from https://developers.google.com/docs/api/samples/mail-merge . Refer to my GitHub link to understand my process more, For now my problem is That i have an HTTP400 Error when my code is trying to access the newly created document. – Hani Nov 26 '21 at 14:58

0 Answers0