ytj-api-client
v1.0.0
Published
**YtjApiClient** is a third party api client for NodeJS. It is a wrapper around a SOAP client that has been [automatically generated](https://github.com/dderevjanik/wsdl-tsclient) using the [WSDL schema](https://api.tietopalvelu.ytj.fi/yritystiedot.asmx?W
Downloads
5
Readme
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.