Skip to main content

Retrieving Projects

In this section, we will show you how to get a list or one of Busy Hour Project.

Prerequisites

  1. Busy Hour Account (Sign Up if you don't have one yet)
  2. Generate a Master/Project API Key from Dashboard/Settings or from Dashboard/Projects

Retrieving Multiple Projects

warning

You only can retrieve a list of Busy Hour Project only with a Master API Key and not with a Project API Key.

To retrieve a list of Busy Hour Project, you can use the project.list function from the @busy-hour/node package. The function take an object with the following properties:

PropertyTypeDescription
projectNamestring (optional)The name of the project
limitnumber (optional)Total number of apps to retrieve, (default: 10)
pagenumber (optional)The page number of apps to retrieve, (default: 1)

Quick Example

src/main.ts
import { BusyHourNode } from '@busy-hour/node';

// Create an instance of BusyHourNode with your API key (Master/Project)
const nodeSdk = new BusyHourNode({
apiToken: 'your-api-token',
});

nodeSdk.project.list({
projectName: 'your-project-name',
limit: 5,
page: 2,
});

Retrieving a Project

warning

You only can retrieve a Busy Hour Project with any Master API Key or a Project API Key that only specificly for the project you want to retrieve.

To retrieve a Busy Hour Project, you can use the project.find function from the @busy-hour/node package. The function take a projectId to retrieve as the argument.

Quick Example

src/main.ts
import { BusyHourNode } from '@busy-hour/node';

// Create an instance of BusyHourNode with your API key (Master/Project)
const nodeSdk = new BusyHourNode({
apiToken: 'your-api-token',
});

core.project.find({
projectId: 'your-project-id',
});