AlexandraShvarts
Posts: 1
Joined: Thu Aug 08, 2019 11:04 pm

Update users info with Simple HTTP API (import_server_config)

Postby AlexandraShvarts » Thu Aug 08, 2019 11:23 pm

Hello,
I need to update periodically clover users info or add some new users from some remote service. I've tried to use import_server_config for this. And it is ok with user names, domains, passwords and usergroups. But when I try to write email, first name and last name, I receive this error:

[org.xml.sax.SAXParseException; lineNumber: 7; columnNumber: 27; cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://cloveretl.com/server/data":firstName}'. One of '{"http://cloveretl.com/server/data":password, "http://cloveretl.com/server/data":passwordA1Digest, "http://cloveretl.com/server/data":userGroups}' is expected.]

If I leave these fields empty, they become empty on server too.

Here is an example of xml, I send to server

Code: Select all

<?xml version='1.0' encoding='UTF-8'?>
<cs:cloverServerConfiguration xmlns:cs="http://cloveretl.com/server/data" cloverVersion="5.2.0.30" exporter="acc_mgmt_test" timeZone="Europe/Moscow" timestamp="2019-08-08T12:50:12.471+03:00">
    <cs:usersList>
       <cs:user disabled="false">
            <cs:username>test_user</cs:username>
            <cs:domain>LDAP</cs:domain>
            <cs:password>password</cs:password>
            <cs:firstName>John</cs:firstName>
             <cs:lastName>Doe</cs:lastName>
            <cs:email>jonny@mail.com</cs:email>
            <cs:userGroups>
                <cs:groupCode>admin</cs:groupCode>
            </cs:userGroups>
        </cs:user>
    </cs:usersList>
</cs:cloverServerConfiguration>


We've added as many suitable permissions as possible, but they didn't help.

Is it even possible to change/add such user info (email, first name and last name) using import_server_config? If not is there any other way?

Thankn you

darvehng
Posts: 8
Joined: Mon Apr 08, 2019 4:40 pm

Re: Update users info with Simple HTTP API (import_server_config)

Postby darvehng » Thu Aug 15, 2019 3:23 pm

Hi Alexandra,

Thank you for your inquiry. The reason why you're getting that error is because the element definitions for user information has to be in a specific order in order for CloverDX Server to properly parse the file. The XSD Schema (a file that defines the structure of an XML document) requires this. Below is an example of how the file for import_server_config is supposed to look. I changed the timeZone settings in the original file you provided to reflect my time zone, so you can go ahead and change it back to reflect yours. Please let us know the results when you import it.

Code: Select all

<?xml version='1.0' encoding='UTF-8'?>
<cs:cloverServerConfiguration xmlns:cs="http://cloveretl.com/server/data" cloverVersion="5.2.0.30" exporter="acc_mgmt_test" timeZone="America/New_York" timestamp="2019-08-12T14:13:00.439-04:00">
   <cs:usersList>
     <cs:user disabled="false">
      <cs:username>test_user</cs:username>
       <cs:firstName>John</cs:firstName>
       <cs:lastName>Doe</cs:lastName>
      <cs:email>jonny@mail.com</cs:email>
      <cs:domain>clover</cs:domain>
      <cs:password>password</cs:password>
      <cs:userGroups>
         <cs:groupCode>admin</cs:groupCode>
      </cs:userGroups>
   </cs:user>
   </cs:usersList>
</cs:cloverServerConfiguration>


Best Regards,
---
George Darvehn
CloverCARE Support
CloverDX

Visit us online at http://www.cloverdx.com