Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-139095

showAsAnswer field required for putMessageBoardMessage method

    Details

      Description

      While testing MessageBoardMessage APIs, we noticed that the `putMessageBoardMessage` method requires the showAsAnswer field to be included in the request body. (Related Slack Thread)

      Context
      I was calling the `putMessageBoardMessage` method for MessageBoardMessage using the following request body:

      {
        "headline": "PUT Test"
      }
      

      Expected Behavior
      It should replace the specified Message Board Message with the information sent in the request body.

      Actual Behavior
      It returned the following message: ` "status": "INTERNAL_SERVER_ERROR"`
      This PUT command only works if you include the "showAsAnswer" field in the request body:

      {
        "headline": "PUT Test",
        "showAsAnswer": false
      }
      

      I'm using liferay/dxp:7.4.12-ep3-d1.6.5-20210823093930

      Steps to Reproduce
      1. Start a Docker container

      docker run -it -p 8080:8080 liferay/dxp:7.4.12-ep3-d1.6.5-20210823093930
      

      2. Login and go to http://localhost:8080/o/api

      3. Under Headless Delivery, go to the MessageBoardThread service, and expand the POST to Site API (i.e., postSiteMessageBoardThread)

      4. Enter your Site id (e.g., 20125), remove all request fields except for headline, and execute the request.

      {
        "headline": "POST Thread",
      }
      

      5. Copy the new Message Board Thread's ID.

      6. Go to MessageBoardMessage service, and expand the POST to Thread API (i.e., postMessageBoardThreadMessageBoardMessage)

      7. Enter the new Thread's ID, remove all request fields except for headline, and execute the request.

      {
        "headline": "POST Message",
      }
      

      8. Copy the new Message Board Message's ID.

      9. Expand the PUT by Message ID API (i.e., putMessageBoardMessage)

      10. Enter the new Message's ID, remove all request fields except for headline, and execute the request.

      {
        "headline": "PUT Message Test",
      }
      

      This will return the "INTERNAL_SERVER_ERROR" message.

      11. Add the showAsAnswer field to the request body and execute the request. (It doesn't matter if the field's value is true or false)

      {
        "headline": "PUT Message Test",
        "showAsAnswer": false
      }
      

      This will execute the command as expected, replacing the specified Message's fields.

        Attachments

          Activity

            People

            Assignee:
            luismiguel.barco Luis Miguel Barcos
            Reporter:
            james.garcia James Garcia
            Participants of an Issue:
            Recent user:
            Sophia Zhang
            Engineering Assignee:
            Luis Miguel Barcos
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              12 weeks, 2 days ago

                Packages

                Version Package
                7.4.13 DXP GA1
                7.4.3.4 CE GA4
                Master