LoudVoice API \ Discussions \ Update discussion

Resource/URI - Discussions GET POST PUT DELETE
Discussions /loudvoice/discussions.json List all discussions Create a discussion
Discussion /loudvoice/discussions/<discussion_token>.json /loudvoice/discussions/discussion.json?
discussion_reference=<discussion_reference>
Read a discussion Update a discussion Delete a discussion
Discussion messages /loudvoice/comments/<discussion_token>/comments.json /loudvoice/discussions/discussion/comments.json?
discussion_reference=<discussion_reference>
Read discussion comments
Resource/URI - Authors GET POST PUT DELETE
Authors /loudvoice/authors.json List all authors Create an author
Author /loudvoice/authors/<author_token>.json /loudvoice/authors/author.json?
author_reference=<author_reference>
Read an author Update an author Delete an author
Resource/URI - Author Sessions GET POST PUT DELETE
Author Sessions /loudvoice/authors/sessions.json Create/Update a session
Author Session /loudvoice/authors/sessions/<session_token>.json Delete a session
Resource/URI - Comments GET POST PUT DELETE
Comments /loudvoice/comments.json List all comments Create comment
Comment /loudvoice/comments/<comment_token>.json Read a comment Update comment Delete a comment

Workflow

Request: the code to send to the API

Send a PUT request with the data below to the endpoint /loudvoice/discussions/<discussion_token>.json to update a discussion. The <discussion_token> has to be replaced by the unique token of an existing discussion.

You can also update the discussion using it's reference and the following endpoint: /loudvoice/discussions/discussion.json?discussion_reference=<discussion_reference>.

Only the fields specified in the request are updated, the other fields remain unchanged.

PUT data to include in the request

{
    "request":{
        "discussion":{
          "discussion_reference" : "#discussion_reference#",
          "title" : "#title#",
          "url" : "#url#",
          "is_closed" : #is_closed#,
          "is_trashed" : #is_trashed#
        }
    }
}
Key Description
discussion_reference
string
This value is used to indicate which discussion needs to be displayed when embedding LoudVoice using our JavaScript API. The value must be unique amongst your discussions. If left empty, the discussion cannot be embedded using the JavaScript API.
Example: PAGE-124
title
string
The title of the page where the discussion is displayed.
Example: Shop Item 27
url
string
The URL of the page where the discussion is displayed.
Example: http://www.example.com/shop/item/25/
is_closed
boolean
Indicates whether the discussion is closed or not. If a discussion is closed, it will still be visible, but no more comments can be left.
Default : false
is_trashed
string
Indicates whether the discussion has been trashed or not. Thrashed discussion are not displayed and no comments can be left.
Example : false

Result: the code returned by the API

The API will either return a HTTP status code 200 on success or an appropriate message body with further details on the error that occured.

Resultset Example

{
    "response": {
        "request": {
            "date": "Thu, 22 Mar 2018 11:59:08 +0100",
            "resource": "/loudvoice/discussions/eaaf4ebc-f75e-4910-a320-fa4975bb0e65.json",
            "status": {
                "flag": "success",
                "code": 200,
                "info": "Your request has been processed successfully"
            }
        },
        "result": {
            "data": {
                "discussion": {
                    "discussion_token": "eaaf4ebc-f75e-4910-a320-fa4975bb0e65",
                    "discussion_reference": "my-discussion-token",
                    "date_creation": "Thu, 22 Mar 2018 11:39:15 +0100",
                    "title": "my discussion title",
                    "url": "http://example.com/discussion-1",
                    "is_closed": false,
                    "is_trashed": false,
                    "num_comments": 0,
                    "date_last_comment": null,
                    "date_last_update": "Thu, 22 Mar 2018 11:59:08 +0100"
                }
            }
        }
    }
}

User Contributed Notes