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.

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-2",
      "sender": "PERSONA",
      "date": "2021-01-25T15:48:20Z",
      "text": "Wow, you look good, Need to see more ;)"
    },
    {
      "id": "my-id-xxx-5",
      "sender": "USER",
      "date": "2021-01-25T15:49:21Z",
      "text": "Thanks! here, for you",
      "gifts": [
        {
          "name": "Teddy Bear",
          "tier": "LOW"
        }
      ]
    }
  ]
}