Chapter 7. User

Table of Contents

Create
Update
Status

User management API

API to create internal BDOM user

Generic reference:

/user/OPCODE/OWNER_ID/USER_ID/

Where:

OPCODE(operation type) availables values:create,update
OWNER_ID: Your specific owner id assigned by BDOM system
USER_ID: The id assigned to user by BDOM system

Create

Description: Create a new User.

Reference: /bdom/user/create/OWNERID/-/

Operation Type: PUT

Validation XSD

Validator

Example 7.1. User validation XSD:

Source:

      
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified">
    <xs:element name="request">
        <xs:complexType>
            <xs:all>
                <xs:element name="first-name" type="xs:string" />
                <xs:element name="last-name" type="xs:string" />
                <xs:element name="middle-name" type="xs:string" minOccurs="0"/>
                <xs:element name="sex" type="SexType" />
                <xs:element name="organisation" type="xs:string" />
                <xs:element name="type" type="ContactType" />
                <xs:element name="street" type="xs:string" />
                <xs:element name="number" type="xs:string" />
                <xs:element name="postcode" type="xs:string" />
                <xs:element name="city" type="xs:string" />
                <xs:element name="region" type="xs:string" minOccurs="0"/>
                <xs:element name="country" type="CountryType" />
                <xs:element name="phone" type="PhoneType" />
                <xs:element name="extension" type="xs:string" minOccurs="0"/>
                <xs:element name="fax" type="PhoneType" minOccurs="0"/>
                <xs:element name="email" type="EmailType"/>
                <!-- the email for robot communications - optional -->
                <xs:element name="robomail" type="EmailType" minOccurs="0"/>
                <xs:element name="bank" type="xs:string" minOccurs="0"/>
                <xs:element name="account" type="xs:string"  minOccurs="0"/>
                <!-- BLZ -->
                <xs:element name="bank_code_nr" type="xs:string"  minOccurs="0"/>
                <xs:element name="account_owner" type="xs:string"  minOccurs="0"/>
                <xs:element name="vat" type="xs:string" minOccurs="0"/>
                <xs:element name="blocked" type="xs:int" />
                <xs:element name="password" type="PasswordType"/>
                <xs:element name="class" type="ClassType"/>
                <xs:element name="owner_id" type="xs:int"/>
                <!-- default 1 -->
                <xs:element name="need_conf" type="xs:int" minOccurs="0"/>
                <!-- default 0 -->
                <xs:element name="create_conf" type="xs:int" minOccurs="0"/>
                <!-- kunden id -->
                <xs:element name="kd_id" type="xs:int" minOccurs="0"/>
                <!-- default 1 -->
                <xs:element name="notified" type="xs:string" minOccurs="0"/>
                <!-- default 1 -->
                <xs:element name="owner_notified" type="xs:string" minOccurs="0"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <xs:simpleType name="ClassType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="subuser" />
            <xs:enumeration value="user" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="PasswordType">
        <xs:restriction base="xs:string">
            <xs:pattern value=".{6,50}" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="BoolType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="YES" />
            <xs:enumeration value="NO" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="CountryType">
        <xs:restriction base="xs:string">
            <xs:pattern value="[A-Z]{2}" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="NonEmptyString">
        <xs:restriction base="xs:string">
            <xs:minLength value="1"/>
            <xs:maxLength value="255"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="EmailType">
        <xs:restriction base="xs:string">
            <xs:pattern value="[_A-Za-z0-9\-]+(\.[_A-Za-z0-9\-]+)*@[A-Za-z0-9\-]+(\.[A-Za-z0-9\-]+)*(\.[A-Za-z]{2,})" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="PhoneType">
        <xs:restriction base="xs:string">
            <xs:pattern value="\+\d+\.\d+" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ContactType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="PERS" />
            <xs:enumeration value="ORG" />
            <xs:enumeration value="ROLE" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="SexType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="MALE" />
            <xs:enumeration value="FEMALE" />
            <xs:enumeration value="NA" />
        </xs:restriction>
    </xs:simpleType>

</xs:schema>

      
      

[Important]Important
Required Fields: first-name, last-name, sex, organisation, type, street, number, postcode, city, country, phone, email, blocked, password, class, owner_id
Optional Fields: middle-name, region, extension, fax, robomail, bank, account, bank_code_nr, account_owner, vat, need_conf, create_conf, kd_id, notified, owner_notified

Example 7.2. User Create:valid request

Minimal tags required to create a user.

REQUEST:

Generic Operation: PUT(http://backend.nic-direct.de/bdom/user/create/1/-/,xml)

Where xml:

        
<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <first-name>Otto</first-name>
  <last-name>Normalverbraucher</last-name>
  <sex>MALE</sex>
  <organisation>Acme CO</organisation>
  <type>PERS</type>
  <street>Main Street</street>
  <number>13</number>
  <postcode>55555</postcode>
  <city>New Stad</city>
  <country>DE</country>
  <phone>+040.012345678</phone>
  <email>otto@nictest.de</email>
  <blocked>0</blocked>
  <password>pass_test</password>
  <class>subuser</class>
  <owner_id>1</owner_id>
</request>
        
        

RESPONSE:

        
<response><user_id>13048</user_id><username>noota0001</username></response>
        
        

Example 7.3. User Create:invalid

Xml content from request fails to provide all requested tags

REQUEST:

Generic Operation: PUT(http://backend.nic-direct.de/bdom/user/create/1/-/,xml)

Where xml:

        
<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<type>PERS</type>
	<sex>MALE</sex>
	<first-name>John</first-name>
	<last-name>Doe</last-name>
	<middle-name></middle-name>
	<organisation>Acme CO</organisation>
	<street>Main Street</street>
	<number>13/Z</number>
	<postcode>55555</postcode>
	<city>New City</city>
	<region></region>
	<country>Germany</country>
	<phone>+040.0123456789</phone>
	<extension>11</extension>
	<fax>+40.1234567890</fax>
	<email>john@nictest.de</email>
	<bank>First Bank</bank>
	<account>0000001</account>
	<vat>19</vat>
	<blocked>0</blocked>
	<username>tstoonc</username>
	<password>pass_test</password>
	<class>user</class>
	<owner_id>1</owner_id>
	<need_conf>1</need_conf>
    <create_conf>0</create_conf>
</request>
        
         

RESPONSE:

        
<error-list>
<umsg>[XML_ERROR] XML error Validation error: Contents of element  request  do
	not match content model
	(userid?;first-name;last-name;middle-name?;sex;organisation;type;street;number;postcode;city;region?;country;phone;extension?;fax?;email;robomail?;bank?;account?;bank_code_nr?;account_owner?;vat?;blocked;username?;password?;class?;owner_id?;need_conf?;create_conf?;kd_id?;pgp_pubkey?;pgp_name?;active?;notified?)
	.</umsg>
<error>
	<code>406</code>
	<msg>[OBJECT_ERROR] Error [XML_ERROR] XML error Validation error:
	Contents of element  request  do not match content model
	(userid?;first-name;last-name;middle-name?;sex;organisation;type;street;number;postcode;city;region?;country;phone;extension?;fax?;email;robomail?;bank?;account?;bank_code_nr?;account_owner?;vat?;blocked;username?;password?;class?;owner_id?;need_conf?;create_conf?;kd_id?;pgp_pubkey?;pgp_name?;active?;notified?)
	.</msg>
</error>
</error-list>
        
        

Update

Description: Update a User data

Reference: /bdom/user/update/USER_ID/OWNER_ID/

Operation Type: POST

Where:

OWNER_ID: Your specific owner id assigned by BDOM system
USER_ID: The id assigned to user by BDOM system

Validation XSD:

Validator

Example 7.4. Contact Update validation XSD:

Source:

      
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified">
    <xs:element name="request">
        <xs:complexType>
            <xs:all>
                <xs:element name="userid" type="xs:int"/>
                <xs:element name="first-name" type="xs:string" />
                <xs:element name="last-name" type="xs:string" />
                <xs:element name="middle-name" type="xs:string" minOccurs="0"/>
                <xs:element name="sex" type="SexType" />
                <xs:element name="organisation" type="xs:string" />
                <xs:element name="type" type="ContactType" />
                <xs:element name="street" type="xs:string" />
                <xs:element name="number" type="xs:string" />
                <xs:element name="postcode" type="xs:string" />
                <xs:element name="city" type="xs:string" />
                <xs:element name="region" type="xs:string" minOccurs="0"/>
                <xs:element name="country" type="CountryType" />
                <xs:element name="phone" type="PhoneType" />
                <xs:element name="extension" type="xs:string" minOccurs="0"/>
                <xs:element name="fax" type="PhoneType" minOccurs="0"/>
                <xs:element name="email" type="EmailType"/>
                <!-- the email for robot communications - optional -->
                <xs:element name="robomail" type="EmailType" minOccurs="0"/>
                <xs:element name="bank" type="xs:string" minOccurs="0"/>
                <xs:element name="account" type="xs:string"  minOccurs="0"/>
                <!-- BLZ -->
                <xs:element name="bank_code_nr" type="xs:string"  minOccurs="0"/>
                <xs:element name="account_owner" type="xs:string"  minOccurs="0"/>
                <xs:element name="vat" type="xs:string" minOccurs="0"/>
                <xs:element name="blocked" type="xs:int" />
                <xs:element name="password" type="PasswordType"/>
                <xs:element name="owner_id" type="xs:int"/>
                <xs:element name="need_conf" type="xs:int"/>
                <!-- kunden id -->
                <xs:element name="kd_id" type="xs:int" minOccurs="0"/>
                <xs:element name="notified" type="xs:string"/>
                <xs:element name="owner_notified" type="xs:string"/>
                <xs:element name="active" type="xs:string"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <xs:simpleType name="PasswordType">
        <xs:restriction base="xs:string">
            <xs:pattern value=".{6,50}" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="BoolType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="YES" />
            <xs:enumeration value="NO" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="CountryType">
        <xs:restriction base="xs:string">
            <xs:pattern value="[A-Z]{2}" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="NonEmptyString">
        <xs:restriction base="xs:string">
            <xs:minLength value="1"/>
            <xs:maxLength value="255"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="EmailType">
        <xs:restriction base="xs:string">
            <xs:pattern value="[_A-Za-z0-9\-]+(\.[_A-Za-z0-9\-]+)*@[A-Za-z0-9\-]+(\.[A-Za-z0-9\-]+)*(\.[A-Za-z]{2,})" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="PhoneType">
        <xs:restriction base="xs:string">
            <xs:pattern value="\+\d+\.\d+" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="ContactType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="PERS" />
            <xs:enumeration value="ORG" />
            <xs:enumeration value="ROLE" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="SexType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="MALE" />
            <xs:enumeration value="FEMALE" />
            <xs:enumeration value="NA" />
        </xs:restriction>
    </xs:simpleType>

</xs:schema>
      
      

[Important]Important
Required Fields: userid, first-name, last-name, sex, organisation, type, street, number, postcode, city, country, phone, email, blocked, password, class, owner_id, need_conf, notified, owner_notified, active
Optional Fields: middle-name, region, extension, fax, robomail, bank, account, bank_code_nr, account_owner, vat, kd_id

Example 7.5. User Update:valid(change password)

Change password from pass_test to new_pass_test

REQUEST:

Generic Operation: POST(http://backend.nic-direct.de/bdom/user/update/1/13048/,xml)

Where xml:

        
<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <userid>13048</userid>
  <first-name>Otto</first-name>
  <last-name>Normalverbraucher</last-name>
  <sex>MALE</sex>
  <organisation>Acme Gmbh</organisation>
  <type>PERS</type>
  <street>Main Strasse</street>
  <number>13</number>
  <postcode>555555</postcode>
  <city>Newe Stad</city>
  <country>DE</country>
  <phone>+040.0123456789</phone>
  <email>otto@nictest.de</email>
  <blocked>0</blocked>
  <password>new_pass</password>
  <class>subuser</class>
  <owner_id>1</owner_id>
  <need_conf>0</need_conf>
  <notified>0</notified>
  <owner_notified>0</owner_notified>
  <active>1</active>
</request>
        
        

RESPONSE:

        
<response>1 updated</response>
        
        

Example 7.6. User Update:invalid

Wrong http method used in call

REQUEST:

Generic Operation: PUT(http://backend.nic-direct.de/bdom/user/update/1/13048/,xml)

Where xml:

        
<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <userid>13048</userid>
  <first-name>Otto</first-name>
  <last-name>Normalverbraucher</last-name>
  <sex>MALE</sex>
  <organisation>Acme Gmbh</organisation>
  <type>PERS</type>
  <street>Main Strasse</street>
  <number>13</number>
  <postcode>555555</postcode>
  <city>Newe Stad</city>
  <country>DE</country>
  <phone>+040.0123456789</phone>
  <email>otto@nictest.de</email>
  <blocked>0</blocked>
  <password>new_new_pass</password>
  <class>subuser</class>
  <owner_id>1</owner_id>
  <need_conf>0</need_conf>
  <notified>0</notified>
  <owner_notified>0</owner_notified>
  <active>1</active>
</request>
        
        

RESPONSE:

        
<error-list>
  <umsg>Wrong opcode for method or invalid opcode in uri /bdom/user/update/1/13048/</umsg>
  <error>
    <code>400</code>
    <msg>[OBJECT_ERROR] Error Wrong opcode for method or invalid opcode in uri /bdom/user/update/1/13048/</msg>
  </error>
</error-list>
      
        

Status

Description: Get data for an existing user User.

Reference: /bdom/user/status/OWNER_ID/USER_ID/

Operation Type: GET

Where:

USER_ID: valid id assigned by BDOM system
OWNER_ID: valid id assigned by BDOM system

Example 7.7. User Status: Valid request

REQUEST

Generic Operation:

Request: GET(http:http://backend.nic-direct.de/bdom/user/status/1/13048/)

RESPONSE:

        
<response >
  <account></account>
  <active>1</active>
  <bank></bank>
  <blocked>0</blocked>
  <city>Newe Stad</city>
  <class>subuser</class>
  <country>DE</country>
  <email>otto@nictest.de</email>
  <first-name>Otto</first-name>
  <last-name>Normalverbraucher</last-name>
  <level>2</level>
  <need_conf>0</need_conf>
  <notified>0</notified>
  <number>13</number>
  <organisation>Acme Gmbh</organisation>
  <owner_id>1</owner_id>
  <owner_notified>0</owner_notified>
  <password>new_pass</password>
  <phone>+040.0123456789</phone>
  <postcode>555555</postcode>
  <region></region>
  <sex>MALE</sex>
  <street>Main Strasse</street>
  <type>PERS</type>
  <user_id>13048</user_id>
  <username>noota0001</username>
</response>
	  
	

Example 7.8. User Status: Invalid request

REQUEST

Generic Operation:

Request: GET(http:http://backend.nic-direct.de/bdom/user/status/2/13048/)

RESPONSE:

        
<error-list><umsg>User belongs to different owner</umsg><error><code>401</code><msg>[OBJECT_ERROR] Error User belongs to different owner</msg></error></error-list>