<commit_before>Data Access API
===============

The Data Access API provides programmatic download access to the files stored under Dataverse. 
More advanced features of the Access API include format-specific transformations (thumbnail generation/resizing for images; converting tabular data into alternative file formats) and access to the data-level metadata that describes the contents of the tabular files. 

.. contents:: |toctitle|
   :local:

Basic File Access
-----------------

Basic access URI: 

``/api/access/datafile/$id``


Parameters:
~~~~~~~~~~~

``format`` 

the following parameter values are supported (for tabular data files only):

==============  ===========
Value           Description
==============  ===========
original        "Saved Original", the proprietary (SPSS, Stata, R, etc.) file from which the tabular data was ingested;<commit_msg>Add note for using persistentId in File Download API<commit_after>Data Access API
===============

The Data Access API provides programmatic download access to the files stored under Dataverse. 
More advanced features of the Access API include format-specific transformations (thumbnail generation/resizing for images; converting tabular data into alternative file formats) and access to the data-level metadata that describes the contents of the tabular files. 

.. contents:: |toctitle|
   :local:

Basic File Access
-----------------

Basic access URI: 

``/api/access/datafile/$id``

.. note:: Files can be accessed using persistent identifiers. This is done by passing the constant ``:persistentId`` where the numeric id of the file is expected, and then passing the actual persistent id as a query parameter with the name ``persistentId``.

  Example: Getting the file whose DOI is *10.5072/FK2/J8SJZB* ::

    GET http://$SERVER/api/access/datafile/:persistentId/?persistentId=doi:10.5072/FK2/J8SJZB


Parameters:
~~~~~~~~~~~

``format`` 

the following parameter values are supported (for tabular data files only):

==============  ===========
Value           Description
==============  ===========
original        "Saved Original", the proprietary (SPSS, Stata, R, etc.) file from which the tabular data was ingested;
{'fraction_non_alphanumeric': 0.14578587699316628, 'fraction_numerical': 0.007289293849658315, 'mean_word_length': 4.241050119331742, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '359061', 'n_tokens_mistral': 571, 'n_tokens_neox': 525, 'n_words': 245}