OnePoint HCM Node.js REST API SDK
OnePoint HCM is a cloud-based HR and administration solution. Much of the functionality is available via the OnePoint REST API, and is constrained by security permissions assigned to the acting API user.
Examples
Below are a few usage examples.
Connecting
To connect, you must have a user account registered with the company in OnePoint, as well as the company's REST API key (generated and retrieved by admin users). The company short name can be found in company settings.
const OnePoint = ; var onePoint = username: 'your_username' password: 'your_password' companyShortName: 'company_short_name' apiKey: 'your_api_key'; onePoint;
Disconnecting
After a connected client is closed, it will reject any further requests. Once it has completed all requests that are currently in the queue, the callback triggers.
// 1) close() is calledonePoint; // 2) Any further requests return an error
Reports
When dealing with reports, you can pass an options object with a query-like
structure to designate what kind of report(s) you want to run. All
report-related functions will return an array of results, even if one match
is found. The exception is when passing the report's unique identifier
(settingsId
) directly (see below).
Note that there are data size and row restrictions enforced by OnePoint depending on the time of day you run reports. More information here
List Reports
onePoint;
Get Report (query-like)
onePoint;
Get Report (exact)
onePoint;
Run Report (query-like)
Run reports that match a query-like filter. You can pass a report name directly as the first argument as shorthand.
onePoint; // or onePoint;
Run Report (exact)
Pass the report's System ID (you can find this in OnePoint via the web interface, or by listing/retrieving reports).
onePoint;