Modify the API settings only in a specific context?


(Coin-coin le Canapin) #1

Hi. I would like to import a lot of topics/messages into Discourse. To do this I use the API.
In order to do that without any issue, I’d like to modify various API settings, but I don’t want to modify the global settings to do so. I just want to remove the limit for that specific task or user, but not in other contexts. Is such a thing possible?


(Jay Pfaffman) #2

If it’s a new forum, then you want to use an importer script rather than the API.

If you use an admin user with the API, most limits are not imposed.


(Coin-coin le Canapin) #3

Thank you for your reply. Is there a way to use an admin API as api_username but assign a different message author in the parameters?


(Jay Pfaffman) #4

There are some threads about that. I don’t remember much other than it was difficult. I think what you do is create it as the admin and then change the owner, maybe.

Is this something that you will want to do always throughout the course of using Discourse, or is it a one-time thing? If it’s the latter, you really, really want to use an import script rather than the API.


(Vinoth Kannan) #5

Yes, it is possible. Try to play around with the code and explore the documentation. Still it is better to use import script specially if you have large amount of data.