@p7m/people-backend
v0.2.2
Published
# 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
Readme
@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 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
npm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install @p7m/people-backend --saveFinally, you need to build the module:
npm run buildLocal 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:
npm installNext, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:
npm linkTo use the link you just defined in your project, switch to the directory you want to use your @p7m/people-backend from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>Finally, you need to build the module:
npm run buildgit
If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --saveFor browser
The library also works in the browser environment via npm and browserify. 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):
browserify main.js > bundle.jsThen 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:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}Getting Started
Please follow the installation instruction and execute the following JS code:
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 | DELETE /person/{person_id}/address/{address_id} | Delete one of the addresses of a person PeopleBackend.AddressApi | getPersonPersonIdAddress | GET /person/{person_id}/address | Get the list of all addresses of a person PeopleBackend.AddressApi | getPersonPersonIdAddressAddressId | GET /person/{person_id}/address/{address_id} | Get a single address of a person PeopleBackend.AddressApi | postPersonPersonIdAddress | POST /person/{person_id}/address | Add a new address to an existing person PeopleBackend.AddressApi | putPersonPersonIdAddressAddressId | PUT /person/{person_id}/address/{address_id} | Update an existing address of a person PeopleBackend.EmailApi | deletePersonPersonIdEmailEmailId | DELETE /person/{person_id}/email/{email_id} | Delete one of the email addresses of a person PeopleBackend.EmailApi | getPersonPersonIdEmail | GET /person/{person_id}/email | Get the list of all email addresses of a person PeopleBackend.EmailApi | getPersonPersonIdEmailEmailId | GET /person/{person_id}/email/{email_id} | Get a single email address of a person PeopleBackend.EmailApi | postPersonPersonIdEmail | POST /person/{person_id}/email | Add an email address to an existing person PeopleBackend.EmailApi | putPersonPersonIdEmailEmailId | PUT /person/{person_id}/email/{email_id} | Update an existing email address of a person PeopleBackend.PersonApi | deletePersonPersonId | DELETE /person/{person_id} | Delete a single person by its ID PeopleBackend.PersonApi | getPerson | GET /person | Get the list of all people PeopleBackend.PersonApi | getPersonPersonId | GET /person/{person_id} | Get a single person by its ID PeopleBackend.PersonApi | postPerson | POST /person | Create a new person PeopleBackend.PersonApi | putPersonPersonId | PUT /person/{person_id} | Update an existing person PeopleBackend.PhoneApi | deletePersonPersonIdPhonePhoneId | DELETE /person/{person_id}/phone/{phone_id} | Delete one of the phone numbers of a person PeopleBackend.PhoneApi | getPersonPersonIdPhone | GET /person/{person_id}/phone | Get the list of all phone numbers of a person PeopleBackend.PhoneApi | getPersonPersonIdPhonePhoneId | GET /person/{person_id}/phone/{phone_id} | Get a single phone number of a person PeopleBackend.PhoneApi | postPersonPersonIdPhone | POST /person/{person_id}/phone | Add a new phone number to an existing person PeopleBackend.PhoneApi | putPersonPersonIdPhonePhoneId | PUT /person/{person_id}/phone/{phone_id} | Update an existing phone number of a person PeopleBackend.SalutationApi | deleteSalutationSalutationId | DELETE /salutation/{salutation_id} | (Soft-)delete a single salutation PeopleBackend.SalutationApi | getSalutation | GET /salutation | Get the list of all salutations PeopleBackend.SalutationApi | getSalutationSalutationId | GET /salutation/{salutation_id} | Request a single salutation by its ID PeopleBackend.SalutationApi | postSalutation | POST /salutation | Create a new salutation PeopleBackend.SalutationApi | putSalutationSalutationId | PUT /salutation/{salutation_id} | Update an existing salutation PeopleBackend.StaffApi | deleteStaffStaffId | DELETE /staff/{staff_id} | Delete a staff member by its ID PeopleBackend.StaffApi | getStaff | GET /staff | Get the list of all staff members PeopleBackend.StaffApi | getStaffStaffId | GET /staff/{staff_id} | Get a single member of the staff by its ID PeopleBackend.StaffApi | postStaff | POST /staff | Create a new staff member PeopleBackend.StaffApi | putStaffStaffId | PUT /staff/{staff_id} | Update an existing staff member
Documentation for Models
- PeopleBackend.Address
- PeopleBackend.AddressType
- PeopleBackend.Email
- PeopleBackend.EmailType
- PeopleBackend.ListWrapperAddress
- PeopleBackend.ListWrapperAddressDataInner
- PeopleBackend.ListWrapperEmail
- PeopleBackend.ListWrapperEmailDataInner
- PeopleBackend.ListWrapperPerson
- PeopleBackend.ListWrapperPersonDataInner
- PeopleBackend.ListWrapperPhone
- PeopleBackend.ListWrapperPhoneDataInner
- PeopleBackend.ListWrapperSalutation
- PeopleBackend.ListWrapperSalutationDataInner
- PeopleBackend.ListWrapperStaff
- PeopleBackend.ListWrapperStaffDataInner
- PeopleBackend.NewAddress
- PeopleBackend.NewEmail
- PeopleBackend.NewPerson
- PeopleBackend.NewPhone
- PeopleBackend.NewSalutation
- PeopleBackend.NewStaff
- PeopleBackend.Person
- PeopleBackend.Phone
- PeopleBackend.PhoneType
- PeopleBackend.Salutation
- PeopleBackend.Staff
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
