InApp (Sistemas Legados)Enviar Resposta da Pesquisa

Enviar Resposta da Pesquisa

Envia as respostas de uma pesquisa InApp (Sistemas Legados).

Pode ser chamado incrementalmente — enquanto o cliente responde pergunta a pergunta — e deve ser chamado com isFinalize=true na última chamada para marcar a pesquisa como concluída.

curl -X PUT "https://api.amplifique.me/partners/cf/inApp/61ddbce5b038c4c87c78b9b4?isFinalize=true" \
  -H "Content-Type: application/json" \
  -H "Authorization: YOUR_API_KEY" \
  -d '{
  "answers": [
    {
      "type": "nps",
      "internal_name": "nps_1",
      "answer": 10,
      "isMainMetric": true
    },
    {
      "type": "text",
      "internal_name": "text_2",
      "answer": "Ótimo atendimento"
    }
  ]
}'
{
  "_id": "61ddbce5b038c4c87c78b9b4",
  "_survey": "60e336ef69a03a000e20164d",
  "channel": 4,
  "sent_at": "2022-01-11T17:22:45.150Z",
  "opened_at": "2022-01-11T17:22:45.150Z",
  "origin": "API",
  "anonymized": false,
  "_customer": "616ef4659ce878549d16c718",
  "_business": "5b5765bec9498b0014883c0b",
  "_smartTags": [
    "example_string"
  ],
  "billing_restriction": true,
  "answers": [
    {
      "internal_name": "nps_1",
      "answer": 3.14,
      "isMainMetric": true,
      "type": "nps",
      "_id": "61e59e566176c3297d39b6f0"
    }
  ],
  "created_at": "2022-01-11T17:22:45.154Z",
  "answered": true,
  "answered_at": "2022-01-17T16:50:30.158Z",
  "originIp": "::ffff:127.0.0.1",
  "finalized": true,
  "finalized_at": "2022-01-17T15:00:49.182Z"
}
PUT
/partners/cf/inApp/{id}
PUT
API Key (header: Authorization)
Authorizationstring
Required

API key (sent in header)

path
idstring
Required

ID do surveyAnswer retornado pelo endpoint Buscar Pesquisa InApp

query
isFinalizeboolean

Quando true, marca a pesquisa como finalizada. Enviar true na última chamada (quando o cliente completar todas as perguntas obrigatórias).

Content-Typestring
Required

The media type of the request body

Options: application/json
answersarray
Required

Array com as respostas das perguntas respondidas nesta chamada

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

API Key for authentication. Provide your API key in the header.

Path Parameters

idstring
Required

ID do surveyAnswer retornado pelo endpoint Buscar Pesquisa InApp

Query Parameters

isFinalizeboolean

Quando true, marca a pesquisa como finalizada. Enviar true na última chamada (quando o cliente completar todas as perguntas obrigatórias).

Body

application/json
answersarray
Required

Array com as respostas das perguntas respondidas nesta chamada

Responses

_idstring

ID da pesquisa-resposta

_surveystring

ID da pesquisa

channelinteger

Canal: 4 = InApp

sent_atstring
opened_atstring
originstring
anonymizedboolean
_customerstring
_businessstring
_smartTagsstring[]
billing_restrictionboolean
answersarray

Lista acumulada de respostas registradas até este momento

created_atstring
answeredboolean

Se ao menos uma resposta foi registrada

answered_atstring
originIpstring
finalizedboolean

Se a pesquisa foi marcada como finalizada (isFinalize=true)

finalized_atstring