<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Sean,<br>
    <br>
    I've written the script for you. It will be in
    /opt/zendto/bin/autolist. Run it without any command-line parameters
    to see the usage. It will dump a huge JSON structure as its output.
    If you pipe its output through the "jq" command, it will be nicely
    laid out for you.<br>
    And see<br>
        zend.to/automation.php<br>
    to learn about the automation scripts in general, and what you need
    to configure before you can use them.<br>
    <br>
    This will be in the next beta release, which will probably happen
    tomorrow now.<br>
    <br>
    Cheers,<br>
    Jules.<br>
    <br>
    <div class="moz-cite-prefix">On 27/05/2020 10:55, Cole, Sean wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:WM!43db909b2c2b80d8adb0eaf6c21deab3c9dfe9d6a1ad320ef3983cc5ee12e9523c174b24b9f38056a3be8620c30d9003!@mx.jul.es">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
      <p>I thought about the risk as well.  We are more interested in
        automating the process, so yes another "autolist" script that
        dumped the details of every single drop-off in the system would
        be useful. We will use firewall rules and permissions to
        restrict the access.</p>
      <p> </p>
      <p>Again Thanks for your assistance.</p>
      <p>Sean</p>
      <div style="color: rgb(33, 33, 33);">
        <hr tabindex="-1" style="width: 98%; display: inline-block;">
        <div id="divRplyFwdMsg" dir="ltr"><font style="font-size: 11pt;"
            face="Calibri, sans-serif" color="#000000"><b>From:</b>
            Jules <a class="moz-txt-link-rfc2396E" href="mailto:Jules@Zend.To"><Jules@Zend.To></a><br>
            <b>Sent:</b> Wednesday, May 27, 2020 4:30 AM<br>
            <b>To:</b> Cole, Sean; ZendTo Users<br>
            <b>Subject:</b> Re: [ZendTo] AutoPickUp</font>
          <div> </div>
        </div>
        <div>Sean,<br>
          <br>
          Would another "autolist" script that dumped the details of
          every single drop-off in the system, as 1 big JSON structure,
          do what you need?<br>
          <br>
          Then you can use your own code to search the data for the
          drop-offs you're looking for, get the ClaimID and Passcode of
          the relevant ones, then use "autopickup" to download them.<br>
          <br>
          Having that script exist at all is risky, in my view, as it
          gives anyone who gets access to it "the keys to the castle
          vault". But then again if, like most people, you're using
          SQLite3 then it's just saving a hacker the step of working out
          how the DB schema works. Which would take someone competent
          about 10 minutes. It's very simple and obvious.<br>
          <br>
          Let me know if that would be a good solution for you.<br>
          <br>
          Cheers,<br>
          Jules.<br>
          <br>
          <div class="moz-cite-prefix">On 26/05/2020 21:32, Cole, Sean
            wrote:<br>
          </div>
          <blockquote type="cite">
            <style type="text/css">
<!--
p
        {margin-top:0px;
        margin-bottom:0px}
-->
</style>
            <p>We are basically looking to have our students drop
              documents off and don't want the staff to have to go to
              their email click on the link to ZendTo, then download the
              file, then place it in the folder where it has to go.  We
              want o have an automated process to check for any
              documents a student may have dropped off every 10
              minutes.  Pick them up and put them in the necessary
              folder on the server.</p>
            <p> </p>
            <p>Thanks for any help you can provide.</p>
            <p>Sean Cole<font size="2">  </font></p>
            <div style="color: rgb(0, 0, 0); font-family:
              Calibri,Arial,Helvetica,sans-serif; font-size: 12pt;
              background-color: rgb(255, 255, 255);" dir="ltr">
              <hr tabindex="-1" style="width: 98%; display:
                inline-block;">
              <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:
                  11pt;" face="Calibri, sans-serif" color="#000000"><b>From:</b>
                  Cole, Sean<br>
                  <b>Sent:</b> Tuesday, May 26, 2020 1:56 PM<br>
                  <b>To:</b> Jules; ZendTo Users<br>
                  <b>Subject:</b> Re: [ZendTo] AutoPickUp</font>
                <div> </div>
              </div>
              <div>
                <p>Each Drop-off has a different claimID and passcode so
                  if you have 10 drop-offs how can you automate the
                  pickup if you don't have the unique claimID and
                  passcode for each of the 10 drop-offs?</p>
                <p> </p>
                <p>Thanks Again for you help,</p>
                <p>Sean Cole</p>
                <p> </p>
                <div style="color: rgb(33, 33, 33);">
                  <hr tabindex="-1" style="width: 98%; display:
                    inline-block;">
                  <div id="divRplyFwdMsg" dir="ltr"><font
                      style="font-size: 11pt;" face="Calibri,
                      sans-serif" color="#000000"><b>From:</b> Jules
                      <a class="moz-txt-link-rfc2396E"
                        href="mailto:Jules@Zend.To"
                        moz-do-not-send="true"><Jules@Zend.To></a><br>
                      <b>Sent:</b> Saturday, May 23, 2020 5:41 AM<br>
                      <b>To:</b> ZendTo Users<br>
                      <b>Cc:</b> Cole, Sean<br>
                      <b>Subject:</b> Re: [ZendTo] AutoPickUp</font>
                    <div> </div>
                  </div>
                  <div>Sean,<br>
                    <br>
                    Before using any of the scripts, you need to create
                    a user that will be only used for driving the
                    automation scripts of ZendTo. Don't use a real
                    user's account, create one just for the purpose.<br>
                    Put that username in the 'automationUsers' setting
                    in preferences.php.<br>
                    <br>
                    For this example, let's set a few things:<br>
                    - The automation user is going to have the username
                    "<tt>robot</tt>" with a password of "<tt>machines</tt>".<br>
                    - The claimID and passcode of the drop-off will be "<tt>aaaClaimIDaaa</tt>"
                    and "<tt>bbbPasscodebbb</tt>".<br>
                    - The address of your ZendTo site will be "<tt><a
                        class="moz-txt-link-freetext"
                        href="https://your-zendto-site.com/"
                        moz-do-not-send="true">https://your-zendto-site.com/</a></tt>".
                    The site address always goes at the very end of the
                    command, after all the other options.<br>
                    <br>
                    To see the command-line usage:<br>
                    <tt>    /opt/zendto/bin/autopickup --help</tt><br>
                    <br>
                    Fetch information about the drop-off, without
                    downloading anything:<br>
                    <tt>    /opt/zendto/bin/autopickup --username
                      "robot" --password "machines" --claimid
                      "aaaClaimIDaaa" --passcode "bbbPasscodebbb" --list
                      --nofiles
                      <a class="moz-txt-link-freetext"
                        href="https://your-zendto-site.com/"
                        moz-do-not-send="true">https://your-zendto-site.com/</a></tt><br>
                    <br>
                    Fetch all the files in the drop-off to the current
                    directory, verifying their checksums, and logging
                    that they were picked up by
                    <a class="moz-txt-link-rfc2396E"
                      href="mailto:user@yourdomain.com"
                      moz-do-not-send="true">"user@yourdomain.com"</a>:<br>
                    <tt>    /opt/zendto/bin/autopickup --username
                      "robot" --password "machines" --claimid
                      "aaaClaimIDaaa" --passcode "bbbPasscodebbb"
                      --checksum --pickedupby
                      <a class="moz-txt-link-rfc2396E"
                        href="mailto:user@yourdomain.com"
                        moz-do-not-send="true">"user@yourdomain.com"</a></tt><tt>
                      <a class="moz-txt-link-freetext"
                        href="https://your-zendto-site.com/"
                        moz-do-not-send="true">https://your-zendto-site.com/</a></tt><br>
                    <br>
                    Fetch all the files in the drop-off to the directory
                    "/var/tmp/downloads", not bothering with checksums
                    or logging who did it:<br>
                    <tt>    /opt/zendto/bin/autopickup --username
                      "robot" --password "machines" --claimid
                      "aaaClaimIDaaa" --passcode "bbbPasscodebbb"
                      --output "/var/tmp/downloads"</tt><tt>
                      <a class="moz-txt-link-freetext"
                        href="https://your-zendto-site.com/"
                        moz-do-not-send="true">https://your-zendto-site.com/</a></tt><br>
                    <br>
                    The output of the "--list --nofiles" command above
                    will give you a unique "fileid" number for each of
                    the files in the drop-off. So let's download file
                    number 123, verify its checksum and save it to the
                    file "~/Downloads/my-picked-up-file":<br>
                    <tt>    /opt/zendto/bin/autopickup --username
                      "robot" --password "machines" --claimid
                      "aaaClaimIDaaa" --passcode "bbbPasscodebbb" --file
                      123 --checksum --output
                      "~/Downloads/my-picked-up-file"</tt><tt>
                      <a class="moz-txt-link-freetext"
                        href="https://your-zendto-site.com/"
                        moz-do-not-send="true">https://your-zendto-site.com/</a></tt><br>
                    <br>
                    If you are using a locally-signed SSL certificate on
                    your ZendTo server, you may need to add the option<br>
                    <tt>    --insecure</tt><br>
                    to all of the above examples.<br>
                    <br>
                    To see the "curl" command it creates, which is what
                    does all the work, but not actually run anything,
                    add the option<br>
                    <tt>    --debug</tt><br>
                    to any of the above examples.<br>
                    <br>
                    Does that help?<br>
                    <br>
                    The point of me using "curl" is that all the script
                    really does is create all the parameters for an HTTP
                    POST request to your ZendTo server, and then pull
                    out the JSON results from the right header in the
                    returned data. The "<tt>--debug</tt>" option will
                    help you understand what it's doing.<br>
                    <br>
                    Once you have played with it a bit, take a look how
                    the script works (90% is just parsing the
                    command-line!) and you will see how you could use a
                    .Net http request to achieve the same result with
                    your own code running on a Windows server.<br>
                    <br>
                    Cheers,<br>
                    Jules.<br>
                    <br>
                    <div class="moz-cite-prefix">On 22/05/2020 20:25,
                      Cole, Sean via ZendTo wrote:<br>
                    </div>
                    <blockquote type="cite">
                      <style type="text/css">
<!--
p
        {margin-top:0px;
        margin-bottom:0px}
-->
</style>
                      <p>​Is anyone using the AutoPickUp Script?  Any
                        documentation on the use of the script or
                        examples. Trying to move the files uploaded from
                        the ZendTo server to a Windows server.<br>
                      </p>
                      <p><br>
                      </p>
                      <p>Regards,<br>
                      </p>
                      <div id="Signature">
                        <div style="margin: 0px; font-family:
                          Calibri,Arial,Helvetica,sans-serif;"
                          name="divtagdefaultwrapper">
                          <div class="BodyFragment"><font size="2">
                              <div class="PlainText">
                                <p class="MsoNormal"><b><span>Sean Cole</span></b></p>
                                <p class="MsoNormal"><span>Mgr. Network
                                    Services</span></p>
                                <p class="MsoNormal"><span style="color:
                                    rgb(127, 127, 127); font-size:
                                    10pt;"></span> </p>
                                <p class="MsoNormal"><span><a
                                      tabindex="0" id="NoLP"
                                      href="mailto:SeanCole@sunywcc.edu"
                                      moz-do-not-send="true"><font
                                        color="#0563c1">SeanCole@sunywcc.edu</font></a>
                                  </span></p>
                                <p class="MsoNormal"><span>914-606-6923</span></p>
                              </div>
                            </font></div>
                        </div>
                      </div>
                      <br>
                      <fieldset class="mimeAttachmentHeader"></fieldset>
                      <pre class="moz-quote-pre">_______________________________________________
ZendTo mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ZendTo@zend.to" moz-do-not-send="true">ZendTo@zend.to</a>
<a class="moz-txt-link-freetext" href="http://jul.es/mailman/listinfo/zendto" moz-do-not-send="true">http://jul.es/mailman/listinfo/zendto</a>
</pre>
                    </blockquote>
                    <br>
                    <pre class="moz-signature" cols="72">Jules

-- 
Julian Field MEng CEng CITP MBCS MIEEE MACM

The current UK shipping forecast:
Trafalgar: Northerly or northeasterly 5 to 7, occasionally 4 at first. Rough.
Rain or showers at first. Good, occasionally moderate at first.

<a class="moz-txt-link-abbreviated" href="http://www.Zend.To" moz-do-not-send="true">www.Zend.To</a>
Twitter: @JulesFM
</pre>
                  </div>
                </div>
              </div>
            </div>
          </blockquote>
          <br>
          <pre class="moz-signature" cols="72">Jules

-- 
Julian Field MEng CEng CITP MBCS MIEEE MACM

'Intelligence is quickness to apprehend as distinct from ability,
 which is capacity to act wisely on the thing apprehended.'
 - Alfred North Whitehead

<a class="moz-txt-link-abbreviated" href="http://www.Zend.To" moz-do-not-send="true">www.Zend.To</a>
Twitter: @JulesFM
</pre>
        </div>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">Jules

-- 
Julian Field MEng CEng CITP MBCS MIEEE MACM

The current UK shipping forecast:
Sole, Lundy, Fastnet: East 4 or 5 veering southeast 5 or 6 later. Moderate.
Fog patches at first. Moderate or good, occasionally very poor at first.

<a class="moz-txt-link-abbreviated" href="http://www.Zend.To">www.Zend.To</a>
Twitter: @JulesFM
</pre>
  </body>
</html>