A Node.js client for the Softone REST API. Easily interact with the Softone REST API using this library.
npm i @phoenixdev/softone-rest-api
yarn add @phoenixdev/softone-rest-api
GET API credentials from your Softone dealer .
Soft1 Web Services reference https://softone.gr/ws/.
Setup for the REST API integration :
const SoftoneRestApi = require('@phoenixdev/softone-rest-api');
const softone = new SoftoneRestApi({
url: 'xxxx',
username: 'xxxx',
password: 'xxxx',
appId: 'xxxx',
});
Option | Type | Required | Description |
---|---|---|---|
url |
String |
yes | Softone oncloud.gr url |
devUrl |
String |
no | Sandbox Softone oncloud.gr url. If empty add dev- to main url e.x. https://dev-demo.oncloud.gr |
username |
String |
yes | Your username |
password |
String |
yes | Your password |
appId |
Integer |
yes | Your application id |
company |
Integer |
no | Login company. Used in loginAuthenticate and setAutoLogin |
branch |
Integer |
no | Login branch. Used in loginAuthenticate and setAutoLogin |
module |
Integer |
no | Login module. Used in loginAuthenticate and setAutoLogin |
refId |
Integer |
no | Login refid. Used in loginAuthenticate and setAutoLogin |
logindate |
String |
no | Login date for service login |
timezoneoffset |
String |
no | Login timezoneoffset for service login |
sandbox |
Boolean |
no | Define if is sandox or not.Default is false |
autoLogin |
Boolean |
no | Auto login to Softone and store clientId for next requests |
loginObjs |
Integer |
no | Array index of objs from login response. Used for auto login if not define company, branche, module and refId. Default index 0 |
encoding |
String |
no | Encoding, default is utf-8 |
timeout |
Integer |
no | Define the request timeout |
axiosConfig |
Object |
no | Define the custom Axios config, also override this library options |
.get( data)
.get( data, params, customEndPoint)
Params | Type | Description |
---|---|---|
data |
Object |
JS object to be converted into JSON and sent in the request |
params |
Object |
Query strings params |
customEndPoint |
String |
Softone Custom endpoint |
.post( data)
.post( data, params, customEndPoint)
Params | Type | Description |
---|---|---|
data |
Object |
JS object to be converted into JSON and sent in the request |
params |
Object |
Query strings params |
customEndPoint |
String |
Softone Custom endpoint |
.login( data)
.login( data, params)
Params | Type | Description |
---|---|---|
data |
Object |
JS object to be converted into JSON and sent in the request |
params |
Object |
Query strings params |
.authenticate( data)
.authenticate( data, params)
Params | Type | Description |
---|---|---|
data |
Object |
JS object to be converted into JSON and sent in the request |
params |
Object |
Query strings params |
.loginAuthenticate( data)
.loginAuthenticate( data, params)
Params | Type | Description |
---|---|---|
data |
Object |
JS object to be converted into JSON and sent in the request |
params |
Object |
Query strings params |
.setAutoLogin()
.setAutoLogin( params)
Params | Type | Description |
---|---|---|
params |
Object |
Query strings params |
yarn test
or
npm test
- 2023-07-19 - v1.0.0 - Initial release.