Servlet: ImportMembers
API Support | Since PageSeeder | Last updated | Documentation Date |
---|---|---|---|
3.3100 | 4.9500 | 29 June 2022 |
Description
This servlet has been deprecated as of PageSeeder v6. Use Service: /groups/{group}/members/import [POST] instead.
Imports members from comma-separated data.
HTTP method: GET
Returns data to produce the form for importing members.
HTTP method: POST
Actually import the members into PageSeeder.
Import data
The data uses comma-separated values as:
[firstname],[surname],[email],[username?],[password?],[field1?], ... ,[field15?]
- If a value contains a comma, it should be wrapped by double quotes ".
- It is not possible to include a line delimiter in a value, line delimiters are automatically interpreted as a separate member.
- If the password is the encrypted form used in the PageSeeder database the encrypted password will be preserved. This is useful for migrating members to a different server but they must be exported using an SQL query.
To import the users into a group, use the group parameter. The membership details can be set using the notification, role and listed parameters.
Error handling
If a user already exists, the existing details are returned instead of the original details sent in the request. The details sent in the import data do NOT overwrite the existing data. The existing user will be added to a group if specified and they are not already a member of said group.
If the data is parsable, but a row has invalid data, it is returned as a failed user. Possible failures are:
- empty first name, surname or email (use
No Email
instead) - no email and no username (one is required)
- invalid or forbidden email
- first name or surname too long
- password too weak
- password missing for new members
If a parsing error occurs, this method returns an error message with HTTP status 400 (Bad Request).
XML output
The returned XML is in the form:
<root> <group><!-- Group --></group> <totalread>[lines read]</totalread> <created> <member><!-- Created Member #1 --></member> <member><!-- Created Member #2 --></member> <member><!-- Created Member #3 --></member> ... </created> <failed> <memberdetails><!-- Failed Member #1 --></memberdetails> <memberdetails><!-- Failed Member #2 --></memberdetails> <memberdetails><!-- Failed Member #3 --></memberdetails> ... </failed> <existing> <memberdetails><!-- Existing Member #1 --></memberdetails> <memberdetails><!-- Existing Member #2 --></memberdetails> <memberdetails><!-- Existing Member #3 --></memberdetails> ... </existing> </root>
HTTP parameters
Name | Description | Required | Type | Default |
---|---|---|---|---|
data | The data to import (required) | yes | String | |
group | The name of the group the users should be imported into | no | String | |
notification | The default notification for the users (applicable only if group is specified) | no | String | immediate |
role | The default role for the users (applicable only if group is specified) | no | role | group's default |
listed | Whether to list the email address of the imported users (applicable only if group is specified) | no | boolean | false |
createpersonal | Whether to create a Personal group for the user on import | no | boolean | false |
Notification
The notification parameter must be one of immediate
, essential
, daily
, weekly
or none
. Users are able to change this setting at another time through the user interface in their group registration options.
Role
The role parameter must be one of guest
, reviewer
, contributor
, manager
, approver
.