Saltar al contendio prinicipal

Notes

Advertencia

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 /notes

Endpoint URL

https://www.cotalker.com/api/v3/notes

Headers

HeaderDescriptionRequiredValues
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN

Query Parameters

ParameterDescriptionTypeRequiredNotes
countReturns the number of notes returned.booleanOptional
createdByReturns documents created by the indicated user.ObjectId<COTUser>Optional
isActiveDisplays either active or deleted documents.booleanOptionalIf the parameter is not used, both active and deleted documents are displayed.
limitLimts the number of notes returned per response page.numberOptionalBest if used in conjunction with the page parameter.
orderByReturns 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.
stringOptionalMust be used in conjunction with the sortBy parameter.
ownerDisplays notes belonging to:
all: all the users
me: the user making the request
other: all users other than the one making the request
stringOptionalIf no option is selected, the me option is used as default.
pageMakes the response display data from the indicated page number.numberOptionalUsed best with the limit parameter.
sortBySort results by the following options:
- createdAt: Date and time the note was created.
- modifiedAt: Last time the note was modified.
stringOptionalBy default, notes are sorted by createdAt field.
taskGroupIdAllows displaying notes associated with a task.ObjectId<COTTaskGroup>OptionalMust be used inconjunction with the taskId parameter.
taskIdAllows displaying notes associated with a task.ObjectId<COTTask>OptionalMust 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

HeaderDescriptionRequiredValues
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN

Path Parameters

ParameterDescriptionTypeRequiredNotes
idThe 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}/editor

Endpoint URL

https://www.cotalker.com/api/v3/notes/{id}/editor

Headers

HeaderDescriptionRequiredValues
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN

Path Parameters

ParameterDescriptionTypeRequiredNotes
idThe 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}/viewer

Endpoint URL

https://www.cotalker.com/api/v3/notes/{id}/viewer

Headers

HeaderDescriptionRequiredValues
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN

Path Parameters

ParameterDescriptionTypeRequiredNotes
idThe 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}/download

Endpoint URL

https://www.cotalker.com/api/v3/notes/{id}/download

Headers

HeaderDescriptionRequiredValues
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN

Path Parameters

ParameterDescriptionTypeRequiredNotes
idThe 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 /notes

Endpoint URL

https://www.cotalker.com/api/v3/notes

Headers

HeaderDescriptionRequiredValues
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN
Content-TypeSets the body's format.Requiredapplication/json

Request Body

ElementDescriptionTypeRequiredNotes
titleThe title of the document.stringRequired
descriptionA brief description of the note written by the document's author.stringOptional
contextIndicates the task, and its corresponding task group, the document is associated with.objectOptional
context.taskAssociated task details.objectOptional
context.task.taskGroupIdThe objectId of the task group the document is found in.ObjectId<COTTaskGroup>Optional
context.task.taskIdThe objectId of the task the document is found in.ObjectId<COTTask>Optional
contentDisplays a string with the document's content in markdown format.stringOptional

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

HeaderDescriptionRequiredValues
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN
Content-TypeSets the body's format.Requiredapplication/json

Path Parameters

ParameterDescriptionTypeRequiredNotes
idThe ObjectId of the note that is to be returned.ObjectId<COTNote>Required

Request Body

ElementDescriptionTypeRequiredNotes
titleThe title of the document.stringOptional
descriptionA brief description of the note written by the document's author.stringOptional
contextIndicates the task, and its corresponding task group, the document is associated with.objectOptional
context.taskAssociated task details.objectOptional
context.task.taskGroupIdThe objectId of the task group the document is found in.ObjectId<COTTaskGroup>Optional
context.task.taskIdThe objectId of the task the document is found in.ObjectId<COTTask>Optional
contentDisplays a string with the document's content in markdown format.stringOptional

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}/session

Endpoint URL

https://www.cotalker.com/api/v3/notes/{id}/session

Headers

HeaderDescriptionRequiredValues
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN

Path Parameters

ParameterDescriptionTypeRequiredNotes
idThe 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
FieldDescriptionTypeNotes
_idIndicates the session's ObjectId.string
activeSessionIndicates whether the note session is active or not.boolean
companyIndicates the ObjectId of the company.ObjectId<COTCompany>
createdAtThe time and date the session the note was accessed by the user.ISODate
emailThe email of the current user that has opened the note.string
lastPingThe time and date of the last refresh.ISODate
modifiedAtThe time and date of user intervention.ISODate
noteIndicates the ObjectId of the note.ObjectId<COTNote>
sessionTimeThe number of seconds the session has been active.number