REST Comment

Get, create and delete comments.

Get a comment

Gets a comment. The ID of the comment must be specified.

/rest/comments/{commentId}

Parameters

Field Type Description
commentId Int The ID of the comment

Success 200

Field Type Description
id Int The ID of the comment
referenceType String The reference type. Valid types are:
  • category
  • contact
  • order
  • item_variation
referenceValue Int The reference value
userId Int The ID of the user
createdAt String|\Carbon The date when the comment was created
text String The comment text
isVisibleForContact Bool If true, the comment is visible for the associated contact.
{"referenceValue":342,"userId":null,"createdAt":"2018-05-03T12:57:18+02:00","text":"Praesentium eum qui magnam ad reiciendis fugit fugiat consequatur.","id":11,"referenceType":"contact","isVisibleForContact":true}

Errors 4xx

Code Exception Description
401 League\OAuth2\Server\Exception\AccessDeniedException The resource owner or authorization server denied the request.
401 League\OAuth2\Server\Exception\InvalidRequestException The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "access token" parameter.

List comments

Lists comments. The reference type and the reference value must be specified (e.g. the reference type is 'order' and the reference value is the ID of the order).

/rest/comments/{referenceType}/{referenceValue}

Parameters

Field Type Description
referenceType String The reference type. Valid types are 'category', 'contact', 'order'.
referenceValue Int The reference value
userId Int The ID of the user the comment belongs to
isVisibleForContact Bool If true, the comment is visible for the associated contact.

Success 200

Field Type Description
id Int The ID of the comment
referenceType String The reference type. Valid types are:
  • category
  • contact
  • order
  • item_variation
referenceValue Int The reference value
userId Int The ID of the user
createdAt String|\Carbon The date when the comment was created
text String The comment text
isVisibleForContact Bool If true, the comment is visible for the associated contact.
[{"referenceValue":673,"userId":null,"createdAt":"2018-05-18T07:40:05+02:00","text":"Voluptatum sint nihil dolorem at dolorem quibusdam voluptas mollitia ea minima ullam.","id":955,"referenceType":"item_variation","isVisibleForContact":true},{"referenceValue":156,"userId":null,"createdAt":"2018-05-02T16:40:28+02:00","text":"Fugiat rerum qui explicabo libero repellat distinctio nesciunt qui repellendus.","id":366,"referenceType":"contact","isVisibleForContact":true}]

Errors 4xx

Code Exception Description
401 League\OAuth2\Server\Exception\AccessDeniedException The resource owner or authorization server denied the request.
401 League\OAuth2\Server\Exception\InvalidRequestException The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "access token" parameter.

Create a comment

Creates a comment.

/rest/comments

Request

Field Type Description
referenceType String The reference type. Valid types are:
  • category
  • contact
  • order
  • item_variation
required allowed values are category, contact, order, item_variation
referenceValue Int The reference value required
userId Int The ID of the user
text String The comment text required
isVisibleForContact Bool If true, the comment is visible for the associated contact. required
{"referenceType":"order","referenceValue":770,"userId":4,"text":"Amet rerum praesentium omnis neque animi corporis ratione sit molestiae non qui et.","isVisibleForContact":false}

Success 200

Field Type Description
id Int The ID of the comment
referenceType String The reference type. Valid types are:
  • category
  • contact
  • order
  • item_variation
referenceValue Int The reference value
userId Int The ID of the user
createdAt String|\Carbon The date when the comment was created
text String The comment text
isVisibleForContact Bool If true, the comment is visible for the associated contact.

Errors 4xx

Code Exception Description
401 League\OAuth2\Server\Exception\AccessDeniedException The resource owner or authorization server denied the request.
401 League\OAuth2\Server\Exception\InvalidRequestException The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "access token" parameter.

/rest/comments/{commentId}

Parameters

Field Type Description
commentId Int The ID of the comment
referenceType String The reference type. Valid types are 'category', 'contact', 'order'.
referenceValue Int The reference value
userId Int The ID of the user the comment belongs to
isVisibleForContact Bool If true, the comment is visible for the associated contact.

Success 200

Field Type Description
id Int The ID of the comment
referenceType String The reference type. Valid types are:
  • category
  • contact
  • order
  • item_variation
referenceValue Int The reference value
userId Int The ID of the user
createdAt String|\Carbon The date when the comment was created
text String The comment text
isVisibleForContact Bool If true, the comment is visible for the associated contact.

Errors 4xx

Code Exception Description
401 League\OAuth2\Server\Exception\AccessDeniedException The resource owner or authorization server denied the request.
401 League\OAuth2\Server\Exception\InvalidRequestException The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "access token" parameter.

Delete a comment

Deletes a comment. The ID of the comment must be specified.

/rest/comments/{commentId}

Parameters

Field Type Description
commentId Int The ID of the comment

Success 200

This call does not have a response output.

Errors 4xx

Code Exception Description
401 League\OAuth2\Server\Exception\AccessDeniedException The resource owner or authorization server denied the request.
401 League\OAuth2\Server\Exception\InvalidRequestException The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "access token" parameter.