⚠️ This package is still a WIP and the reference does not cover all the fields in responses. It gives a glimpse of what's possible, though.
The client
object denotes the Nozbe Teams application. Create it using the top-level constructor exported by @nozbe/teams-api
:
import NozbeTeams from "@nozbe/teams-api";
const client = new NozbeTeams("fakeApiToken123456");
- Methods fetching entities to Nozbe Teams return
Promises
, which - if resolved - provide response from Nozbe Teams. The responses may provide more info than described. - Methods adding entities to Nozbe Teams return
null
.
Fetches the profile info
name
- profile nameemail
- profile emailtime_zone
- timezone set for the profile
Fetches the tasks for the particular project.
projectId
(string) - ID of the project to get tasks foroptions
(optional)withCompleted
(boolean) - include completed tasks to the response
id
- Task IDname
- Task nameauthor_id
- ID of the creator of the taskproject_id
- ID of the project the task is assigned tocreated_at
- Timestamp for when the task was createdended_at
- Timestamp for when the task was finished
Adds a task to the particular project
taskName
(string) - Task nameprojectId
(string)(optional) - ID of the project to which the task is added- If not given, task will be added to Single Tasks
extra
(object)(optional) - See theextra
parameter
Updates the task
taskId
(string) - Id of the task to updateparams
(object) - Parameters of the updated task. The parameters are optional:taskName
(string)(optional) - Updates the task nameisCompleted
(bool)(optional) - Marks the task as completed/not completedisPriority
(bool)(optional) - Marks the task as a priority/non-priority
extra
(object)(optional) - See theextra
parameter. Note: The extra parameter overridesparams
Fetches all projects created by the user
options
(optional)withCompleted
(boolean) - include completed projects to the response
id
- Project IDname
- Project nameauthor_id
- ID of the creator of the projectis_open
- Indicates if the project is ongoingteam_id
- Team IDcreated_at
- Timestamp for when the project was createdis_favorite
- Indicates if the project is set as favorite by the useris_single_actions
- Indicates if the project is Single Tasks. There's only one Single Tasks project per account.
Adds new project. For paid accounts only.
projectName
(string) - name of the added projectteamId
(string) - ID of the team the project is assigned toextra
(object)(optional) - See theextra
parameter
Updates the project
projectId
(string) - Id of the project to updateparams
(object) - Parameters of the updated project. The parameters are optional:projectName
(string)(optional) - Updates the project nameisCompleted
(bool)(optional) - Marks the project as completed/not completedisFavorite
(bool)(optional) - Marks the project as a favorite
extra
(object)(optional) - See theextra
parameter. Note: The extra parameter overridesparams
Fetches all comments for the particular task
taskId
(string) - ID of the task for which the comments should be fetched
id
- Comment IDbody
- Comment contenttask_id
- ID of the task to which the comment belongsauthor_id
- ID of the creator of the commentcreated_at
- Timestamp for when the comment was creatededited_at
- Timestamp for when the project was editedis_pinned
- Indicates if the comment is pinned to the topis_deleted
- Indicates if the comment has been deleted
Adds comment to a particular task. Nozbe Teams renders comments in Markdown.
Updates the comment
commentId
(string) - Id of the comment to updateparams
(object) - Parameters of the updated comment. The parameters are optional:commentText
(string)(optional) - Updates the comment's textisDeleted
(bool)(optional) - Removes the comment. Note: It's irreversible
extra
(object)(optional) - See theextra
parameter. Note: The extra parameter overridesparams
taskId
(string) - ID of the task to which the comment should be addedcommentText
(string) - Text to add as a commentextra
(object)(optional) - See theextra
parameter
Adds comment with attachments to a particular task.
taskId
(string) - ID of the task to which the comment should be addedcommentText
(string) - Text to add as a commentfiles
([File]) - Array of the HTML5File
s.
We don't document every single operation possible, but you still can pass an undocumented extra object without reverting to fetch()
once this basic API wrapper is not sufficient. For advanced applies.
Creates an arbitrary record in the particular collection.
collectionName
(string) - Collection to which the record should be added (tasks, projects etc.)rawObject
(object) - POJO denoting the record to add
Example:
await client.createRaw("tasks", {
id: "randomTaskId123",
name: "Create a new Task recrod", // this typo is here on purpose
project_id: "theProjectId",
});
Updates the arbitrary record in the particular collection.
collectionName
(string) - Collection to which the record should be updated (tasks, projects etc.)rawObject
(object) - POJO denoting the record to update. Should have theid
key.
Example:
await client.updateRaw("tasks", {
id: "randomTaskId123",
name: "Create a new Task record", // the typo is fixed now
});
Removes the arbitrary record in the particular collection.
collectionName
(string) - Collection in which the record should be removed (tasks, projects etc.)id
(string) - Record ID
Example:
await client.deleteRaw("tasks", "randomTaskId123");
The extra
object allows you to pass the undocumented parameters to the created entities without having to scrap your code and start from scratch with createRaw()
once this basic API wrapper is not sufficient. For advanced applies.
await client.addTask("A task name", "theProjectId", {
extra: {
responsible_id: "responsiblePersonId",
ended_at: 2137000000,
},
});