Saltar al contendio prinicipal

Answers

Advertencia

Esta página aún no se encuentra traducida al español.

Overview

An answer is the representation of a submitted survey. It contains the latest version of the survey data.

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 Answers

Returns answers within the specified criteria. To get _answers you must provide either an answer uuid, a survey id, or property id in the query parameters. You can also use the query parameters to filter and find answers according to users or modified date. _

GET /answers

Endpoint URL

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

Headers

HeaderDescriptionRequiredValues
AdminAuthorizes access to answers.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
extraAdds extra information in the response regarding associated objects.string[ ]OptionalOptions are: "channels", "properties", "users", "surveys", "questions", and "surveychats". More than one extra query parameter can be user per request.
userReturns answers submitted by the indicated user in regards to the specified criteria in one of the following query parameters: surveys, answer uuids, or properties.ObjectId<COTUser>[ ]Optional
surveyReturns answers from the specified survey.ObjectId<COTSurvey>Required if neither surveyIds, properties, nor answerUuids query parameters are being used.
surveyIdsReturns answers from the specified surveys.ObjectId<COTSurvey>[ ]Required if neither survey, properties, nor answerUuids query parameters are being used.
propertiesReturns answers with the specified properties.ObjectId<Property>[ ]Required if neither survey, surveyIds, nor answerUuids query parameters are being used.
answerUuidsReturns answers with the specified answer uuids.ObjectId<COTAnswer>[ ]Required if neither survey, surveyIds, nor properties query parameters are being used.
modifiedAtGteReturns answers with a value in the modifiedAt field equal to or greater than the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
modifiedAtLteReturns answers with a value in the modifiedAt field equal to or less than the indicated date and time.ISODateOptionalYYYY-MM-DDTHH:mm:ss.SSSZ
fullMatchPropertiesReturns answers that contain all the properties searched for through the query parameters.booleanOptionalMust be used in conjunction with the properties query parameter.
limitLimits the amount of answers 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 questions within the company.booleanOptional
orderByReturns answers in ascending or descending order.stringOptionalMust be used in conjunction with the sortBy query parameter.
sortBySorts answers by date created.stringOptionalMust be used in conjunction with the orderBy query parameter.
debugAdds the debug field with error notifications.stringOptionalOption: true

Request Samples

This request gets all the answers submitted by a specific user on the indicated survey.

curl --location --request GET 'https://www.cotalker.com/api/v2/answers?survey=61a50f928843af3e1332c67f&user=61953bf9bdc3558a4966e54d' \
--header 'Admin: true' \
--header 'Authorization: Bearer $ACCESS_TOKEN' \

Response Sample

Responses follow the COTAnswer data model.


Get an Answer by Id

Returns the answer indicated by the Id.

GET /answers/{id}

Endpoint URL

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

Path Parameters

ParameterDescriptionTypeRequiredNotes
idEither the _id or _uuid_ of the answer that is to be returned.ObjectId<COTAnswer>Required

Headers

HeaderDescriptionRequiredValues
AdminAuthorizes the use of 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/answers/61a7c1df03ffa8e4ee2df904' \
--header 'Admin: true' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $ACCESS_TOKEN'

Response Sample

The response follows the COTAnswer data model.