SDK ReferenceReports & webhooks

Reports & webhooks

The send result only tells you the request was accepted; the final delivery outcome comes as a report. Choose how to receive reports (POLLING or WEBHOOK) per API Key in the console.

MethodWhen to use itSDK
PollingYour server cannot accept calls from outsidereports.consume
WebhookYou want Bizgo to push reports to your serverWebhookReceiver
Single lookupCheck the result of one message (within 30 days)reports.inquiry

Polling

Only batches your handler processed successfully are acknowledged. If the handler throws (or returns an error in Go), you receive the same batch again. The same report can arrive more than once, so store it with an upsert keyed on msgKey.

Java
int handled = client.reports().consume(reports -> {
    for (Report r : reports) {
        db.upsert(r.getMsgKey(), r.getReportCode());
    }
});

Webhook

Verify the signature of the request Bizgo sends and respond within 5 seconds with {"msgKey": ...}. Respond 401 when the signature is wrong. Request the webhook secret from Bizgo separately and keep it outside your code, for example in the BIZGO_WEBHOOK_SECRET environment variable.

Java
WebhookReceiver receiver = new WebhookReceiver(System.getenv("BIZGO_WEBHOOK_SECRET"));

// inside your web framework handler
try {
    ReportWebhookPayload report = receiver.report(headers, rawBody);
    enqueue(report);                                   // do heavy work asynchronously
    return ok(Webhooks.ackJson(report.getMsgKey()));   // {"msgKey":"..."}
} catch (WebhookVerificationException e) {
    return status(401);
}

Security. The SDK verifies the signature and the timestamp tolerance (300 seconds by default) and accepts bodies up to 1 MB with JSON nested up to 64 levels. In production, also use HTTPS, an allow list of Bizgo webhook source IPs, and deduplication on msgKey, and confirm important decisions with the report or status lookup API.

Counsel talk webhooks

The SDKs can also parse the seven Kakao counsel talk webhooks (counsel_message, counsel_result, counsel_reference, counsel_expired_session, counsel_seen_info, counsel_personal_info, counsel_cert_result). They differ from report webhooks as follows.

  • They are not signed. Signatures apply only to report and MO webhooks, so you do not need a webhook secret if you only receive counsel talk.
  • The response is {"code": "A000", "result": "Success"} instead of {"msgKey"}.
  • The body contains conversation content and personal information. Keep it out of logs, APM, and error reports.

For the function names in each language, see the counsel talk webhook section of each repository README.

Single lookup

Look up the report for one msgKey directly. Only messages sent within the last 30 days can be looked up.

Java
client.reports().inquiry(msgKey);