<commit_before># Qminder Javascript API
[![Build Status](https://travis-ci.org/Qminder/qminder-api.svg?branch=master)](https://travis-ci.org/Qminder/qminder-api) [![Dependency Status](https://gemnasium.com/Qminder/qminder-api.svg)](https://gemnasium.com/Qminder/qminder-api)
[![npm](https://img.shields.io/npm/v/qminder-api.svg)](https://www.npmjs.com/package/qminder-api)
[![Bower](https://img.shields.io/bower/v/qminder-api.svg)](http://bower.io/search/?q=qminder-api)

Javascript wrapper for Qminder REST API.

## Installation

You can install this package either manually or with `bower`.

### Manually

Add to your webpage:

[http://static.qminderapp.com/api/qminder-api.min.js](http://static.qminderapp.com/api/qminder-api.min.js)
```js
<script src="http://static.qminderapp.com/api/qminder-api.min.js" type="text/javascript"></script>
```

[http://static.qminderapp.com/api/qminder-bridge.min.js](http://static.qminderapp.com/api/qminder-bridge.min.js)
```js
<script src="http://static.qminderapp.com/api/qminder-bridge.min.js" type="text/javascript"></script>
```

### bower

```shell
bower install qminder-api
```

## API Methods

```js
Qminder.setKey(key);
```

### Locations

#### [List of locations](http://www.qminderapp.com/docs/api/locations/#list)
```js
Qminder.locations.list(callback);
```

#### [Location details](http://www.qminderapp.com/docs/api/locations/#details)
```js
Qminder.locations.details(locationId, callback);
```

#### [List of lines](http://www.qminderapp.com/docs/api/locations/#lines)
```js
Qminder.locations.lines(locationId, callback);
```

#### [List of users](http://www.qminderapp.com/docs/api/locations/#users)
```js
Qminder.locations.users(locationId, callback);
```

#### [Creating a line](http://www.qminderapp.com/docs/api/locations/#newline)
```js
Qminder.locations.createLine(locationId, name, callback);
```

### Lines

#### [Estimated time](http://www.qminderapp.com/docs/api/lines/#details)
```js
Qminder.lines.details(lineId, callback);
```

#### [Estimated time](http://www.qminderapp.com/docs/api/lines/#estimated-time-of-service)
```js
Qminder.lines.estimatedTime(lineId, callback);
```

#### [Deleting a line](http://www.qminderapp.com/docs/api/lines/#deleting)
```js
Qminder.lines.delete(lineId, [callback]);
```


### Tickets

#### [Creating a ticket](http://www.qminderapp.com/docs/api/tickets/#creating)
```js
Qminder.tickets.create(line, parameters, callback, [errorCallback]);
```

#### [Searching tickets](http://www.qminderapp.com/docs/api/tickets/#search)
```js
Qminder.tickets.search(parameters, callback);
```

#### [Calling a ticket from list](http://qminderapp.com/docs/api/tickets/#calling-from-list)<commit_msg>Fixed readme<commit_after># Qminder Javascript API
[![Build Status](https://travis-ci.org/Qminder/qminder-api.svg?branch=master)](https://travis-ci.org/Qminder/qminder-api) [![Dependency Status](https://gemnasium.com/Qminder/qminder-api.svg)](https://gemnasium.com/Qminder/qminder-api)
[![npm](https://img.shields.io/npm/v/qminder-api.svg)](https://www.npmjs.com/package/qminder-api)
[![Bower](https://img.shields.io/bower/v/qminder-api.svg)](http://bower.io/search/?q=qminder-api)

Javascript wrapper for Qminder REST API.

## Installation

You can install this package either manually or with `bower`.

### Manually

Add to your webpage:

[http://static.qminderapp.com/api/qminder-api.min.js](http://static.qminderapp.com/api/qminder-api.min.js)
```js
<script src="http://static.qminderapp.com/api/qminder-api.min.js" type="text/javascript"></script>
```

[http://static.qminderapp.com/api/qminder-bridge.min.js](http://static.qminderapp.com/api/qminder-bridge.min.js)
```js
<script src="http://static.qminderapp.com/api/qminder-bridge.min.js" type="text/javascript"></script>
```

### bower

```shell
bower install qminder-api
```

## API Methods

```js
Qminder.setKey(key);
```

### Locations

#### [List of locations](http://www.qminderapp.com/docs/api/locations/#list)
```js
Qminder.locations.list(callback);
```

#### [Location details](http://www.qminderapp.com/docs/api/locations/#details)
```js
Qminder.locations.details(locationId, callback);
```

#### [List of lines](http://www.qminderapp.com/docs/api/locations/#lines)
```js
Qminder.locations.lines(locationId, callback);
```

#### [List of users](http://www.qminderapp.com/docs/api/locations/#users)
```js
Qminder.locations.users(locationId, callback);
```

#### [Creating a line](http://www.qminderapp.com/docs/api/locations/#newline)
```js
Qminder.locations.createLine(locationId, name, callback);
```

### Lines

#### [Line details](http://www.qminderapp.com/docs/api/lines/#details)
```js
Qminder.lines.details(lineId, callback);
```

#### [Estimated time](http://www.qminderapp.com/docs/api/lines/#estimated-time-of-service)
```js
Qminder.lines.estimatedTime(lineId, callback);
```

#### [Deleting a line](http://www.qminderapp.com/docs/api/lines/#deleting)
```js
Qminder.lines.delete(lineId, [callback]);
```


### Tickets

#### [Creating a ticket](http://www.qminderapp.com/docs/api/tickets/#creating)
```js
Qminder.tickets.create(line, parameters, callback, [errorCallback]);
```

#### [Searching tickets](http://www.qminderapp.com/docs/api/tickets/#search)
```js
Qminder.tickets.search(parameters, callback);
```

#### [Calling a ticket from list](http://qminderapp.com/docs/api/tickets/#calling-from-list)
{'fraction_non_alphanumeric': 0.21778855118403878, 'fraction_numerical': 0.0, 'mean_word_length': 5.573529411764706, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 14, 'lorem ipsum': 0, 'www.': 22, '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': '6105293', 'n_tokens_mistral': 2100, 'n_tokens_neox': 1986, 'n_words': 234}