0

I have a comment type and content type with field from type of that comment type. I also using Rest and Rest UI modules. I want to insert new comment on specific node using rest API using POST request.

In the REST config page, I have this service enabled

enter image description here

What I want to do, what is the request body should be to insert new comment successfully through Postman.

1

I've solved it by these below

{
    "entity_id": [{
        "target_id": 612
    }],
    "entity_type": [{
        "value": "node"
    }],
    "comment_type": [{
        "target_id": "discussion"
    }],
    "field_name": [{
        "value": "discussion_comments"
    }],
    "subject": [{
        "value": "Goodbye World"
    }],
    "comment_body": [{
        "value": "comment which you want write"
    }]
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.