<commit_before># Kiwigrid AppService

This a small helper library for using the Kiwigrid Web API within a Symfony 2.1+ application.

## API Dokumentation

The REST API Dokumentation can be found under <http://developers.kiwigrid.com/webapi/5.6/>

## Symfony Integration

In the global config.yml the following must be added:

    # local dev config
    parameters:
        app_service.ssl_certs_path:  "%kernel.root_dir%/../certs" #the path to the folder that contain the cert and key file
        app_service.ssl_cert_file:   "cert_%kernel.environment%.pem"                   #the filename of the cert file (pem format)
        app_service.ssl_key_file:    "key_%kernel.environment%.pem"                    #the filename of the key file (pem format)
        app_service.ca_cert_file:    "root.kiwigrid.com.pem"                    #the filename of the ca cert file (pem format)
        app_service.base_url:        "https://webapi.dev.kiwigrid.com/"
        
        
    services:
        session:
            class:          AppService\Core\SymfonyAppserviceSessionHandler
              
        app_service:
            class:          AppService\Core\AppService
            scope:          request
            arguments:
              - @session
              - "%app_service.ssl_certs_path%/%app_service.ssl_cert_file%"
              - "%app_service.ssl_certs_path%/%app_service.ssl_key_file%"
              - "%app_service.ssl_password%"
              - "%app_service.ssl_certs_path%/%app_service.ca_cert_file%"
              - "%app_service.base_url%"
              - @request  

In the environment specific configs the following must be added:

    parameters:
        app_service.base_url:        "https://webapi.kiwigrid.com/" #enviroment specific API URL
        app_service.ssl_password:    "<PASSWORD>"
        
## Requirements

To use the API you will need a Kiwigrid Developer Certificate.<commit_msg>updated README to represent best practice<commit_after># Kiwigrid AppService

This a small helper library for using the Kiwigrid Web API within a Symfony 2.1+ application.

## API Dokumentation

The REST API Dokumentation can be found under <http://developers.kiwigrid.com/webapi/5.6/>

## Symfony Integration

In the local parameter.yml the following must be added:

```
parameters:
  app_service.ssl_certs_path:  "%kernel.root_dir%/../certs"               #the path to the folder that contain the cert and key file
  app_service.ssl_cert_file:   "kiwigrid.myapp.crt"                       #the filename of the cert file (pem format)
  app_service.ssl_key_file:    "kiwigrid.myapp.key"                       #the filename of the key file (pem format)
  app_service.ca_cert_file:    "ca.crt"                                   #the filename of the ca cert file (pem format)
  app_service.base_url:        "https://webapi.dev.kiwigrid.com/"
  app_service.ssl_password:    "<PASSWORD>"
```

In the global config.yml the following must be added:

```
services:
  session:
    class:          AppService\Core\SymfonyAppserviceSessionHandler
      
  app_service:
    class:          AppService\Core\AppService
    scope:          request
    arguments:
      - @session
      - "%app_service.ssl_certs_path%/%app_service.ssl_cert_file%"
      - "%app_service.ssl_certs_path%/%app_service.ssl_key_file%"
      - "%app_service.ssl_password%"
      - "%app_service.ssl_certs_path%/%app_service.ca_cert_file%"
      - "%app_service.base_url%"
      - @request  
```
        
## Requirements

To use the API you will need a Kiwigrid Developer Certificate.
{'fraction_non_alphanumeric': 0.08817747823645043, 'fraction_numerical': 0.002246559955068801, 'mean_word_length': 2.379506641366224, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 3, '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': '1384534', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1053, 'n_words': 273}