1.2.2 • Published 2 months ago

@rantalainen/ytj-api-client v1.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

ytj-api-client

YtjApiClient is a third party api client for NodeJS. It is a wrapper around a SOAP client that has been automatically generated using the WSDL schema provided by YTJ.

Installation

Add to project's package.json:

npm install @rantalainen/ytj-api-client

Import

import { YtjApiClient } from '@rantalainen/ytj-api-client';

Authentication / Setup client

In order to obtain a user id and api key, please contact YTJ API support. User id and apikey is needed to access all API functions.

const ytjApiClient = new YtjApiClient({
  userId: 'your-user',
  apiKey: 'your-apikey'
});

SOAP client handles authentication based on YtjApiClient userId and apiKey.

// Set up SOAP client for calling functions
const client = await ytjApiClient.createSoapClient();

Example usage after initialization:

const [companyForms] = await client.wmYritysMuodotAsync();
console.log(companyForms);

:warning: NOTE: All parameters for methods are mandatory. For example wmYritysHakuAsync requires a complete WmYritysHaku object:

const organizationId = 'my_organizationid';

const [company] = await client.wmYritysHakuAsync({
  ytunnus: organizationId,
  yritysmuoto: '',
  sanahaku: 'false',
  voimassaolevat: 'true',
  hakusana: ''
});
console.log(company);

Available methods can be found in the API documentation.

1.2.2

2 months ago

1.2.0

3 months ago

1.2.1

3 months ago

1.1.0

3 months ago