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
  • order_item
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":804,"userId":2,"createdAt":"2019-02-12T19:52:09+01:00","text":"Rerum ipsam fuga voluptas tempora aut consequatur nulla dolore incidunt pariatur quia qui.","id":559,"referenceType":"contact","isVisibleForContact":false}

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', 'order_item'.
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
  • order_item
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":471,"userId":null,"createdAt":"2019-02-13T01:56:51+01:00","text":"Consequatur ratione esse magnam fuga in rerum similique voluptatem molestiae.","id":717,"referenceType":"item_variation","isVisibleForContact":true},{"referenceValue":860,"userId":null,"createdAt":"2019-01-20T02:33:06+01:00","text":"Et rerum cumque delectus minima sed illum in est accusantium autem dolor sit corporis.","id":297,"referenceType":"category","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
  • order_item
required allowed values are category, contact, order, item_variation, order_item
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":"item_variation","referenceValue":711,"text":"Accusantium ea laborum a exercitationem at iste cum eligendi iusto quos voluptas minima sed.","isVisibleForContact":true}

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
  • order_item
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
  • order_item
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.

Is this article helpful?

 

Thank you for your Feedback

you can close this field now!