.. Netfiles API documentation master file, created by
   sphinx-quickstart on Fri Mar  6 11:42:21 2020.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Get New Files
===============

The ``showNewFiles`` call allows you to retrieve information about the *new* files & folders within a dataroom.
You can specify the ``scope`` as well as the *since*-date. ``scope`` defines what type of objects you are looking for (see below).

The *since*-date (``period``) is given in Hyperwave Date Format (``yyyy/MM/dd HH:mm:ss +0000``).

Request
-------

Request method is ``showNewFiles``:

::

  GET https://app.netfiles.de/<dataroom-name;internal&action=json&apikey=<YourApiKey>&deviceID=<currentDeviceID>&method=showNewFiles&period=<date_time_since>&scope=<scope>
  Authorization: Basic BASE64(UTF8Bytes(<username>:<password>))
  Accept: application/json
  User-Agent: iPad
  netfiles: <value of the netfiles cookie>
  sk1: <value of the sk1 cookie>
  HW_User: <value of the HW_User cookie>
  HyperwaveSession: <value of the HyperwaveSession cookie>
  sk_s_web_S: <value of the sk_s_web_S cookie>
  sk_p_web_S: <value of the sk_p_web_S cookie>


Response
--------

The response is a json object (``application/json``) representing a list of HW_Objects:

E.g.:

.. code:: json

    {
      "count": 2,
      "response": [
        {
          "type": "document",
          "id": "ID-29855.6432902402691-2",
          "path": "/tombusinessplus/projectfiles/anders.txt",
          "icon": "text",
          "documentClass": "",
          "version": "V 02",
          "downloadProhibited": false,
          "title": "anders.txt",
          "name": "anders.txt",
          "creationDate": "2019/10/09 10:00:32 +0000",
          "modificationDate": "2019/10/09 10:05:23 +0000",
          "author": "   ",
          "writeAccess": false,
          "documentType": "text/plain",
          "md5Checksum": "55b56a1400ea438c8cc912351b8187fa",
          "documentSize": 7
        },
        {
          "type": "collection",
          "id": "ID-29855.6480642866411-1",
          "path": "/tombusinessplus/projectfiles/Über den Berğen, beı den Şieben Zwergen",
          "documentClass": "",
          "version": "",
          "downloadProhibited": false,
          "title": "Über den Berğen, beı den Şieben Zwergen",
          "name": "Über den Berğen, beı den Şieben Zwergen",
          "creationDate": "2020/03/10 13:09:33 +0000",
          "modificationDate": "2020/03/10 13:09:33 +0000",
          "author": "   ",
          "writeAccess": true,
          "subDocs": "0"
        }
      ]
    }

In the example above, we have provided you with filenames including Turkish characters. We will keep this dataroom as example
for the future (``tombusinessplus``)

Returned Headers and Set Cookies are the same as with the :doc:`Check Identity <checkidentity>` call.

Discussion - Scope
------------------

The ``scope`` is extremely important. Depending on what you exactly want from the server, there are five (5!) scopes.

``scope=projectfiles``
    Applies only to *normal* datarooms (i.e. it does **not** apply for Boardrooms). Returns the list of changed **files** and
    **folders** in that dataroom.

``scope=files``
    Applies only to *normal* datarooms (i.e. it does **not** apply to Boardrooms). Returns the list of changed **files**.

``scope=folders``
    Applies only to *normal* datarooms (i.e. it does **not** apply to Boardrooms). Returns the list of changed **folders**.

``scope=meetings``
    Applies only to *Boardrooms*, i.e. it does **not** work on normal datarooms (returns 0 entries on normal datarooms).
    Returns the list of all :doc:`Meetings <../meetings/meeting>`, :doc:`Meeting Collections <../meetings/meetingcollection>`,
    :doc:`Meeting Topics <../meetings/meetingtopic>`, and :doc:`Meeting Topic Minutes <../meetings/meetingtopicminutes>`
    that have changed since date given. It does **not** return the list of files.

``scope=meetingfiles``
    Applies only to *Boardrooms*, i.e., it *should* not work on normal datarooms. It returns the list of changed files & folders
    since date given.

