Enviar encuesta
Envía una encuesta. También se puede publicar en canales.
Enviar encuesta
POST
GET
https://api.kontacto.pro/send-poll
Parámetros · cuerpo JSON si es POST
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
| api_key | string | Sí | Tu API key. |
| sender | string | Sí | Número de tu dispositivo (conectado), ej. 51999888777. |
| number | string | Sí | Destino con código de país (51999888777), ID de grupo (…@g.us), de canal (…@newsletter) o chat LID (…@lid). Hasta 10 separados por |. |
| name | string | Sí | La pregunta. |
| option | array | Sí | De 2 a 5 opciones, sin repetir. Por GET: separadas por coma. |
| countable | string | No | "1" = una sola respuesta por persona; "0" u omitido = varias. |
Ejemplos
Solicitud JSON
{
"api_key": "TU_API_KEY",
"sender": "51xxxxxxxxx",
"number": "51xxxxxxxxx",
"name": "¿Qué color te gusta?",
"option": [
"Rojo",
"Azul",
"Amarillo"
],
"countable": "1"
}
cURL
curl -X POST https://api.kontacto.pro/send-poll \
-H "Content-Type: application/json" \
-d '{
"api_key": "TU_API_KEY",
"sender": "51xxxxxxxxx",
"number": "51xxxxxxxxx",
"name": "¿Qué color te gusta?",
"option": [
"Rojo",
"Azul",
"Amarillo"
],
"countable": "1"
}'
Por GET · option separados por coma
https://api.kontacto.pro/send-poll?api_key=TU_API_KEY&sender=51xxxxxxxxx&number=51xxxxxxxxx&name=%C2%BFQu%C3%A9%20color%20te%20gusta%3F&option=Rojo%2CAzul%2CAmarillo&countable=1