Add users in bulk via spreadsheet or link
-
wrote on Jan 4, 2022, 10:39 PM last edited by girish Jan 4, 2022, 10:42 PM
I am using Cloudron to manage a university class with 250+ students. I wonder if there is a way to easily add all the students to a specific group, without having to add them manually one by one. For instance, can I:
- Send them a magic link that they can use to create a new account in a given group?
- Import them via a csv file or the like?
Thanks for your help.
-
I am using Cloudron to manage a university class with 250+ students. I wonder if there is a way to easily add all the students to a specific group, without having to add them manually one by one. For instance, can I:
- Send them a magic link that they can use to create a new account in a given group?
- Import them via a csv file or the like?
Thanks for your help.
@ntnsndr yes, this is coming in the next release as part of the import/export feature - https://forum.cloudron.io/topic/5982/what-s-coming-in-cloudron-7-1
-
I am using Cloudron to manage a university class with 250+ students. I wonder if there is a way to easily add all the students to a specific group, without having to add them manually one by one. For instance, can I:
- Send them a magic link that they can use to create a new account in a given group?
- Import them via a csv file or the like?
Thanks for your help.
@ntnsndr said in Add users in bulk via spreadsheet or link:
Send them a magic link that they can use to create a new account in a given group?
this part might have to be automated via some curl calls though. Maybe we can add a "checkbox" in the import UI to invite users as well (cc @nebulon )
-
I am using Cloudron to manage a university class with 250+ students. I wonder if there is a way to easily add all the students to a specific group, without having to add them manually one by one. For instance, can I:
- Send them a magic link that they can use to create a new account in a given group?
- Import them via a csv file or the like?
Thanks for your help.
wrote on Jan 5, 2022, 11:56 AM last edited by@ntnsndr said in Add users in bulk via spreadsheet or link:
Send them a magic link that they can use to create a new account in a given group?
This would be awesome.
-
I am using Cloudron to manage a university class with 250+ students. I wonder if there is a way to easily add all the students to a specific group, without having to add them manually one by one. For instance, can I:
- Send them a magic link that they can use to create a new account in a given group?
- Import them via a csv file or the like?
Thanks for your help.
Partnerwrote on Jan 5, 2022, 2:03 PM last edited by BrutalBirdie Jan 5, 2022, 3:12 PMHere is what I did once for ~200 Users which I also had in a CSV. Converted the CSV to JSON.
Python
import json from pprint import pprint import requests data = [ { "Surname": "Testing", "Name": "Tina", "Login": "tina.testing", "Mail": "tina.testing@domain.tld", "Password": "_SUPER_SECURE_CLEAR_TEXT_PASSWORD_" } ] url="https://my.DOMAIN.TLD/api/v1/users" headers = { "Content-Type": "application/json", "Authorization": "Bearer CLOUDRON_API_TOKEN" } for value in data: values= { "email": value["Mail"], "displayName": f'{value["Name"]} {value["Surname"]}', "role": "user", "username": value["Login"], "password": value["Password"], "admin": False } jdata = json.dumps(values) try: # pprint(data) r = requests.post(url, data=jdata, headers=headers) except Exception as e: pprint(e)
I had no need for group mapping that is why the group
user
is hard coded and not mapped from the values.If you can convert your CSV to fit JSON Object required for the request it should be even easier.
{ "email": "jjnTB@eOvbuuolIyPahhKbpYAXiYncqvbIQQ.tl", "username": "cillum do dolore cupidatat", "displayName": "in dolore Lorem", "password": "nostrud Ut dolor consectetur", "admin": false }
https://docs.cloudron.io/api.html#tag/Users/paths/~1users/post
-
Here is what I did once for ~200 Users which I also had in a CSV. Converted the CSV to JSON.
Python
import json from pprint import pprint import requests data = [ { "Surname": "Testing", "Name": "Tina", "Login": "tina.testing", "Mail": "tina.testing@domain.tld", "Password": "_SUPER_SECURE_CLEAR_TEXT_PASSWORD_" } ] url="https://my.DOMAIN.TLD/api/v1/users" headers = { "Content-Type": "application/json", "Authorization": "Bearer CLOUDRON_API_TOKEN" } for value in data: values= { "email": value["Mail"], "displayName": f'{value["Name"]} {value["Surname"]}', "role": "user", "username": value["Login"], "password": value["Password"], "admin": False } jdata = json.dumps(values) try: # pprint(data) r = requests.post(url, data=jdata, headers=headers) except Exception as e: pprint(e)
I had no need for group mapping that is why the group
user
is hard coded and not mapped from the values.If you can convert your CSV to fit JSON Object required for the request it should be even easier.
{ "email": "jjnTB@eOvbuuolIyPahhKbpYAXiYncqvbIQQ.tl", "username": "cillum do dolore cupidatat", "displayName": "in dolore Lorem", "password": "nostrud Ut dolor consectetur", "admin": false }
https://docs.cloudron.io/api.html#tag/Users/paths/~1users/post
While at the topic
When you got A LOT of users it can become a pain to manage them.
Example if you want to create a Mailbox and then have to scroll threw ALL 200 Users to find the correct one, since there is no search. -
While at the topic
When you got A LOT of users it can become a pain to manage them.
Example if you want to create a Mailbox and then have to scroll threw ALL 200 Users to find the correct one, since there is no search.wrote on Jan 5, 2022, 7:01 PM last edited by robi Jan 5, 2022, 7:05 PM@brutalbirdie same for domains, email and most other UI features. Although a browser based search can be used to jump to the relevant parts via CTRL-F.
-
While at the topic
When you got A LOT of users it can become a pain to manage them.
Example if you want to create a Mailbox and then have to scroll threw ALL 200 Users to find the correct one, since there is no search.@brutalbirdie doesn't users and mailboxes UI both have a search?
-
@brutalbirdie doesn't users and mailboxes UI both have a search?
-
Here is what I did once for ~200 Users which I also had in a CSV. Converted the CSV to JSON.
Python
import json from pprint import pprint import requests data = [ { "Surname": "Testing", "Name": "Tina", "Login": "tina.testing", "Mail": "tina.testing@domain.tld", "Password": "_SUPER_SECURE_CLEAR_TEXT_PASSWORD_" } ] url="https://my.DOMAIN.TLD/api/v1/users" headers = { "Content-Type": "application/json", "Authorization": "Bearer CLOUDRON_API_TOKEN" } for value in data: values= { "email": value["Mail"], "displayName": f'{value["Name"]} {value["Surname"]}', "role": "user", "username": value["Login"], "password": value["Password"], "admin": False } jdata = json.dumps(values) try: # pprint(data) r = requests.post(url, data=jdata, headers=headers) except Exception as e: pprint(e)
I had no need for group mapping that is why the group
user
is hard coded and not mapped from the values.If you can convert your CSV to fit JSON Object required for the request it should be even easier.
{ "email": "jjnTB@eOvbuuolIyPahhKbpYAXiYncqvbIQQ.tl", "username": "cillum do dolore cupidatat", "displayName": "in dolore Lorem", "password": "nostrud Ut dolor consectetur", "admin": false }
https://docs.cloudron.io/api.html#tag/Users/paths/~1users/post