For Developers

Categories

List Categories

categories.list(class_id, options);

Retrieve a list of Categories in a Class.

Arguments

ParameterTypeDescription
class_idstringThe UUID of the class.
optionsobjectThis function supports standard paging options.

Example Usage

for await (const category of edlink.categories.list(class_id)) {
    console.log(category.name);
}

Create Category

categories.create(class_id, category);

Create a Category in a Class.

Arguments

ParameterTypeDescription
class_idstringThe UUID of the class.
categoryCategoryThe category to create.

Example Usage

const new_category = await edlink.categories.create(class_id, {
    name: 'Homework',
    position: 1
});

console.log(new_category.id);

Fetch Category

categories.fetch(class_id, category_id);

Retrieve a Category in a Class.

Arguments

ParameterTypeDescription
class_idstringThe UUID of the class.
category_idstringThe UUID of the category.

Example Usage

const category = await edlink.categories.fetch(class_id, category_id);
console.log(category.name);

Update Category

categories.update(class_id, category_id, patch);

Update a Category in a Class.

Arguments

ParameterTypeDescription
class_idstringThe UUID of the class.
category_idstringThe UUID of the category.
patchCategoryA partial category object to patch the category with.

Example Usage

const updated_category = await edlink.categories.update(class_id, category_id, {
    name: 'Updated Category Name',
    position: 2
});
console.log(updated_category.name);

Delete Category

categories.delete(class_id, category_id);

Delete a Category in a Class.

Arguments

ParameterTypeDescription
class_idstringThe UUID of the class.
category_idstringThe UUID of the category.

Example Usage

await edlink.categories.delete(class_id, category_id);
console.log('Category deleted');