Create document creating empty "Document stub"

Anything concerning integration via the REST API
Post Reply
ManuelR
Posts: 3
Joined: Fri Mar 11, 2022 11:36 pm

Create document creating empty "Document stub"

Post by ManuelR »

Hello,

I am adding new documents using the API `{baseurl}/api/v4/documents/`. The result is a 201 (Created) with some information in the body [1] but it looks incomplete. When using the web UI it displays the new document as a "Document stub, id:{newid}". I have tried creating new documents using the web UI and those work fine. I checked the logs on the containers and none reported errors when using the API.

Using the API to retrieve the list of documents works, but the ones created using the API show no file-name or created-date.

Btw, I am using Postman, and the first document creations worked, but after some new files, no new creations are successful. I've also restarted all containers, but that didn't help with the problem.

Hope you can give me a hand.

Cheers,

- Manuel


[1]

Code: Select all

{
    "datetime_created": "2022-03-11T23:33:27.398271Z",
    "description": "",
    "document_change_type_url": "http://0.0.0.0:8000/api/v4/documents/36/type/change/",
    "document_type": {
        "delete_time_period": 30,
        "delete_time_unit": "days",
        "filename_generator_backend": "uuid",
        "filename_generator_backend_arguments": "",
        "id": 2,
        "label": "TestType",
        "quick_label_list_url": "http://0.0.0.0:8000/api/v4/document_types/2/quick_labels/",
        "trash_time_period": null,
        "trash_time_unit": null,
        "url": "http://0.0.0.0:8000/api/v4/document_types/2/"
    },
    "file_latest": null,
    "file_list_url": "http://0.0.0.0:8000/api/v4/documents/36/files/",
    "id": 36,
    "label": "",
    "language": "eng",
    "url": "http://0.0.0.0:8000/api/v4/documents/36/",
    "uuid": "a42642ec-5424-420f-8843-0d3dd17ab3b2",
    "version_active": null,
    "version_list_url": "http://0.0.0.0:8000/api/v4/documents/36/versions/"
}
User avatar
franco
Developer
Developer
Posts: 42
Joined: Sun Apr 05, 2020 2:30 am

Re: Create document creating empty "Document stub"

Post by franco »

Hello,

How did you deployed Mayan and what version?
ManuelR
Posts: 3
Joined: Fri Mar 11, 2022 11:36 pm

Re: Create document creating empty "Document stub"

Post by ManuelR »

Hi franco,

I followed the steps at https://docs.mayan-edms.com/chapters/do ... mpose.html to get it running using docker-compose. I modified the compose file and env file to not use Trafik and use an existing docker network.

From the env file I believe it used "MAYAN_DOCKER_IMAGE_NAME=mayanedms/mayanedms" and image version "MAYAN_DOCKER_IMAGE_TAG=s4.2".

Thank you for the help.

- Manuel
ManuelR
Posts: 3
Joined: Fri Mar 11, 2022 11:36 pm

Re: Create document creating empty "Document stub"

Post by ManuelR »

Thank you for your help. It was my mistake all along. That url creates empty documents. To upload files that create a document and corresponding file the url is {BaseUri}/documents/upload/.
Post Reply