npm package: @p7m/queue-backend
Description: API for managing phone services  This is the API of the service at P7M that manages phone services.  **Attention:** this API will probably still change a lot in the future, it's not at all stable yet
Latest version: 0.7.0

# @p7m/queue-backend

QueueBackend - JavaScript client for @p7m/queue-backend
API for managing phone services

This is the API of the service at P7M that manages phone services.

**Attention:** this API will probably still change a lot in the future, it's not at all stable yet
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 0.7.0
- Package version: 0.7.0
- Generator version: 7.11.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

## Installation

### For [Node.js](https://nodejs.org/)

#### npm

To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).

Then install it via:

```shell
npm install @p7m/queue-backend --save
```

Finally, you need to build the module:

```shell
npm run build
```

##### Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:

```shell
npm install
```

Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:

```shell
npm link
```

To use the link you just defined in your project, switch to the directory you want to use your @p7m/queue-backend from, and run:

```shell
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
```

Finally, you need to build the module:

```shell
npm run build
```

#### git

If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID
then install it via:

```shell
    npm install GIT_USER_ID/GIT_REPO_ID --save
```

### For browser

The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`,
perform the following (assuming *main.js* is your entry file):

```shell
browserify main.js > bundle.js
```

Then include *bundle.js* in the HTML pages.

### Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error:
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
the following section to your webpack config:

```javascript
module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}
```

## Getting Started

Please follow the [installation](#installation) instruction and execute the following JS code:

```javascript
var QueueBackend = require('@p7m/queue-backend');

var defaultClient = QueueBackend.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth
var oauth = defaultClient.authentications['oauth'];
oauth.accessToken = "YOUR ACCESS TOKEN"

var api = new QueueBackend.BlockApi()
var id = "id_example"; // {String} ID of the block
api.deleteBlockById(id).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});


```

## Documentation for API Endpoints

All URIs are relative to *https://queue.api.p7m.de/v1*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*QueueBackend.BlockApi* | [**deleteBlockById**](docs/BlockApi.md#deleteBlockById) | **DELETE** /block/{id} | Delete a block by its ID
*QueueBackend.BlockApi* | [**getBlockById**](docs/BlockApi.md#getBlockById) | **GET** /block/{id} | Get a single block by its ID
*QueueBackend.BlockApi* | [**getBlocks**](docs/BlockApi.md#getBlocks) | **GET** /block | Get the list of all waiting queue blocks
*QueueBackend.BlockApi* | [**postBlock**](docs/BlockApi.md#postBlock) | **POST** /block | Create a new block for a waiting queue
*QueueBackend.BlockApi* | [**putBlockById**](docs/BlockApi.md#putBlockById) | **PUT** /block/{id} | Update an existing block
*QueueBackend.CallApi* | [**getCallAlarm**](docs/CallApi.md#getCallAlarm) | **GET** /call/alarm | Get the list of all alarm calls
*QueueBackend.CallApi* | [**getCallAlarmByCalleeE164Unsecure**](docs/CallApi.md#getCallAlarmByCalleeE164Unsecure) | **GET** /call/alarm/by-callee/{e164} | Get the alarm calls for a given telephone number
*QueueBackend.CallApi* | [**postCallAlarm**](docs/CallApi.md#postCallAlarm) | **POST** /call/alarm | Create a new alarm call
*QueueBackend.CallApi* | [**postCallCode**](docs/CallApi.md#postCallCode) | **POST** /call/code | RPC to trigger an outgoing call to send a PIN code to a user
*QueueBackend.CallApi* | [**putCallAlarmId**](docs/CallApi.md#putCallAlarmId) | **PUT** /call/alarm/{id} | Update the state of an existing alarm call
*QueueBackend.InternalApi* | [**checkPendingBlocks**](docs/InternalApi.md#checkPendingBlocks) | **GET** /block/check_pending | Internal call: check for blocks that are pending and have to be started/stopped
*QueueBackend.NumberConfigurationApi* | [**deleteNumberConfigurationsNumberConfigurationId**](docs/NumberConfigurationApi.md#deleteNumberConfigurationsNumberConfigurationId) | **DELETE** /numberconfigurations/{ncid} | Delete a number configuration
*QueueBackend.NumberConfigurationApi* | [**getNumberConfigurationsNumberConfigurationId**](docs/NumberConfigurationApi.md#getNumberConfigurationsNumberConfigurationId) | **GET** /numberconfigurations/{ncid} | Get a single number configuration
*QueueBackend.NumberConfigurationApi* | [**getNumberConfigurationsNumberSuperadmin**](docs/NumberConfigurationApi.md#getNumberConfigurationsNumberSuperadmin) | **GET** /numberconfigurations/{phone_number} | Get a number configuration for a given phone number
*QueueBackend.NumberConfigurationApi* | [**getNumberConfigurationsSuperadmin**](docs/NumberConfigurationApi.md#getNumberConfigurationsSuperadmin) | **GET** /numberconfigurations | Get the list of all number configurations
*QueueBackend.NumberConfigurationApi* | [**postNumberConfigurations**](docs/NumberConfigurationApi.md#postNumberConfigurations) | **POST** /numberconfigurations | Create a new number configuration
*QueueBackend.QueueApi* | [**deleteQueueOpeningsId**](docs/QueueApi.md#deleteQueueOpeningsId) | **DELETE** /queues/{qid}/openings/{qoid} | Delete a queue opening interval by its ID
*QueueBackend.QueueApi* | [**deleteQueueQueueIdCallersQueueCallerId**](docs/QueueApi.md#deleteQueueQueueIdCallersQueueCallerId) | **DELETE** /queues/{qid}/callers/{qcid} | Remove a caller from a queue
*QueueBackend.QueueApi* | [**deleteQueuesQueueIdDestinationsQueueNumberId**](docs/QueueApi.md#deleteQueuesQueueIdDestinationsQueueNumberId) | **DELETE** /queues/{qid}/destinations/{qdid} | Delete a destination from a queue
*QueueBackend.QueueApi* | [**deleteQueuesQueueIdNumbersQueueNumberId**](docs/QueueApi.md#deleteQueuesQueueIdNumbersQueueNumberId) | **DELETE** /queues/{qid}/numbers/{qnid} | Delete a number from a queue
*QueueBackend.QueueApi* | [**getQueueOpening**](docs/QueueApi.md#getQueueOpening) | **GET** /queues/{qid}/openings | Get the list of intervals where the waiting queue is opened
*QueueBackend.QueueApi* | [**getQueueOpeningsId**](docs/QueueApi.md#getQueueOpeningsId) | **GET** /queues/{qid}/openings/{qoid} | Get an opening interval by its ID
*QueueBackend.QueueApi* | [**getQueueQueueIdCallers**](docs/QueueApi.md#getQueueQueueIdCallers) | **GET** /queues/{qid}/callers | Get the list of callers in a waiting queue
*QueueBackend.QueueApi* | [**getQueues**](docs/QueueApi.md#getQueues) | **GET** /queues | Get the list of all waiting queues
*QueueBackend.QueueApi* | [**getQueuesByNumberPhoneNumber**](docs/QueueApi.md#getQueuesByNumberPhoneNumber) | **GET** /queues/bynumber/{phone_number} | Find a queue by its number
*QueueBackend.QueueApi* | [**getQueuesQueueId**](docs/QueueApi.md#getQueuesQueueId) | **GET** /queues/{qid} | Get a single queue by its ID
*QueueBackend.QueueApi* | [**getQueuesQueueIdCallersQueueCallerId**](docs/QueueApi.md#getQueuesQueueIdCallersQueueCallerId) | **GET** /queues/{qid}/callers/{qcid} | Get an invidivual caller in a queue
*QueueBackend.QueueApi* | [**getQueuesQueueIdDestinationsQueueDestinationId**](docs/QueueApi.md#getQueuesQueueIdDestinationsQueueDestinationId) | **GET** /queues/{qid}/destinations/{qdid} | Get a single queue destination
*QueueBackend.QueueApi* | [**getQueuesQueueIdQueueNumberId**](docs/QueueApi.md#getQueuesQueueIdQueueNumberId) | **GET** /queues/{qid}/numbers/{qnid} | Get a single queue number
*QueueBackend.QueueApi* | [**postQueueOpenings**](docs/QueueApi.md#postQueueOpenings) | **POST** /queues/{qid}/openings | Create a new queue opening interval
*QueueBackend.QueueApi* | [**postQueuesQueueIdCallers**](docs/QueueApi.md#postQueuesQueueIdCallers) | **POST** /queues/{qid}/callers | Add a caller to a waiting queue
*QueueBackend.QueueApi* | [**postQueuesQueueIdDestinations**](docs/QueueApi.md#postQueuesQueueIdDestinations) | **POST** /queues/{qid}/destinations | Add a destination to a queue
*QueueBackend.QueueApi* | [**postQueuesQueueIdNumber**](docs/QueueApi.md#postQueuesQueueIdNumber) | **POST** /queues/{qid}/numbers | Add a number to a queue
*QueueBackend.QueueApi* | [**putQueueOpeningsId**](docs/QueueApi.md#putQueueOpeningsId) | **PUT** /queues/{qid}/openings/{qoid} | Update an existing queue opening interval
*QueueBackend.QueueApi* | [**putQueueQueueIdCallersQueueCallerId**](docs/QueueApi.md#putQueueQueueIdCallersQueueCallerId) | **PUT** /queues/{qid}/callers/{qcid} | Update or just keep-alive for a queue caller
*QueueBackend.QueueApi* | [**putQueuesQueueIdDestinationsQueueDestinationId**](docs/QueueApi.md#putQueuesQueueIdDestinationsQueueDestinationId) | **PUT** /queues/{qid}/destinations/{qdid} | Update a destination configuration of a queue
*QueueBackend.QueueApi* | [**putQueuesQueueIdNumbersQueueNumberId**](docs/QueueApi.md#putQueuesQueueIdNumbersQueueNumberId) | **PUT** /queues/{qid}/numbers/{qnid} | Update a number configuration of a queue
*QueueBackend.QueueApi* | [**queue**](docs/QueueApi.md#queue) | **GET** /queue | Get the list of all waiting queues
*QueueBackend.StatusApi* | [**status**](docs/StatusApi.md#status) | **GET** /status/{queue} | Get the current calls present in a queue


## Documentation for Models

 - [QueueBackend.AlarmCall](docs/AlarmCall.md)
 - [QueueBackend.AlarmCallState](docs/AlarmCallState.md)
 - [QueueBackend.AlarmCallUpdate](docs/AlarmCallUpdate.md)
 - [QueueBackend.Block](docs/Block.md)
 - [QueueBackend.CallState](docs/CallState.md)
 - [QueueBackend.CodeCallRequest](docs/CodeCallRequest.md)
 - [QueueBackend.CodeCallResult](docs/CodeCallResult.md)
 - [QueueBackend.LegacyQueue](docs/LegacyQueue.md)
 - [QueueBackend.ListWrapperAlarmCall](docs/ListWrapperAlarmCall.md)
 - [QueueBackend.ListWrapperAlarmCallDataInner](docs/ListWrapperAlarmCallDataInner.md)
 - [QueueBackend.ListWrapperNumberConfiguration](docs/ListWrapperNumberConfiguration.md)
 - [QueueBackend.ListWrapperNumberConfigurationDataInner](docs/ListWrapperNumberConfigurationDataInner.md)
 - [QueueBackend.ListWrapperQueueCaller](docs/ListWrapperQueueCaller.md)
 - [QueueBackend.ListWrapperQueueCallerDataInner](docs/ListWrapperQueueCallerDataInner.md)
 - [QueueBackend.ListWrapperQueueOpening](docs/ListWrapperQueueOpening.md)
 - [QueueBackend.ListWrapperQueueOpeningDataInner](docs/ListWrapperQueueOpeningDataInner.md)
 - [QueueBackend.NewAlarmCall](docs/NewAlarmCall.md)
 - [QueueBackend.NewBlock](docs/NewBlock.md)
 - [QueueBackend.NewNumberConfiguration](docs/NewNumberConfiguration.md)
 - [QueueBackend.NewQueueCaller](docs/NewQueueCaller.md)
 - [QueueBackend.NewQueueDestination](docs/NewQueueDestination.md)
 - [QueueBackend.NewQueueNumber](docs/NewQueueNumber.md)
 - [QueueBackend.NewQueueOpening](docs/NewQueueOpening.md)
 - [QueueBackend.NumberConfiguration](docs/NumberConfiguration.md)
 - [QueueBackend.Queue](docs/Queue.md)
 - [QueueBackend.QueueCall](docs/QueueCall.md)
 - [QueueBackend.QueueCaller](docs/QueueCaller.md)
 - [QueueBackend.QueueCallerUpdate](docs/QueueCallerUpdate.md)
 - [QueueBackend.QueueDestination](docs/QueueDestination.md)
 - [QueueBackend.QueueNumber](docs/QueueNumber.md)
 - [QueueBackend.QueueOpening](docs/QueueOpening.md)
 - [QueueBackend.QueuePrio](docs/QueuePrio.md)
 - [QueueBackend.WeekdayHoliday](docs/WeekdayHoliday.md)


## Documentation for Authorization


Authentication schemes defined for the API:
### oauth


- **Type**: OAuth
- **Flow**: accessCode
- **Authorization URL**: https://login.p7m.de/auth/authorize
- **Scopes**: N/A