<commit_before># getRTI API (http://www.getrti.org/api)

Send HTTP requests and get JSON responses. All the CRUD functionality of the application has been covered in this API. In general, the following HTTP requests are supported.

  - GET model - list all the items in a model, eg GET files
  - GET model/id - view info about a single item in a model, eg GET files/1
  - POST model - create a new item in a model, eg POST files to create a new file
  - PUT model/id - edit an existing item in a model, eg PUT files/1 to edit/update file description of id 1
  - DELETE model/id - to delete an item in a model, eg DELETE files/1 

Individual models and their requets has been discussed below

## files

the main api dealing with addition, updation, and deletion of RTI files

### POST files

Send the POST request to (http://www.getrti.org/api/files) with the following $_POST variables

   - name - file name
   - file - the file, should be pdf, jpg or png
   - tags - comma separated list of tags (optional)

Example response:

```
{
    "fileID":"7",
    "slug":"test-file-62714"
}
```
   - fileID - id of the new file created in db
   - slug - URL slug of the file, useful if you redirect users to the file page immediately after upload

Errors:

```
{
    "error":"Incomplete Request"
}
```
Either name or file is missing

```
{
    "error":"File mime type not allowed"
}
```
File mime type is not allowed

# Attributions


[1] AngularJs 
[2] Twitter BootStrap
[3] Yii Framework
[4] Mysql
[5] Tesseract<commit_msg>updating readme<commit_after># getRTI API (http://www.getrti.org/api)

Send HTTP requests and get JSON responses. All the CRUD functionality of the application has been covered in this API. In general, the following HTTP requests are supported.

  - GET model - list all the items in a model, eg GET files
  - GET model/id - view info about a single item in a model, eg GET files/1
  - POST model - create a new item in a model, eg POST files to create a new file
  - PUT model/id - edit an existing item in a model, eg PUT files/1 to edit/update file description of id 1
  - DELETE model/id - to delete an item in a model, eg DELETE files/1 

Individual models and their requets has been discussed below

## files

the main api dealing with addition, updation, and deletion of RTI files

### POST files

Send the POST request to (http://www.getrti.org/api/files) with the following $_POST variables

   - name - file name
   - file - the file, should be pdf, jpg or png
   - tags - comma separated list of tags (optional)

Example response:

```
{
    "fileID":"7",
    "slug":"test-file-62714"
}
```
   - fileID - id of the new file created in db
   - slug - URL slug of the file, useful if you redirect users to the file page immediately after upload

Errors:

```
{
    "error":"Incomplete Request"
}
```
Either name or file is missing

```
{
    "error":"File mime type not allowed"
}
```
File mime type is not allowed

### GET files

Send a GET request to (http://www.getrti.org/api/files) to get a list of files

Example response:
```
[
    {
        "id":"4",
        "name":"<NAME>",
        "department":null,
        "description":null,
        "content":null,
        "address":"files\/zyQFNJurOstQuFcL.pdf",
        "date":"2014-01-10 15:02:18",
        "slug":"test-file-90112",
        "published":"0",
        "uploaded_by":null
    },
    {
        "id":"5",
        "name":"<NAME>",
        "department":null,
        "description":null,
        "content":null,
        "address":"files\/akCTrRRDAMvEQbfA.pdf",
        "date":"2014-01-10 15:05:59",
        "slug":"test-file-20278",
        "published":"0",
        "uploaded_by":null
    }
]
```

# Attributions


[1] AngularJs 
[2] Twitter BootStrap
[3] Yii Framework
[4] Mysql
[5] Tesseract
{'fraction_non_alphanumeric': 0.10849431066419687, 'fraction_numerical': 0.01905265943371262, 'mean_word_length': 2.9049586776859506, 'pattern_counts': {'":': 28, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 5, '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': '3537058', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1166, 'n_words': 486}