Import Users
PUT /import/users
Bulk users import
PUT /rest/import/users?{test}
Parameters:
Name | Type | Description |
---|---|---|
test | boolean | If true, users are not saved, simple request check for correctness. |
Request body xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="list">
<xs:complexType>
<xs:sequence>
<xs:element name="user" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute type="xs:string" name="login" use="required"/>
<xs:attribute type="xs:string" name="fullName" use="optional"/>
<xs:attribute type="xs:string" name="email" use="required"/>
<xs:attribute type="xs:string" name="jabber" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Response body xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="importReport">
<xs:complexType>
<xs:sequence>
<xs:element name="item" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="error" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="fieldName" use="optional"/>
<xs:attribute type="xs:string" name="value" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="id"/>
<xs:attribute type="xs:boolean" name="imported"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Sample
Request:
PUT /rest/import/users?test=true
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<list>
<user login="gregory" fullName="Harriet Gregory" email="harriet.gregory@acme.com"/>
<user login="elliott" fullName="Leona Elliott" email="leona.elliott@acme.com"/>
<user login="burton" fullName="Antonia Burton" email="antonia.burton@acme.com"/>
<user login="pena" fullName="Leon Pena" email="leon.pena@acme.com"/>
<user login="ray" fullName="Wilson Ray" email="wilson.ray@acme.com"/>
<user login="mcdonald" fullName="Judith Mcdonald" email="judith.mcdonald@acme.com"/>
<user login="mendoza" fullName=" Dexter Mendoza" email="dexter.mendoza@acme.com"/>
<user login="webster" fullName="Tonya Webster" email="tonya.webster@acme.com" jabber="tonya.webster@acme.com"/>
</list>
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<importReport>
<item imported="false" id="gregory">
<error fieldName="login" value="gregory">Value is not unique</error>
</item>
<item imported="true" id="elliott"/>
<item imported="true" id="burton"/>
<item imported="true" id="pena"/>
<item imported="true" id="ray"/>
<item imported="true" id="mcdonald"/>
<item imported="true" id="mendoza"/>
<item imported="true" id="webster"/>
</importReport>
Last modified: 30 March 2021