title: Delete artifacts after searching old artifacts in JFROG
body: <p>I need to write a shell script, that can get outdated artifacts from JFROG by using REST API and delete them.</p>
  
  <p>I get a list of artifacts by command</p>
  
  <pre><code>curl -u user:password "http://artifactory:8081/artifactory/api/search/dates?dateFields=created&amp;from=1467052559000&amp;to=1497588559000&amp;repos=current-repo"
  </code></pre>
  
  <p>and get an output like</p>
  
  <pre><code>"results" : [ {
      "uri" : "http://artifactory:8081/artifactory/api/storage/current-repo/first artifact/artfoulder folder/file.tzs",
      "created" : "2017-04-10T11:33:50.190+03:00"
    }, {
      "uri" : "http://artifactory:8081/artifactory/api/storage/current-repo/second artifact/artfoulder folder/file2.tzs",
      "created" : "2017-04-10T11:33:50.140+03:00"
    } ]
  </code></pre>
  
  <p>and other artifacts</p>
  
  <p>After I successfully got the list of these artifacts, I need to delete them.</p>
  
  <p>My questions:</p>
  
  <ol>
  <li>Is there a simple way to do it? Or I need to parse output strings with shell, put links in array and delete by REST API command one by one?</li>
  <li>It there a way to get only first-level artifact folders, that are outdated and delete them (<strong>first artifact</strong> and <strong>second artifact</strong> in my case)</li>
  </ol>
  
  <p>Thanks a lot in advance!</p>