I am using the python SDK for Dropbox to make updates to 'Dropbox Paper' documents. In order to achieve this I need to be able to get the latest file revision number.
This can be done using files_list_revisions
but I cannot get it to work. I've spent hours troubleshooting and I'm at a total loss. I'm trying to get the revisions using the doc id instead of the file path which appears to be possible according to documentation. To my knowledge Dropbox Paper files do not have file paths so using the doc id is the only way to go.
currently my code looks like this...
import dropbox
from dropbox.files import ListRevisionsMode
dbx = dropbox.Dropbox('YOUR_ACCESS_TOKEN')
dbx.files_list_revisions('my_doc_id', mode=ListRevisionsMode('my_doc_id'))
this returns AssertionError: Invalid tag
I have also tried
dbx.files_list_revisions('my_doc_id', mode=ListRevisionsMode.id)
which returns
dropbox.stone_validators.ValidationError: 'my_doc_id' did not match pattern '/(.|[\r\n])*|id:.*|(ns:[0-9]+(/.*)?)'
The goal is to get the latest revision number and then update the Paper doc using
dbx.paper_docs_update(data_to_append, 'append', revision_num, 'plain_text')
Update:
I read the regex pattern from the second error and it appears the file id should be written like this id:my_doc_id
I made this correction and got a new error.
dropbox.exceptions.ApiError: ApiError('my_doc_id', ListRevisionsError('path', LookupError('not_found', None)))