Notes
Esta página aún no se encuentra traducida al español.
Overview
Notes are documents created within the Cotalker platform. These documents can also be created as task notes, allowing users to build knowledge bases within specific tasks.
Get Notes
Returns notes and their relevant data.
GET /notesEndpoint URL
https://www.cotalker.com/api/v3/notes
Headers
Header | Description | Required | Values |
---|---|---|---|
Authorization | Sends your access token to make an API request. Click here to see how to obtain an access token. | Required | Bearer $ACCESS_TOKEN |
Query Parameters
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
count | Returns the number of notes returned. | boolean | Optional | |
createdBy | Returns documents created by the indicated user. | ObjectId<COTUser> | Optional | |
isActive | Displays either active or deleted documents. | boolean | Optional | If the parameter is not used, both active and deleted documents are displayed. |
limit | Limts the number of notes returned per response page. | number | Optional | Best if used in conjunction with the page parameter. |
orderBy | Returns responses in either of the following orders: - asc : Ascending order, i.e., displays documents from first to last.- desc : Descending order, i.e., displays documentos from last to first. | string | Optional | Must be used in conjunction with the sortBy parameter. |
owner | Displays notes belonging to: all : all the usersme : the user making the requestother : all users other than the one making the request | string | Optional | If no option is selected, the me option is used as default. |
page | Makes the response display data from the indicated page number. | number | Optional | Used best with the limit parameter. |
sortBy | Sort results by the following options: - createdAt : Date and time the note was created.- modifiedAt : Last time the note was modified. | string | Optional | By default, notes are sorted by createdAt field. |
taskGroupId | Allows displaying notes associated with a task. | ObjectId<COTTaskGroup> | Optional | Must be used inconjunction with the taskId parameter. |
taskId | Allows displaying notes associated with a task. | ObjectId<COTTask> | Optional | Must be used inconjunction with the taskGroupId parameter. |
Request Sample
curl --location --request GET 'https://www.cotalker.com/api/v3/notes' \
--header 'Authorization: Bearer $ACCESS_TOKEN'
Response Sample
The request returns the notes in COTNote data model structure.
Get Note by Id
Return the specified note with all of its relevant data.
GET /notes/{id}Endpoint URL
https://www.cotalker.com/api/v3/notes/{id}
Headers
Header | Description | Required | Values |
---|---|---|---|
Authorization | Sends your access token to make an API request. Click here to see how to obtain an access token. | Required | Bearer $ACCESS_TOKEN |
Path Parameters
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
id | The ObjectId of the note that is to be returned. | ObjectId<COTNote> | Required |
Request Sample
curl --location --request GET 'https://www.cotalker.com/api/v3/notes/63a4fd1894acf09cc589d5c3' \
--header 'Authorization: Bearer $ACCESS_TOKEN'
Response Sample
The request returns the notes in COTNote data model structure.
Open Note Editor
Returns HTML of note editor.
GET /notes/{id}/editorEndpoint URL
https://www.cotalker.com/api/v3/notes/{id}/editor
Headers
Header | Description | Required | Values |
---|---|---|---|
Authorization | Sends your access token to make an API request. Click here to see how to obtain an access token. | Required | Bearer $ACCESS_TOKEN |
Path Parameters
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
id | The ObjectId of the note that is to be returned. | ObjectId<COTNote> | Required |
Request Sample
curl --location --request GET 'https://www.cotalker.com/api/v3/notes/63a4723af9809143fa5440a0/editor' \
--header 'Authorization: Bearer $ACCESS_TOKEN'
Response Sample
The request returns an HTML document that represents the note editor.
Open Note Viewer
Returns HTML of note viewer.
GET /notes/{id}/viewerEndpoint URL
https://www.cotalker.com/api/v3/notes/{id}/viewer
Headers
Header | Description | Required | Values |
---|---|---|---|
Authorization | Sends your access token to make an API request. Click here to see how to obtain an access token. | Required | Bearer $ACCESS_TOKEN |
Path Parameters
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
id | The ObjectId of the note that is to be returned. | ObjectId<COTNote> | Required |
Request Sample
curl --location --request GET 'https://www.cotalker.com/api/v3/notes/63a4723af9809143fa5440a0/viewer' \
--header 'Authorization: Bearer $ACCESS_TOKEN'
Response Sample
The request returns an HTML document that represents the note viewer.
Download Note PDF Document
Returns a PDF version of the note document.
GET /notes/{id}/downloadEndpoint URL
https://www.cotalker.com/api/v3/notes/{id}/download
Headers
Header | Description | Required | Values |
---|---|---|---|
Authorization | Sends your access token to make an API request. Click here to see how to obtain an access token. | Required | Bearer $ACCESS_TOKEN |
Path Parameters
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
id | The ObjectId of the note that is to be returned. | ObjectId<COTNote> | Required |
Request Sample
curl --location --request GET 'https://www.cotalker.com/api/v3/notes/63a4723af9809143fa5440a0/download' \
--header 'Authorization: Bearer $ACCESS_TOKEN'
Response Sample
The request returns a PDF document of the note.
Create Note
Creates a new note.
POST /notesEndpoint URL
https://www.cotalker.com/api/v3/notes
Headers
Header | Description | Required | Values |
---|---|---|---|
Authorization | Sends your access token to make an API request. Click here to see how to obtain an access token. | Required | Bearer $ACCESS_TOKEN |
Content-Type | Sets the body's format. | Required | application/json |
Request Body
Element | Description | Type | Required | Notes |
---|---|---|---|---|
title | The title of the document. | string | Required | |
description | A brief description of the note written by the document's author. | string | Optional | |
context | Indicates the task, and its corresponding task group, the document is associated with. | object | Optional | |
context.task | Associated task details. | object | Optional | |
context.task.taskGroupId | The objectId of the task group the document is found in. | ObjectId<COTTaskGroup> | Optional | |
context.task.taskId | The objectId of the task the document is found in. | ObjectId<COTTask> | Optional | |
content | Displays a string with the document's content in markdown format. | string | Optional |
Request Sample
Request with the minimum required body.
curl --location --request POST 'https://www.cotalker.com/api/v3/notes' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "Hello, World!"
}'
Response Sample
The request returns the created note in COTNote data model structure.
Update Note
Updates a note.
PATCH /notes/{id}Endpoint URL
https://www.cotalker.com/api/v3/notes/{id}
Headers
Header | Description | Required | Values |
---|---|---|---|
Authorization | Sends your access token to make an API request. Click here to see how to obtain an access token. | Required | Bearer $ACCESS_TOKEN |
Content-Type | Sets the body's format. | Required | application/json |
Path Parameters
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
id | The ObjectId of the note that is to be returned. | ObjectId<COTNote> | Required |
Request Body
Element | Description | Type | Required | Notes |
---|---|---|---|---|
title | The title of the document. | string | Optional | |
description | A brief description of the note written by the document's author. | string | Optional | |
context | Indicates the task, and its corresponding task group, the document is associated with. | object | Optional | |
context.task | Associated task details. | object | Optional | |
context.task.taskGroupId | The objectId of the task group the document is found in. | ObjectId<COTTaskGroup> | Optional | |
context.task.taskId | The objectId of the task the document is found in. | ObjectId<COTTask> | Optional | |
content | Displays a string with the document's content in markdown format. | string | Optional |
Request Sample
This is a sample request that changes the task the note is associated with.
curl --location --request PATCH 'https://www.cotalker.com/api/v3/notes/63a47e71ab0560c59dfe9652' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"context": {
"task": {
"taskId": "63a43f06e44e0a000817ca5d",
"taskGroupId": "6398b1c56a2c1e56cde86301"
}
}
}'
Response Sample
The request returns the updated note in COTNote data model structure.
Refresh session
Refreshes the current user's presence within a note session.
POST /notes/{id}/sessionEndpoint URL
https://www.cotalker.com/api/v3/notes/{id}/session
Headers
Header | Description | Required | Values |
---|---|---|---|
Authorization | Sends your access token to make an API request. Click here to see how to obtain an access token. | Required | Bearer $ACCESS_TOKEN |
Path Parameters
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
id | The ObjectId of the note that is to be accessed. | ObjectId<COTNote> | Required |
Request Sample
curl --location --request POST 'https://www.cotalker.com/api/v3/notes/63a5783f1ca714a4183b2d2e/session' \
--header 'Authorization: Bearer $ACCESS_TOKEN'
Response Sample
The request returns an object with the current user's note session details.
{
"activeSession": true,
"sessionTime": 105,
"_id": "63a577fdd94d116a711338fb",
"company": "63a577ea27a41c97c7cadaa1",
"note": "63a5783f1ca714a4183b2d2e",
"email": "jane.doe@lorem.com",
"lastPing": "2022-12-23T09:46:20.370Z",
"createdAt": "2022-12-23T09:44:35.722Z",
"modifiedAt": "2022-12-23T09:46:20.370Z",
"__v": 0
}
Response Description
Field | Description | Type | Notes |
---|---|---|---|
_id | Indicates the session's ObjectId. | string | |
activeSession | Indicates whether the note session is active or not. | boolean | |
company | Indicates the ObjectId of the company. | ObjectId<COTCompany> | |
createdAt | The time and date the session the note was accessed by the user. | ISODate | |
The email of the current user that has opened the note. | string | ||
lastPing | The time and date of the last refresh. | ISODate | |
modifiedAt | The time and date of user intervention. | ISODate | |
note | Indicates the ObjectId of the note. | ObjectId<COTNote> | |
sessionTime | The number of seconds the session has been active. | number |