7 Replies Latest reply on Oct 5, 2015 12:07 AM by nemesis03

    How to edit the subject of an answer in a discussion through REST API

    nemesis03

      Hello,

       

      I am trying to edit the subject of an answer in a discussion. The background:

      A customer starts a discussion and posts private information (e.g. phone number) in subject and content:

      question subject: "Invoice wrong, phone number: 1234567"

      question content: "Help, I am overcharged. My phone number is 1234567"

      Then someone answers:

      answer subject: "Re: Invoice wrong, phone number: 1234567"

      answer content: "Can you be a bit more specific"

      Then an admin sees this discussion and edits the phone number:

      question subject: "Invoice wrong, phone number: XXXX567"

      question content: "Help, I am overcharged. My phone number is XXXX567"

      Unfortunately the subject of the answer cannot be edit and is not updated automatically. So the phone number is still visible in the answer's subject.

       

      I now tried to edit the answer through REST API

      URL: https://domain/api/core/v3/messages/<message-id>

      Method: PUT

      content type: application/json

      content: {"content" : {"text" : "<body>Can you be a bit more specific. Edit: edited subject</body>","type" : "text/html"}}

      This returns the following error:

      {

        "error" : {

          "code" : "subjectMissing",

          "message" : "Missing subject",

          "status" : 400

        }

      }

      When I include the subject (actually this is what I want to do):

      URL: https://domain/api/core/v3/messages/<message-id>

      Method: PUT

      content type: application/json

      content: {"content" : {"text" : "<body>Can you be a bit more specific. Edit: edited subject</body>","type" : "text/html"}, "subject":"Re: Invoice wrong, phone number: XXXX567"}

      The response is the updated message, but only the content is updated. The subject of the message is unchanged.

       

      What am I doing wrong? Any ideas?