cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Conversational AI Webhook List response

0 Kudos
695

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.

Have you tried writing "type" instead of "Type"? I think this code is case sensitive.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

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.

Answers (5)

Answers (5)

0 Kudos

radike

Thanks a lot everything works now.

0 Kudos

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.

0 Kudos

radike , rodrigoariel.ginerdelavega , pe.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.

Pierre-Edouard Lieb wrote that you may not leave the button array empty. So why have you removed instead of filled them? I guess the reason why the chatbot disappears, is because he doesn't know what to do with your reply. It is a block of code that does not match any message concept he knows.

former_member616825
Participant
0 Kudos

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

Rodrigo-Giner
Active Contributor
0 Kudos

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>}