<commit_before>API - Models calls
==================

.. Tip:: Test all of those requests in our API-Explorer_.

.. _API-Explorer: https://v2.app-arena.com/apigility/swagger/API-v1#!/model

/models
-------

.. http:method:: GET /api/v1/models

**Example response JSON**

.. http:response:: Retrieve a list of models.

.. sourcecode:: js

    {
       "_links":{ ... },
       "_embedded":{
          "data":[
             {  ... },
             {
                "base_url":"https:\/\/dev.iconsultants.eu\/git\/Photopuzzle-App\/",
                "description":"A Picture Puzzle Application in which the user have to find the right picture part in the full image.",
                "id":42,
                "lang_tag":"de_DE",
                "name":"*BETA* Picture puzzle",
                "_links":{
                   "self":{
                      "href":"https:\/\/v2.app-arena.com\/api\/v1\/models\/42"
                   }
                }
             },
             {  ... },
          ]
       },
       "page_count":8,
       "page_size":25,
       "total_items":176
    }

.. http:method:: POST /api/v1/models

**Example request JSON**

.. http:request:: Create a new model

.. sourcecode:: js

    {
        "name":           "My shiny new app",
        "description":    "Using this app you will superpower your skills.",
        "base_url":       "https://www.url-to-your-app.com/appsubfolder/"
    }

   :data string name: (Required) Name of the model.
   :data string description: (Optional) Description of the model.
   :data string base_url: (Optional) Public Url path to your app


**Example response JSON**

.. http:response:: Newly created model object

.. sourcecode:: js

    {
       "_links":{ ... },
       "_embedded":{
          "data":[
             {  ... },
             {
                "base_url":"https:\/\/dev.iconsultants.eu\/git\/Photopuzzle-App\/",
                "description":"A Picture Puzzle Application in which the user have to find the right picture part in the full image.",
                "id":42,
                "lang_tag":"de_DE",
                "name":"*BETA* Picture puzzle",
                "_links":{
                   "self":{
                      "href":"https:\/\/v2.app-arena.com\/api\/v1\/models\/42"
                   }
                }
             },
             {  ... },
          ]
       },
       "page_count":8,
       "page_size":25,
       "total_items":176
    }

/models/:model_id
-----------------

.. http:method:: GET /api/v1/models/{model_id}

   :arg model_id: ID of the model.

**Example response JSON**

.. http:response:: Retrieve basic information of a single model.

   .. sourcecode:: js
<commit_msg>Update API documenation and add the first Request docs...<commit_after>API - Models calls
==================

.. Tip:: Test all of those requests in our API-Explorer_.

.. _API-Explorer: https://v2.app-arena.com/apigility/swagger/API-v1#!/model

/models
-------

.. http:method:: GET /api/v1/models

**Example response JSON**

.. http:response:: Retrieve a list of models.

.. sourcecode:: js

    {
       "_links":{ ... },
       "_embedded":{
          "data":[
             {  ... },
             {
                "base_url":"https:\/\/dev.iconsultants.eu\/git\/Photopuzzle-App\/",
                "description":"A Picture Puzzle Application in which the user have to find the right picture part in the full image.",
                "id":42,
                "lang_tag":"de_DE",
                "name":"*BETA* Picture puzzle",
                "_links":{
                   "self":{
                      "href":"https:\/\/v2.app-arena.com\/api\/v1\/models\/42"
                   }
                }
             },
             {  ... },
          ]
       },
       "page_count":8,
       "page_size":25,
       "total_items":176
    }

.. http:method:: POST /api/v1/models

**Example request JSON**

.. http:response:: Create a new model

    .. sourcecode:: js

        {
            "name":           "My shiny new app",
            "description":    "Using this app you will superpower your skills.",
            "base_url":       "https://www.url-to-your-app.com/appsubfolder/"
        }

    :data string name: (Required) Name of the model.
    :data string description: (Optional) Description of the model.
    :data string base_url: (Optional) Public Url path to your app


**Example response JSON**

.. http:response:: Newly created model object

.. sourcecode:: js

    {
        "app_domain": "",
        "base_url": "https:\/\/www.url-to-your-app.com\/appsubfolder\/",
        "created_at": "2015-03-24",
        "description": "Using this app you will superpower your skills.",
        "fb_app_id": "",
        "fb_app_namespace": "",
        "fb_app_secret": "",
        "fb_canvas_url": "",
        "id": 312,
        "lang_tag": "de_DE",
        "name": "My shiny new app",
        "secret": "<KEY>",
        "validity": "",
        "timestamp": 1427207187,
        "_links": {
            "self": {
                "href": "https:\/\/v2.app-arena.com\/api\/v1\/models\/312"
            }
        }
    }



/models/:model_id
-----------------

.. http:method:: GET /api/v1/models/{model_id}

   :arg model_id: ID of the model.

**Example response JSON**

.. http:response:: Retrieve basic information of a single model.

   .. sourcecode:: js

{'fraction_non_alphanumeric': 0.16955791829882486, 'fraction_numerical': 0.013430330162283156, 'mean_word_length': 1.570469798657718, 'pattern_counts': {'":': 65, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2936699', 'n_tokens_mistral': 1685, 'n_tokens_neox': 1569, 'n_words': 380}