API patch call request to update document language fails

When things don't work as they should.
Post Reply
bwakkie
50 Posts
50 Posts
Posts: 70
Joined: Fri Feb 14, 2020 8:28 pm

API patch call request to update document language fails

Post by bwakkie »

Hi,

I moved on with my project to automatically detect the language of any stored document (image).
After finding a language other than the current (default) language I'd like to update the document language with the following python command:

Code: Select all

...
        if lang != found_language:
            try:
                session.patch('http://127.0.0.1/docs/api/v4/documents/'
                              + doc_id,
                              data={'language': found_language})
...
The code runs without any problem, I do not get any exception.

The event log of the particular document seems to be fine:

Date and time: May 30, 2022, 9:14 a.m.
Actor: languagedetect_user
Event: Document edited

The role the language_user is in had the "Edit document properties" permission among


But in the document properties, the language has not been changed.

Any tips? Is this the correct way to pass the data?
bwakkie
50 Posts
50 Posts
Posts: 70
Joined: Fri Feb 14, 2020 8:28 pm

Re: API patch call request to update document language fails

Post by bwakkie »

For now unfortunately I just save the new language directly in the DB. So no event is stored.
Post Reply