Datafeed - Real Time Events
Introduction to Datafeed
Datafeed is a service that transmits encrypted messages that come from the end users to the bot (e.g. service account). The datafeed provides messages and events from all conversations that the user is in. The types of events surfaced in the datafeed can be found in the Real Time Events list.
End of support for /agent/v4/datafeed endpoints (previously known as Datafeed 1.0)
The following endpoints are deprecated and should no longer be used:
/agent/v4/datafeed/create
/agent/v4/datafeed/{id}/read
If you are still using these endpoints, please upgrade to the new /agent/v5/datafeeds endpoints.
As a last resort, you can enable the datafeed bridge in the Agent config in order to automatically map the calls you make on the deprecated APIs towards the new APIs. This however does not allow you to benefit from all the reliability improvements of the new service. This is a short term solution. Please plan the migration of your bots to the new v5 endpoints.
Changes required to upgrade to v5 endpoints
The v5 endpoints are different from the v4 ones, so migrating requires changes in your code. If you are using our BDKs in Java or Python, migrating to v5 is a simple configuration change.
Otherwise, the mapping between the API endpoints is the following:
Path /agent/v4/datafeed (deprecated)
Via a POST on the endpoint /agent/v4/datafeed/create, the datafeed is created and then the ID is persisted in a file, which is by default datafeed.id on the bot side
The bot subscribes to this ID to retrieve datafeed events; if it cannot be retrieved by using this ID, a new datafeed is created
Via a GET on the endpoint /agent/v4/datafeed/{id}/read, the list of events within the specific datafeed identified with {id} is returned
Deleting a datafeed is not supported
Path /agent/v5/datafeeds
Via a GET on the endpoint /agent/v5/datafeeds, is returned the list of already created IDs for a service account
Via a POST on the endpoint /agent/v5/datafeeds, the datafeed is created and the ID is not persisted on the bot side → Even if the bot is stale, a GET on the same endpoint will retrieve the ID to which the service account is subscribed
Via a POST on the endpoint /agent/v5/datafeeds/{id}/read with a parameter ackId (empty string at the first query), the endpoint returns: the list of events, a new ackId string → This ackId permits acknowledgement of the last query and retrieve all events since the last one. All events received between the last payload and the new request are queued and therefore retrieved.
Via a DELETE on /agent/v5/datafeeds/{id}, the datafeed specified with the {id} is deleted.
Last updated