Generate answers for a questionnaire
curl --request POST \
--url https://api.trycomp.ai/v1/questionnaire/{id}/auto-answer \
--header 'X-API-Key: <api-key>'const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.trycomp.ai/v1/questionnaire/{id}/auto-answer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/questionnaire/{id}/auto-answer"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text){
"questionnaireId": "qst_6a179d26c4ad2c1c816ee16d",
"runId": "run_cmpotsz153eac0ultc1ya87f5",
"publicAccessToken": "pat_...",
"status": "generating",
"totalQuestions": 23,
"answeredQuestions": 0,
"message": "Generating answers for 23 questions. Poll GET /v1/questionnaire/qst_... until answeredQuestions reaches totalQuestions."
}Questionnaire
Generate answers for a questionnaire | Comp AI API
Starts background answer generation for an already-parsed questionnaire and returns a run handle immediately. Poll GET /v1/questionnaire/:id until.
POST
/
v1
/
questionnaire
/
{id}
/
auto-answer
Generate answers for a questionnaire
curl --request POST \
--url https://api.trycomp.ai/v1/questionnaire/{id}/auto-answer \
--header 'X-API-Key: <api-key>'const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.trycomp.ai/v1/questionnaire/{id}/auto-answer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/questionnaire/{id}/auto-answer"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text){
"questionnaireId": "qst_6a179d26c4ad2c1c816ee16d",
"runId": "run_cmpotsz153eac0ultc1ya87f5",
"publicAccessToken": "pat_...",
"status": "generating",
"totalQuestions": 23,
"answeredQuestions": 0,
"message": "Generating answers for 23 questions. Poll GET /v1/questionnaire/qst_... until answeredQuestions reaches totalQuestions."
}Response
200 - application/json
Was this page helpful?

