Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,22 @@ update, delete and duplicate on campaigns, ad sets and network ads, plus `bulkSe

[`examples/CreatePost.java`](examples/CreatePost.java) creates a post against a running API.

## Chatbots and the inbox

The [chat adapter](https://fopost.com/docs/sdks/chat-adapter) turns the FoPost inbox into one send/receive channel for a chatbot
framework. It ships in the TypeScript and Python SDKs. There is no dedicated adapter here and no
API change behind it, so the same loop is three pieces with this client:

1. **Verify** the `inbox.message_received` webhook. The payload is ids only, on purpose, so
nothing a customer wrote sits in your logs. The [signing scheme](https://fopost.com/docs/webhooks/verification)
is HMAC-SHA256 over `{timestamp}.{body}`, refused past a five minute tolerance.
2. **Read** the item back with `client.inbox().list(InboxListParams.create()…)`, filtered to the payload's
`accountId` and matched on its `itemId`.
3. **Answer** with `client.inbox().reply(item.id(), text)`, or open a thread with
`client.inbox().startConversation(…)`.

Reading needs the `inbox` scope; answering needs `publish` as well.

## Contributing

Issues and pull requests are welcome at [fopost/fopost-java](https://github.com/fopost/fopost-java).
Expand Down
Loading