Open stepanov1975 opened 2 years ago
Ah, I think the script is not updated to API changes. This line here needs to change, I think: https://github.com/eikek/docspell/blob/cff2321ecacaa1bcfc5e75f2d72faf5c90bf35d5/tools/import-paperless/import-paperless.sh#L145
The current api for creating a new organization is here: https://docspell.org/openapi/docspell-openapi.html#operation/sec-org-new
I think we need to add additional data to the json payload. Can you try to add "shortName":"", "use":"correspondent"
to the json data in that line (after "created":0
)?
@eikek thanks for the replay I changed line 145 to look like this:
curl_call "-s -X POST '$ds_url/api/v1/sec/organization' -H 'Content-Type: application/json' -d '{\"id\":\"\",\"name\":\"${tmp_result_arr[name]}\",\"address\":{\"street\":\"\",\"zip\":\"\",\"city\":\"\",\"country\":\"\"},\"contacts\":[],\"created\":0,"shortName":"","use":"correspondent"}'"
I am still getting the same error It seems the error is during parsing of the Paperless database
Yes, that is also an option! I thought the error was given by jq
(when reading invalid json). Unfortunately I can't test this script myself so I'm not of good help :/ I think I would try looking into some variables near this place; and maybe playing with that curl command manually. The script was written some time ago, it may be not up to date with respect to the paperless data model and also docspells api. You can also watch the restserver logs when this script is running. It should mention invalid requests, for example.
@eikek Although I do some programming, I just don't have time to dig into both programs to fix the script. I hope you will find some time :) I have a lot of documents in Paperless.
Hi @stepanov1975 sure, fair enough. I don't use paperless and don't have it installed. So I won't be able to fix it. I'll add a note to the docs that it doesn't work right now. Maybe someone with paperless can look into it at some point.
Hi,
I am trying to import my documents from paperless. When I run import-paperless.sh it fails with the following error: parse error: Invalid numeric literal at line 1, column 4
I am using paperless 1.5.0
Full script output: