Export user's posts in csv
-
Hi.
i'm trying to export user's post by this api: api/user/{userslug}/export/posts but i receive 404You seem to have stumbled upon a page that does not exist. Return to the home page.
What's the problem ?
Tnx
-
I don't know much about this feature, maybe it needs to be enabled. Try searching "export" in the ACP
-
I have "used" this feature, years ago, when first testing NodeBB and it did work at that time. I'll check again in a moment....
Update: Yes, works fine for all of profiles, posts, and uploads on ... version... uhh... been so long... Yikes, v.1.12, fwiw.
Good luck! o/
-
This endpoint a bit confusingly doesn't actually export anything - it only lets you download a preexisting export.
The user needs to go to{forum url}/user/{userslug}/consent
and generate the exports first. This part isn't even in the write API - it's only available via socket.io.I filed an issue to add some way of actually exporting this data via the API here: https://github.com/NodeBB/NodeBB/issues/10834
EDIT: huh, it did actuallly work in 1.12. It was changed in 1.14 via this commit: https://github.com/NodeBB/NodeBB/commit/8383992dccf4c84fcc4fbb5cdb2b99d7f8637b6f
-
@gotwf The commit I linked is actually what caused the problem 2 years ago. The issue was just filed, and it's saturday after all, so I'd give it some more time
(though to be clear, the commit has a clear purpose: letting exports of larger amount of data be handled in a separate process means they won't grind the forum to a halt. But it did make the endpoints not actually run the export, which is the issue here) -