Skip to main content

Property Types (Collections)

Overview

Property types, also know as collections, are versatile databases that can be set up to carry out diverse functions in the Cotalker environment. Property types can store company assets, describe workflow states, act as a filter, contain options for multiple-choice questions in surveys, grant permissions, and much more. Some common examples include "Store Locations", "Company Departments", "Products", "Clients", "Contacts", "Brands", "Task States", among others.

Property types contain properties or elements, which can be thought of as the rows in a table or better yet, as the documents in a MongoDB collection. Each property has at least a "Name", a "Code" and a "Unique Id". These fields are the basic columns of the table. But each collection may have more columns by adding fields, making properties more descriptive. For example, a collection that holds "store locales" can have additional fields that contain address, employee number, store size, performance indicators, or any other information that needs to be associated with the collection's properties.

additional resources

These are just some of the most basic API requests. For a complete list of endpoints, consult our API documentation on Swagger.

Get Property Types

Returns all property types within the company.

GET /propertyTypes

Endpoint URL

https://www.cotalker.com/api/v2/propertyTypes

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
searchReturns property types with field values that match the query.stringOptional
limitLimits the amount of property types returned in the response.numberOptionalBy default, the limit is set to 10.
pageMakes the response display data from the indicated page number.numberOptionalBest used in combination with the "limit" parameter.
countAdds the counter field with the total amount of property types within the company.booleanOptional
orderByOrders the property types by ascendeing or descending order according to their modifiedAt field.stringOptionalOptions: asc, desc
sortBySorts property types in the response according to the their creation date or the last time they were modified.stringOptionalOptions are: createdAt, modifiedAt.
idsReturns property types with the IDs indicated in the array.ObjectId<COTPropertyType>[ ]Optional
codesReturns property types with the code names indicated in the array.string[ ]OptionalCode names are stored in the code field within the COTPropertyType data model.
isActiveReturns property types according to their isActive status.stringOptionalOptions are: all, true, false
viewPermissionsReturns property types based on whether they have or don't have viewing permissions.booleanOptionalViewing permissions are indicated in the viewPermissions field in the COTPropertyType data model.
modifiedReturns property types with the indicated modification date in the modifiedAt field.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
modified_gtReturns property types modified after the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
modified_gteReturns property types with a value in the modifiedAt field equal to or greater than the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
modified_ltReturns property types modified before the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
modified_lteReturns property types with a value in the modifiedAt field equal to or less than the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
createdReturns property types with the indicated creation date in the createdAt field.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
created_gtReturns property types created after the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
created_gteReturns property types with a value in the createdAt field equal to or greater than the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
created_ltReturns property types created before the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
created_lteReturns property types with a value in the createdAt field equal to or less than the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
debugAdds the debug field with error notifications.stringOptionalOption: true

Request Samples

This default request gets all the property types in the company.

curl --location --request GET 'https://www.cotalker.com/api/v2/propertyTypes' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \

Response Sample

Responses follow the COTPropertyType data model.


Get a Property Type by Id

Returns the property type indicated by the Id.

GET /propertyTypes/{id}

Endpoint URL

https://www.cotalker.com/api/v2/propertyTypes/{id}

Path Parameters

ParameterDescriptionTypeRequiredNotes
idThe ObjectId of the property type that is to be returned.ObjectId<COTPropertyType>Required

Headers

HeaderDescriptionRequiredValues
AdminGrants access to request the endpoint.Requiredtrue
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
debugAdds the debug field with error notifications.stringOptionalOption: true

Request Sample

curl --location --request GET 'https://www.cotalker.com/api/v2/propertyTypes/61a0cd6dc8f28f266b614d60' \
--header 'Admin: true' \
--header 'Authorization: Bearer $ACCESS_TOKEN'

Response Sample

The response follows the COTPropertyType data model.


Create a New Property Type

Creates a new property type within the company.

POST /propertyTypes

Endpoint URL

https://www.cotalker.com/api/v2/propertyTypes

Headers

HeaderDescriptionRequiredValues
AuthorizationSends your access token to make an API request.
Click here to see how to obtain an access token.
RequiredBearer $ACCESS_TOKEN
AdminGrants administrative access to create a new property type.Requiredtrue
Content-TypeIndicates the body's format.Requiredapplication/json

Query Parameters

ParameterDescriptionTypeRequiredNotes
debugAdds the debug field with error notifications.stringOptionalOption: true

Request Body

Only required fields are listed below. For a complete schema description, please go to the COTPropertyType data model. Unrequired fields that are not submitted are either filled in automatically or left blank.

ElementDescriptionTypeRequiredNotes
displayThe property type name users will see on the platform.stringRequired
codeThe property type's unique identification name.stringRequiredMaximum 60 characters; only lowercase letters, numbers, and underscores allowed; must be unique.

Request Sample

Property type created with the minimum required fields:_

curl --location --request POST 'https://www.cotalker.com/api/v2/propertyTypes' \
--header 'Admin: true' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"display": "Warehouse Supplies",
"code": "warehouse_supplies_00"
}'

Response Sample

Go to COTPropertyType for a complete description of the response.

{
"isActive": true,
"viewPermissions": [],
"_id": "61a0cd6dc8f28f266b614d60",
"display": "warehouse supplies",
"code": "warehouse_supplies_00",
"company": "6136968b580aaf2b0e49d844",
"createdAt": "2021-11-26T11:55:38.190Z",
"modifiedAt": "2021-11-26T11:55:38.190Z",
"schemaNodes": [],
"__v": 0
}

Update a Property Type

Updates or edits an existing property type's data.

PATCH /propertyTypes/{id}

Endpoint URL

https://www.cotalker.com/api/v2/propertyTypes/{id}

Path Parameters

ParameterDescriptionTypeRequiredNotes
idThe ObjectId of the property type that is to be modified.ObjectId<COTPropertyType>Required

Headers

HeaderDescriptionRequiredValues
AdminGrants administrative access to modify a property type.Requiredtrue
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

Query Parameters

ParameterDescriptionTypeRequiredNotes
debugAdds the debug field with error notifications.stringOptionalOption: true

Request Body

Only the fields that are being updated or added are required to be put into the body. For a complete schema description, please go to the COTPropertyType data model.

Request Sample

This sample adds a viewing permission to a property type:

curl --location --request PATCH 'https://www.cotalker.com/api/v2/propertyTypes/61a0d8729726b9c9fd398846?debug=true' \
--header 'Admin: true' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"viewPermissions": ["admin-properties-read"]
}'

Response Sample

Go to COTPropertyType for a complete description of the response.

{
"isActive": true,
"viewPermissions": [
"admin-properties-read"
],
"_id": "61a0cb3a2c62a400076efa0f",
"display": "Warehouse Supplies",
"code": "warehouse_supplies_00",
"company": "6136968b580aaf2b0e49d844",
"createdAt": "2021-11-26T11:55:38.190Z",
"modifiedAt": "2021-11-26T11:55:38.190Z",
"schemaNodes": [],
"__v": 1
}