npm package: @p7m/people-backend
Description: # API for people related data and operations  This is the REST API of the P7M services, that is responsible for managing people related information.  For endpoints in other tags the caller has to be authenticated with the system and provide a JWT token in
Latest version: 0.2.2

# @p7m/people-backend

PeopleBackend - JavaScript client for @p7m/people-backend
# API for people related data and operations

This is the REST API of the P7M services, that is responsible for managing people related information.

For endpoints in other tags the caller has to be authenticated with the system and provide a JWT token in the
Authorization header of the HTTP request. When using the API you typically get this token by authenticating first with
OAuth 2.0.

The typical CRUD (Create, Read, Update Delete) semantic of a REST interface is used in this API. Therefore access is
done using the following four HTTP verbs: **POST:** creation of new objects **GET:** reading of existing objects
**PUT:** updating of existing objects **DELETE:** deleting of existing objects.
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 0.2.2
- Package version: 0.2.2
- Generator version: 7.13.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/people-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/people-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 PeopleBackend = require('@p7m/people-backend');

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

var api = new PeopleBackend.AddressApi()
var personId = "personId_example"; // {String} ID of the person
var addressId = "addressId_example"; // {String} ID of the address that should get deleted
api.deletePersonPersonIdAddressAddressId(personId, addressId).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});


```

## Documentation for API Endpoints

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

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*PeopleBackend.AddressApi* | [**deletePersonPersonIdAddressAddressId**](docs/AddressApi.md#deletePersonPersonIdAddressAddressId) | **DELETE** /person/{person_id}/address/{address_id} | Delete one of the addresses of a person
*PeopleBackend.AddressApi* | [**getPersonPersonIdAddress**](docs/AddressApi.md#getPersonPersonIdAddress) | **GET** /person/{person_id}/address | Get the list of all addresses of a person
*PeopleBackend.AddressApi* | [**getPersonPersonIdAddressAddressId**](docs/AddressApi.md#getPersonPersonIdAddressAddressId) | **GET** /person/{person_id}/address/{address_id} | Get a single address of a person
*PeopleBackend.AddressApi* | [**postPersonPersonIdAddress**](docs/AddressApi.md#postPersonPersonIdAddress) | **POST** /person/{person_id}/address | Add a new address to an existing person
*PeopleBackend.AddressApi* | [**putPersonPersonIdAddressAddressId**](docs/AddressApi.md#putPersonPersonIdAddressAddressId) | **PUT** /person/{person_id}/address/{address_id} | Update an existing address of a person
*PeopleBackend.EmailApi* | [**deletePersonPersonIdEmailEmailId**](docs/EmailApi.md#deletePersonPersonIdEmailEmailId) | **DELETE** /person/{person_id}/email/{email_id} | Delete one of the email addresses of a person
*PeopleBackend.EmailApi* | [**getPersonPersonIdEmail**](docs/EmailApi.md#getPersonPersonIdEmail) | **GET** /person/{person_id}/email | Get the list of all email addresses of a person
*PeopleBackend.EmailApi* | [**getPersonPersonIdEmailEmailId**](docs/EmailApi.md#getPersonPersonIdEmailEmailId) | **GET** /person/{person_id}/email/{email_id} | Get a single email address of a person
*PeopleBackend.EmailApi* | [**postPersonPersonIdEmail**](docs/EmailApi.md#postPersonPersonIdEmail) | **POST** /person/{person_id}/email | Add an email address to an existing person
*PeopleBackend.EmailApi* | [**putPersonPersonIdEmailEmailId**](docs/EmailApi.md#putPersonPersonIdEmailEmailId) | **PUT** /person/{person_id}/email/{email_id} | Update an existing email address of a person
*PeopleBackend.PersonApi* | [**deletePersonPersonId**](docs/PersonApi.md#deletePersonPersonId) | **DELETE** /person/{person_id} | Delete a single person by its ID
*PeopleBackend.PersonApi* | [**getPerson**](docs/PersonApi.md#getPerson) | **GET** /person | Get the list of all people
*PeopleBackend.PersonApi* | [**getPersonPersonId**](docs/PersonApi.md#getPersonPersonId) | **GET** /person/{person_id} | Get a single person by its ID
*PeopleBackend.PersonApi* | [**postPerson**](docs/PersonApi.md#postPerson) | **POST** /person | Create a new person
*PeopleBackend.PersonApi* | [**putPersonPersonId**](docs/PersonApi.md#putPersonPersonId) | **PUT** /person/{person_id} | Update an existing person
*PeopleBackend.PhoneApi* | [**deletePersonPersonIdPhonePhoneId**](docs/PhoneApi.md#deletePersonPersonIdPhonePhoneId) | **DELETE** /person/{person_id}/phone/{phone_id} | Delete one of the phone numbers of a person
*PeopleBackend.PhoneApi* | [**getPersonPersonIdPhone**](docs/PhoneApi.md#getPersonPersonIdPhone) | **GET** /person/{person_id}/phone | Get the list of all phone numbers of a person
*PeopleBackend.PhoneApi* | [**getPersonPersonIdPhonePhoneId**](docs/PhoneApi.md#getPersonPersonIdPhonePhoneId) | **GET** /person/{person_id}/phone/{phone_id} | Get a single phone number of a person
*PeopleBackend.PhoneApi* | [**postPersonPersonIdPhone**](docs/PhoneApi.md#postPersonPersonIdPhone) | **POST** /person/{person_id}/phone | Add a new phone number to an existing person
*PeopleBackend.PhoneApi* | [**putPersonPersonIdPhonePhoneId**](docs/PhoneApi.md#putPersonPersonIdPhonePhoneId) | **PUT** /person/{person_id}/phone/{phone_id} | Update an existing phone number of a person
*PeopleBackend.SalutationApi* | [**deleteSalutationSalutationId**](docs/SalutationApi.md#deleteSalutationSalutationId) | **DELETE** /salutation/{salutation_id} | (Soft-)delete a single salutation
*PeopleBackend.SalutationApi* | [**getSalutation**](docs/SalutationApi.md#getSalutation) | **GET** /salutation | Get the list of all salutations
*PeopleBackend.SalutationApi* | [**getSalutationSalutationId**](docs/SalutationApi.md#getSalutationSalutationId) | **GET** /salutation/{salutation_id} | Request a single salutation by its ID
*PeopleBackend.SalutationApi* | [**postSalutation**](docs/SalutationApi.md#postSalutation) | **POST** /salutation | Create a new salutation
*PeopleBackend.SalutationApi* | [**putSalutationSalutationId**](docs/SalutationApi.md#putSalutationSalutationId) | **PUT** /salutation/{salutation_id} | Update an existing salutation
*PeopleBackend.StaffApi* | [**deleteStaffStaffId**](docs/StaffApi.md#deleteStaffStaffId) | **DELETE** /staff/{staff_id} | Delete a staff member by its ID
*PeopleBackend.StaffApi* | [**getStaff**](docs/StaffApi.md#getStaff) | **GET** /staff | Get the list of all staff members
*PeopleBackend.StaffApi* | [**getStaffStaffId**](docs/StaffApi.md#getStaffStaffId) | **GET** /staff/{staff_id} | Get a single member of the staff by its ID
*PeopleBackend.StaffApi* | [**postStaff**](docs/StaffApi.md#postStaff) | **POST** /staff | Create a new staff member
*PeopleBackend.StaffApi* | [**putStaffStaffId**](docs/StaffApi.md#putStaffStaffId) | **PUT** /staff/{staff_id} | Update an existing staff member


## Documentation for Models

 - [PeopleBackend.Address](docs/Address.md)
 - [PeopleBackend.AddressType](docs/AddressType.md)
 - [PeopleBackend.Email](docs/Email.md)
 - [PeopleBackend.EmailType](docs/EmailType.md)
 - [PeopleBackend.ListWrapperAddress](docs/ListWrapperAddress.md)
 - [PeopleBackend.ListWrapperAddressDataInner](docs/ListWrapperAddressDataInner.md)
 - [PeopleBackend.ListWrapperEmail](docs/ListWrapperEmail.md)
 - [PeopleBackend.ListWrapperEmailDataInner](docs/ListWrapperEmailDataInner.md)
 - [PeopleBackend.ListWrapperPerson](docs/ListWrapperPerson.md)
 - [PeopleBackend.ListWrapperPersonDataInner](docs/ListWrapperPersonDataInner.md)
 - [PeopleBackend.ListWrapperPhone](docs/ListWrapperPhone.md)
 - [PeopleBackend.ListWrapperPhoneDataInner](docs/ListWrapperPhoneDataInner.md)
 - [PeopleBackend.ListWrapperSalutation](docs/ListWrapperSalutation.md)
 - [PeopleBackend.ListWrapperSalutationDataInner](docs/ListWrapperSalutationDataInner.md)
 - [PeopleBackend.ListWrapperStaff](docs/ListWrapperStaff.md)
 - [PeopleBackend.ListWrapperStaffDataInner](docs/ListWrapperStaffDataInner.md)
 - [PeopleBackend.NewAddress](docs/NewAddress.md)
 - [PeopleBackend.NewEmail](docs/NewEmail.md)
 - [PeopleBackend.NewPerson](docs/NewPerson.md)
 - [PeopleBackend.NewPhone](docs/NewPhone.md)
 - [PeopleBackend.NewSalutation](docs/NewSalutation.md)
 - [PeopleBackend.NewStaff](docs/NewStaff.md)
 - [PeopleBackend.Person](docs/Person.md)
 - [PeopleBackend.Phone](docs/Phone.md)
 - [PeopleBackend.PhoneType](docs/PhoneType.md)
 - [PeopleBackend.Salutation](docs/Salutation.md)
 - [PeopleBackend.Staff](docs/Staff.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