Trying to copy a course with material posts. Each time I get error 400. Below is what I'm doing and what I'm getting back. The files are in the new classrooms drive folder.
gam config debug_level 1 create course copyfrom $(sourceid) announcementstates "all" workstates "all" markpublishedasdraft true removeduedate true copytopics true teacher sweaver name "new class" copymaterialsfiles true materialstates "all"
send: b'POST /v1/courses/334970252415/courseWorkMaterials?fields=id&prettyPrint=true&alt=json HTTP/1.1\r\nHost:
classroom.googleapis.com\r\naccept: application/json\r\naccept-encoding: gzip, deflate\r\nuser-agent: GAMADV-XTD3 6.00.02 -
https://github.com/taers232c/GAMADV-XTD3 / Ross Scroggs <
ross.s...@gmail.com> / Python 3.9.2 final / Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.31 x86_64 / (gzip)\r\nx-goog-api-client: gdcl/2.0.2 gl-python/3.9.2\r\ncontent-type: application/json\r\ncontent-length: 718\r\nauthorization: Bearer (removed)\r\n\r\n'
send: b'{"title": "Videos 2019-20 Grade 6", "state": "PUBLISHED", "assigneeMode": "ALL_STUDENTS", "topicId": "325714186148", "materials": [{"driveFile": {"driveFile": {"id": "1Q9IOXFMlwcXXjHItwrH07iHzdun5cAKF"}, "shareMode": "VIEW"}}, {"driveFile": {"driveFile": {"id": "1SZEw3uL0iinnS9oh9LcL2-YzmsVMmf8W"}, "shareMode": "VIEW"}}, {"driveFile": {"driveFile": {"id": "1pMJKjsySDrP0S1brXLdeDJejZW8m8pSX"}, "shareMode": "VIEW"}}, {"driveFile": {"driveFile": {"id": "1oBY7bZwumWFeJfQ-rCjMjbNNWTO0tAt8os5e4YNHdqg"}, "shareMode": "VIEW"}}, {"driveFile": {"driveFile": {"id": "1NrP3wr54kVc2BI9_aIIYi7di5o_mJRx6"}, "shareMode": "VIEW"}}, {"driveFile": {"driveFile": {"id": "1g2OLe0RbeZ5eEx-vvCcKpiZwihaiIKmP"}, "shareMode": "VIEW"}}]}'
reply: 'HTTP/1.1 400 Bad Request\r\n'
header: Vary: Origin
header: Vary: X-Origin
header: Vary: Referer
header: Content-Type: application/json; charset=UTF-8
header: Content-Encoding: gzip
header: Date: Tue, 04 May 2021 18:50:20 GMT
header: Server: ESF
header: Cache-Control: private
header: X-XSS-Protection: 0
header: X-Frame-Options: SAMEORIGIN
header: X-Content-Type-Options: nosniff
header: Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
header: Transfer-Encoding: chunked
ERROR: JSON: {'error': {'code': 400, 'message': 'Request contains an invalid argument.', 'status': 'INVALID_ARGUMENT'}}+
ERROR: 400: invalidArgument - Request contains an invalid argument.