Referência/CodeChat API Go Pro/sendInteractiveMessage
CodeChat API Go Pro

Envia mensagem interativa

Tipos confirmados: reply, copy, url, buttons e carousel. Esta rota é registrada depois de todas as rotas /send explícitas.

Pro
POSThttp://localhost:8084/instance/{instance}/send/{type}

Autenticação

InstanceBearerobrigatório

JWT HS256 da própria instância.

Header
Authorization
Exemplo
Bearer <INSTANCE_TOKEN>

Parâmetros

instancepathobrigatório
string

Nome público da instância

minLength 1
typepathobrigatório
string

Tipo interativo confirmado no código

enum reply · copy · url · buttons · carousel

Request body

obrigatório
bodyoneOf
numberstring

Telefone ou JID do destinatário

chatstring

Alias de destinatário

recipientstring

Alias de destinatário

buttonMessageobject
titlestringmaxLength: 1024
descriptionstringobrigatóriominLength: 1 · maxLength: 4096
footerTextstringmaxLength: 1024
mediaUploadIdoneOf

Opcional. Omitido, 0 ou string vazia não anexam mídia; valor positivo referencia um pré-upload da instância selecionada.

opção 1integermín: 0
opção 2stringpattern: ^$|^[0-9]+$
buttonsarrayobrigatório

No modo buttons, cada item é inferido por url, copyCode ou id.

items[]object
typeenum<reply | copy | url>
displayTextstringobrigatóriominLength: 1 · maxLength: 256
idstringmaxLength: 4096
copyCodestringmaxLength: 4096
urlstringformat: uri · maxLength: 4096 · pattern: ^https?://
valuestringmaxLength: 4096
carouselMessageobject
titlestringmaxLength: 1024
descriptionstringmaxLength: 4096
footerstringmaxLength: 1024
cardsarrayobrigatório
items[]object
descriptionstringobrigatóriominLength: 1 · maxLength: 4096
mediaUploadIdoneOf
opção 1integermín: 1
opção 2stringpattern: ^[1-9][0-9]*$
buttonsarrayobrigatório
items[]object
typeenum<reply | copy | url>
displayTextstringobrigatóriominLength: 1 · maxLength: 256
idstringmaxLength: 4096
copyCodestringmaxLength: 4096
urlstringformat: uri · maxLength: 4096 · pattern: ^https?://
valuestringmaxLength: 4096
optionsobject
delayintegermín: 0 · máx: 120000
presenceenum<composing | recording | paused>
quotedMessageIdstring
quotedMessageobject
externalAttributesobject
mentionAllbooleanpadrão: false
opção 1any
opção 2any
Exemplo JSONgerado do schema
"string"

Respostas

application/json
200

Interativo enviado

response 200object
idintegerobrigatório
keyIdstringobrigatório
keyRemoteJidstring | nullobrigatório
keyLidstring | nullobrigatório
keyFromMebooleanobrigatório
keyParticipantstring | nullobrigatório
keyParticipantLidstring | nullobrigatório
pushNamestring | nullobrigatório
messageTypestringobrigatório
contentanyobrigatório
messageTimestampintegerobrigatório
deviceenum<ios | android | web | unknown | desktop>obrigatório
isGroupboolean | nullobrigatório
instanceIdintegerobrigatório
metadataany
externalAttributesobject
Exemplo 200gerado do schema
{
"id": 1,
"keyId": "string",
"keyRemoteJid": "[email protected]",
"keyLid": "string",
"keyFromMe": true,
"keyParticipant": "string",
"keyParticipantLid": "string",
"pushName": "CodeChat",
"messageType": "Olá! Esta é uma mensagem de exemplo da CodeChat.",
"content": "string",
"messageTimestamp": 1,
"device": "ios",
"isGroup": true,
"instanceId": 1,
"metadata": "string",
"externalAttributes": {}
}