Skip to Content

SAP Conversational AI Webhook List response

Hello Experts,

I'm new to SAP conversational AI. but i'm really excited for my first bot.

i have webhook that should return a list to the bot. as i understood from the documents i should return something like this. {

  "replies": [
    {
      "Type": "list",
      "content": {
        "elements": [
          {
            "title": "CreatedBy",
            "imageUrl": "link here",
            "subtitle": "Basel",
            "buttons": []
          }
        ],
        "buttons": []
      }
    }
  ]
}

but i'm facing this on the bot

and the memory is:

{
  "nlp": {
    "uuid": "729bf813-4dc9-42cf-95c1-518bc3a1774b",
    "intents": [
      {
        "slug": "queryticket",
        "confidence": 0.99,
        "description": "Ask for A Specific Ticket"
      }
    ],
    "entities": {
      "tid": [
        {
          "value": "1575088166542",
          "raw": "1575088166542",
          "confidence": 0.64
        }
      ]
    },
    "language": "en",
    "processing_language": "en",
    "version": "1909.0.3",
    "timestamp": "2019-11-11T19:35:21.473540+00:00",
    "status": 200,
    "source": "search ticket 1575088166542",
    "act": "command",
    "type": null,
    "sentiment": "neutral"
  },
  "qna": {},
  "messages": [
    {
      "Type": "list",
      "content": {
        "elements": [
          {
            "title": "U_CreatedBy",
            "imageUrl": "https://image.shutterstock.com/image-photo/colorful-flower-on-dark-tropical-260nw-721703848.jpg",
            "subtitle": "Basel",
            "buttons": []
          }
        ],
        "buttons": []
      }
    }
  ],
  "conversation": {
    "id": "test-1573500875239",
    "language": "en",
    "memory": {
      "TicketNumber": {
        "value": "1575088166542",
        "raw": "1575088166542",
        "confidence": 0.64
      }
    },
    "skill": "searchticket",
    "skill_occurences": 1
  },
  "logs": {
    "input": "search ticket 1575088166542",
    "logs": [
      {
        "level": "info",
        "code": "I_SKILL_TRIGGERED",
        "data": {
          "skill_id": "09357818-14e8-48a3-b881-dad2df48b567",
          "reason": "TRIGGERS_OK",
          "message": "skill searchTicket has been triggered"
        },
        "timestamp": "2019-11-11T19:35:21.000Z"
      },
      {
        "level": "info",
        "code": "I_REQUIREMENT_FULFILLED",
        "data": {
          "requirement_id": "6440f0bd-9278-4c4a-bb9a-0dc3d40c7c21",
          "requirement_name": "TicketNumber",
          "value": {
            "value": "1575088166542",
            "raw": "1575088166542",
            "confidence": 0.64
          },
          "message": "requirement TicketNumber has been fulfilled with {\"value\"=>\"1575088166542\", \"raw\"=>\"1575088166542\", \"confidence\"=>0.64}"
        },
        "timestamp": "2019-11-11T19:35:21.000Z"
      },
      {
        "level": "info",
        "code": "I_REQUIREMENTS_OK",
        "data": {
          "skill_id": "09357818-14e8-48a3-b881-dad2df48b567",
          "message": "requirements of skill searchTicket validated, executing actions"
        },
        "timestamp": "2019-11-11T19:35:21.000Z"
      },
      {
        "level": "info",
        "code": "I_EXECUTE_ACTION",
        "data": {
          "type": "http",
          "value": {
            "messages": [
              {
                "Type": "list",
                "content": {
                  "elements": [
                    {
                      "title": "U_CreatedBy",
                      "imageUrl": "https://image.shutterstock.com/image-photo/colorful-flower-on-dark-tropical-260nw-721703848.jpg",
                      "subtitle": "Basel",
                      "buttons": []
                    }
                  ],
                  "buttons": []
                }
              }
            ],
            "fallback": null
          }
        },
        "timestamp": "2019-11-11T19:35:26.000Z"
      }
    ]
  },
  "hasDelay": true,
  "hasNextMessage": false
}

can anyone tell me what is it i'm doing wrong?

thanks in advance.

bot1.png (9.5 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

6 Answers

  • Best Answer
    Posted on Nov 18, 2019 at 07:55 AM

    Hello Bilal!

    Since you can create a list in conversational AI's GUI which does not contain buttons, I was wrong to think you would have to add some. But nevertheless, you can't just drop the keywords in the json.

    I think your json should look like this:

    {
        "type": "list",
        "content": {
            "elements": [
                {
                    "title": "Title1",
                    "imageUrl": "",
                    "subtitle": "Subtitle1",
                    "buttons": []
                },
    	    {
                    "title": "Title2",
                    "imageUrl": "",
                    "subtitle": "Subtitle2",
                    "buttons": []
                }
            ]
        }
    }

    But I think there is a bug in the documentation. Due to the documentation, after the elements array there comes a second section with buttons. I can't see why this should be the case.

    I think this second section was the one that Rodrigo Ariel Giner de la Vega referred to.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 12, 2019 at 08:08 PM

    Hi, I agree with Monika, it´s case sensitive also I believe the format should be, I think that the buttons object can´t be alone. all have to be inside elements.

    { <br>  "type":"list",<br>  "content":{ <br>  "elements":[ <br>    { <br>     "title":"U_CreatedBy",<br>     "imageUrl":"https://image.shutterstock.com/image-photo/colorful-flower-on-dark-tropical-260nw-721703848.jpg",<br>     "subtitle":"Basel",<br>     "buttons":[]<br>    }<br>    ]<br>  }<br>}
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 13, 2019 at 12:12 PM

    Hi Bilal Sultan buttons can not be empty you need to make sure you have buttons array that contains something.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 13, 2019 at 02:10 PM

    Monika Radike , Rodrigo Ariel Giner de la Vega , Pierre-Edouard Lieb

    Thanks alot guys.
    the problem was as Monika suggested to rename the Type to type.
    i've also removed empty arrays.

    Anyways, i'm having another issue now.
    the Chatbot is disapearing as soon as my API sends the response.
    i've tried everything but nothing is actually working.
    here is the json i send to the bot

     {
      "replies": [
        {
          "type": "list",
          "content": {
            "elements": [
              {
                "title": "U_CreatedBy",
                "subtitle": "AraAmeer"
              },
              {
                "title": "Price",
                "subtitle": "157.490000"
              },
              {
                "title": "CardName",
                "subtitle": "PEGASUS BAGHDAD"
              }
            ]
          }
        }
      ]
    }
    

    can anyone figure out the problem? this json was working correctly. but suddenly any list i send back is making the bot disappears.

    thanks in advance.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 16, 2019 at 12:08 PM

    Monika Radike

    do you mean that the list MUST have buttons?
    i'm only showing data in a list. also i don't think this is the problem cuz this json was working fine.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 20, 2019 at 11:08 AM

    Monika Radike

    Thanks a lot everything works now.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.