Saltar para o conteúdo principal
POST
Use esta referência para inspecionar os payloads de webhook que a YCloud envia para sua aplicação. Selecione um exemplo nomeado no construtor de requisições para ver seus campos. Para eventos de qualidade do número de telefone e remoção de conta, selecione estes exemplos: Para atualizações de qualidade, inspecione qualityRating e qualityUpdateEvent quando estiverem presentes. Mantenha o messagingLimit do número de telefone separado de whatsappBusinessManagerMessagingLimit, que descreve o limite compartilhado do portfólio de negócios proprietário. Os valores de exemplo não são padrões para sua conta. Para eventos de exclusão de conta, identifique a conta com whatsappBusinessAccount.id. Os campos de remoção são opcionais. Preserve valores desconhecidos de removedReason e removedInitiatedBy. removedTime registra quando o evento de exclusão foi recebido, não a hora exata em que a conta foi excluída. A referência usa https://example.com como um placeholder reservado. Para seus próprios testes, substitua-o pela URL de webhook da sua aplicação na requisição gerada. Sua aplicação hospeda esse endpoint; a YCloud não hospeda /webhooks/ycloud.
O envio de um payload de exemplo testa o seu receptor. Ele não aciona uma entrega de webhook a partir da YCloud. O exemplo YCloud-Signature é um valor de amostra; não é uma assinatura válida para um payload editado ou para o segredo do seu endpoint.
Valide o cabeçalho YCloud-Signature antes de processar um evento. Consulte Configurar webhooks para obter orientações de configuração e entrega.

Resposta do receptor

Retorne qualquer status 2xx depois de ter autenticado e aceito o evento de forma durável. Processe tarefas lentas de forma assíncrona para que a YCloud não tente reenviar uma entrega que sua aplicação já recebeu.

Configurar webhooks

Crie um endpoint, valide assinaturas e gerencie novas tentativas.

Navegar por exemplos anotados

Entenda os gatilhos de eventos e o tratamento específico para cada cenário.

Cabeçalhos

YCloud-Signature
string
Exemplo:

"t=1654084800,s=8eb70f2acb056c2119acbee8fdd98a889021d9c268bc9ad248a4182c40e31119"

Corpo

application/json

Represents a webhook event payload. Every event contains certain common properties: id, type, apiVersion, createTime. Each event may also contain some properties unique to the event. For example, sms is returned when type is sms.message.updated.

type
enum<string>
obrigatório

Type of event.

Opções disponíveis:
whatsapp.echo_message.created,
whatsapp.echo_message.updated
whatsappMessage
object
obrigatório

Included when type is whatsapp.message.updated, whatsapp.smb.message.created, or when type is whatsapp.smb.history for an outbound history message. Also included for whatsapp.echo_message.created and whatsapp.echo_message.updated, where the Agent echo subset applies. It is omitted for a metadata-only history chunk.

id
string
obrigatório

Unique ID for the event.

Required string length: 6 - 128
apiVersion
string
obrigatório

The API version used to render this event.

Exemplo:

"v2"

createTime
string<date-time>
obrigatório

The time at which this event was created, formatted in RFC 3339. e.g., 2022-06-01T12:00:00.000Z.

Exemplo:

"2022-06-01T12:00:00.000Z"

phase
integer<int32>

Included when type is whatsapp.smb.history and the event was generated from a Meta history chunk. Identifies the chunk's synchronization phase.

Exemplo:

1

progress
integer<int32>

Included when type is whatsapp.smb.history and the event was generated from a Meta history chunk. Reports the chunk's synchronization progress.

Exemplo:

73

contactAttributesChanged
object

Included when type is contact.attributes_changed.

contactCreated
object

Included when type is contact.created.

contactDeleted
object

Included when type is contact.deleted.

contactNote
object

Included when type is contact.note.created, contact.note.updated, or contact.note.deleted.

contactUnsubscribeCreated
object

Included when type is contact.unsubscribe.created.

contactUnsubscribeDeleted
object

Included when type is contact.unsubscribe.deleted.

emailDelivery
object

Included when type is email.delivery.updated.

sms
object

Included when type is sms.message.updated.

smsInbound
object

Included when type is sms.inbound.received.

voice
object

Included when type is voice.message.updated.

whatsappBusinessAccount
object

Included when type is whatsapp.business_account.deleted, whatsapp.business_account.reviewed, or whatsapp.business_account.updated.

whatsappInboundMessage
object

Included when type is whatsapp.inbound_message.received, or when type is whatsapp.smb.history for an inbound history message. It is omitted for a metadata-only history chunk.

whatsappMetaBusinessAgent
object

Included for whatsapp.meta_business_agent.handover.updated. Currently limited to Public REST API Agents.

whatsappGroup
object

Included when type is whatsapp.group.lifecycle_update, whatsapp.group.participants_update, whatsapp.group.settings_update, whatsapp.group.status_update, or when type is whatsapp.message.updated for group message status updates.

whatsappPhoneNumber
object

Included when type is whatsapp.phone_number.deleted, whatsapp.phone_number.name_updated, whatsapp.phone_number.quality_updated, or whatsapp.phone_number.business_username_updated.

whatsappPayment
object

Included when type is whatsapp.payment.updated.

whatsappTemplate
object

Included when type is whatsapp.template.reviewed, whatsapp.template.quality_updated, whatsapp.template.category_updated, or whatsapp.template.correct_category_detection.

callingConnect
object

Included when type is whatsapp.call.connect.

callingTerminate
object

Included when type is whatsapp.call.terminate.

callingStatusUpdated
object

Included when type is whatsapp.call.status.updated.

callingRecording
object

Included when type is whatsapp.call.recording.updated.

callingTranscription
object

Included when type is whatsapp.call.transcription.updated.

flowChanges
object

Included when type is whatsapp.flow.status_change.

whatsappUserPreference
object

Included when type is whatsapp.user.preferences.

messengerInboundMessage
object

Included when type is messenger.inbound_message.received or messenger.inbound_message.updated. Editing keeps the same message IDs and original times; event createTime is the edit time for updated events.

messengerMessage
object

Included when type is messenger.message.updated.

messengerMessageReaction
object

Included when type is messenger.message_reaction.updated. Event createTime is the source interaction time.

Resposta

200

The request is successfully accepted.