<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using curl to bulk upload users with JSON file in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/using-curl-to-bulk-upload-users-with-json-file/m-p/316653#M3654</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm wondering if it's possible to upload many users to my Nuxeo instance by using Curl on a local JSON file. It's certainly possible for a single user, as I've already attempted.&lt;/P&gt;
&lt;P&gt;' curl -u "Administrator:Administrator" -H "Content-Type: application/json" -d @/home/Desktop/BulkUserImports.json &lt;A href="http://localhost:8080/nuxeo/api/v1/user" target="test_blank"&gt;http://localhost:8080/nuxeo/api/v1/user&lt;/A&gt; '&lt;/P&gt;
&lt;P&gt;I  get the following exception with the JSON file below -&lt;/P&gt;
&lt;P&gt;{"entity-type":"exception","code":"org.nuxeo.ecm.core.io.registry.MarshallingException","status":500,"message":"Json does not contain an object as expected"}&lt;/P&gt;
&lt;P&gt;Is my JSON file not formatted properly for multiple user objects?&lt;/P&gt;
&lt;P&gt;---- Begin JSON ----&lt;/P&gt;
&lt;P&gt;[
{
"entity-type": "user",
"properties":
{
"username": "fourthUser",
"lastName": "User",
"firstName": "Fourth"
}
},
{
"entity-type": "user",
"properties":
{
"username": "secondUser",
"lastName": "User",
"firstName": "Second"
}
}
]&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Yousuf&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Fri, 04 Mar 2016 22:55:50 GMT</pubDate>
    <dc:creator>Yousuf_Nejati</dc:creator>
    <dc:date>2016-03-04T22:55:50Z</dc:date>
    <item>
      <title>Using curl to bulk upload users with JSON file</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/using-curl-to-bulk-upload-users-with-json-file/m-p/316653#M3654</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm wondering if it's possible to upload many users to my Nuxeo instance by using Curl on a local JSON file. It's certainly possible for a single user, as I've already attempted.&lt;/P&gt;
&lt;P&gt;' curl -u "Administrator:Administrator" -H "Content-Type: application/json" -d @/home/Desktop/BulkUserImports.json &lt;A href="http://localhost:8080/nuxeo/api/v1/user" target="test_blank"&gt;http://localhost:8080/nuxeo/api/v1/user&lt;/A&gt; '&lt;/P&gt;
&lt;P&gt;I  get the following exception with the JSON file below -&lt;/P&gt;
&lt;P&gt;{"entity-type":"exception","code":"org.nuxeo.ecm.core.io.registry.MarshallingException","status":500,"message":"Json does not contain an object as expected"}&lt;/P&gt;
&lt;P&gt;Is my JSON file not formatted properly for multiple user objects?&lt;/P&gt;
&lt;P&gt;---- Begin JSON ----&lt;/P&gt;
&lt;P&gt;[
{
"entity-type": "user",
"properties":
{
"username": "fourthUser",
"lastName": "User",
"firstName": "Fourth"
}
},
{
"entity-type": "user",
"properties":
{
"username": "secondUser",
"lastName": "User",
"firstName": "Second"
}
}
]&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Yousuf&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 04 Mar 2016 22:55:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/using-curl-to-bulk-upload-users-with-json-file/m-p/316653#M3654</guid>
      <dc:creator>Yousuf_Nejati</dc:creator>
      <dc:date>2016-03-04T22:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using curl to bulk upload users with JSON file</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/using-curl-to-bulk-upload-users-with-json-file/m-p/316654#M3655</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;After some further research and attempts, it seems that this is not possible (if anyone here knows otherwise, please feel free to comment) .&lt;/P&gt;
&lt;P&gt;So, I scratched the whole JSON file idea and instead created a simple command line Java program that parses the original CSV input file and builds an executable file containing sequential curl statements (1-50) on the Desktop. I then execute the file via the terminal ("./myBulkCreateUserCurlRequests.sh") and it then creates the users in my Nuxeo instance.&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;-Yousuf&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2016 20:53:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/using-curl-to-bulk-upload-users-with-json-file/m-p/316654#M3655</guid>
      <dc:creator>Yousuf_Nejati</dc:creator>
      <dc:date>2016-03-08T20:53:51Z</dc:date>
    </item>
  </channel>
</rss>

