DumGumDocs
Search documentation

Loading search…

Guides

Chat History Endpoint

You need to implement this endpoint on your side. It must return an array of messages belonging to a conversation between two profiles.

This endpoint is called whenever a conversation is enqueued, to keep your chat history and ours in sync.

Your endpoint must implement the Chat History OpenAPI webhook specification.

You can review the full example to get a better understanding of what needs to be implemented.

A message can carry media as well as text: pictureUrls and videoUrls for Vision Link, and audioUrls for the voice messages a User records. Media on a message sent by a User is what the Persona reacts to.

Give every message its own id and keep it stable from one call to the next. We store a message once per id: a later message that reuses an id we already have is ignored.

Contact Details You Removed

If your platform strips email addresses, phone numbers or links from users' messages, put one of these markers in the message text where you removed it:

MarkerReplaces
[AUTO-REMOVED: EMAIL]An email address
[AUTO-REMOVED: PHONE]A phone number
[AUTO-REMOVED: WEBSITE]A website or social media link

The Persona reads a marker as an attempt to take the conversation off your platform. She brushes it off warmly, in character, never asks what was removed, and never mentions the marker. The markers are read by every Chat 2 model.

Full Example

Let's simulate a request to https://your-domain.com/my/path?userProfileId=1234&personaProfileId=9999.

The endpoint will reply with the following response body (JSON):

{
  "messages": [
    {
      "id": "my-id-xxx-1",
      "sender": "PERSONA",
      "date": "2021-01-25T15:48:00Z",
      "text": "Hey there!"
    },
    {
      "id": "my-id-xxx-2",
      "sender": "PERSONA",
      "date": "2021-01-25T15:48:20Z",
      "text": "how are you?"
    },
    {
      "id": "my-id-xxx-3",
      "sender": "PERSONA",
      "date": "2021-01-25T15:48:30Z",
      "poke": true
    },
    {
      "id": "my-id-xxx-4",
      "sender": "USER",
      "date": "2021-01-25T15:49:20Z",
      "text": "good and you?",
      "sticker": "Sticker of a yellow speech bubble with \"HI!\" in black text"
    },
    {
      "id": "my-id-xxx-5",
      "sender": "USER",
      "date": "2021-01-25T15:49:21Z",
      "text": "check this photo!",
      "pictureUrls": [
        "https://example.com/image.jpg"
      ]
    },
    {
      "id": "my-id-xxx-6",
      "sender": "USER",
      "date": "2021-01-25T15:49:40Z",
      "audioUrls": [
        "https://example.com/voice-message.m4a"
      ],
      "audioLevelsDb": {
        "https://example.com/voice-message.m4a": -14.9
      }
    },
    {
      "id": "my-id-xxx-7",
      "sender": "PERSONA",
      "date": "2021-01-25T15:50:05Z",
      "text": "Wow, you look good, Need to see more ;)"
    },
    {
      "id": "my-id-xxx-8",
      "sender": "USER",
      "date": "2021-01-25T15:50:30Z",
      "text": "Thanks! here, for you",
      "gifts": [
        {
          "name": "Teddy Bear",
          "tier": "LOW"
        }
      ]
    }
  ]
}
Ask DumGum AIAnswers from the documentation

What can we help you build?

Ask about setup, content creation, or the API.

AI can make mistakes—verify important information against the sources. Conversations are kept for 30 days to improve the documentation, and questions and recent messages are sent to a third-party AI provider. Don’t include secrets or sensitive information.