@itarius-ug/bipro-box-api-client
v1.0.1
Published
A TypeScript wrapper for the BiPRO Box API
Downloads
4
Readme
BiPRO Box API Client
Installation
pnpm i @itarius-ug/bipro-box-api-client
Example Usage
import { ApiStatus, Bipro } from "@itarius-ug/bipro-box-api-client";
const bipro = new Bipro({
token: "<my-api-token>",
});
(async () => {
try {
// fetch all available documents (postbox_api_status = 0)
const response = await bipro.postbox().all();
for (const postbox of response.postbox) {
// fetch single document by id
const { postboxData } = await bipro.postbox().get(postbox.postbox_id);
console.log(postboxData);
// mark document as processed (postbox_api_status = 1)
await bipro
.postbox()
.update(postbox.postbox_id, { apiStatus: ApiStatus.Processed });
}
} catch (error: unknown) {
console.error((error as Error).message);
}
})();
Credits
This project exists thanks to all the people who contribute.