Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

flexhrm-api-client

FlexHrmApiClient is a Flex HRM API client for NodeJS. It is a wrapper around an API client that has been automatically generated with swagger-typescript-api from the Flex HRM OpenAPI specification.

Installation

Install the package:

npm install @rantalainen/flexhrm-api-client

Import

import { FlexHrmApiClient } from '@rantalainen/flexhrm-api-client';

Setup client with options

The client uses Flex HRM API username/password credentials and sends them with HTTP Basic authentication.

const client = new FlexHrmApiClient(
  {
    username: process.env.FLEXHRM_USERNAME,
    password: process.env.FLEXHRM_PASSWORD
  },
  {
    baseURL: 'https://internhrm.klaraconsulting.se/webapi'
  }
);

Do not include /api in baseURL; generated methods already include /api/... in their paths.

Calling endpoints

All generated operations are available under the api namespace. Responses follow Axios conventions, so the payload is in response.data.

const response = await client.api.companiesList({ pageSize: 10 });

console.log(response.data.result);

The generated Api class and data types are also exported for advanced use.

Resources

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages