Skip to main content
Comments
Wade Williams avatar
Written by Wade Williams
Updated over a week ago

Overview

The comments API lets you fetch, create, delete, and manipulate comments made on items.

/api/products/{product_id}/items/{item_number}/comments.json

GET

Fetch comments for the given item_number. A list of comments ordered chronologoically are returned.

Arguments

This endpoint takes no arguments.

Example Response

[
    {
        "body": "Refs #285 and #286.\n\n* Mapped out a URL callback for EmailYak.\n* Set up settings, urls, etc. and a stubbed view for EmailYak.\n\nRan into a problem where you have to register every single email address you wish to receive email for. This would result in us having to make an API call for every single item and every single product created in the system. I've emailed the EmailYak guys and am hoping they'll have a fix by next week. This is blocking until then.",
        "type": "commit",
        "id": 400,
        "created_by": {
            "first_name": "Joe",
            "last_name": "Stump",
            "id": 1,
            "email": "joe@joestump.net"
        }
    },
    {
        "body": "Finished up the work for handling incoming emails to bugs and tasks. Closes #285, #286, #287, and #291. This now requires the [python-transloadit](https://github.com/joestump/python-transloadit) client that I created.",
        "type": "commit",
        "id": 445,
        "created_by": {
            "first_name": "Joe",
            "last_name": "Stump",
            "id": 1,
            "email": "joe@joestump.net"
        }
    }
]

Error Codes

  • 404 If product_id or item_number are invalid or unknown.

  • 403 If the user making the request is not a member of the product_id.

POST

Create a new comment on the given item_number on behalf of the requesting user.

Arguments

  • body (string, required): The comment's Markdown body.

Example Response

{
    "body": "These mockups look amazing. However, I think we should make the running guy glow when the AJAX queries are running instead of the 'Working...' header we have.",
    "type": "comment",
    "id": 445,
    "created_by": {
        "first_name": "Joe",
        "last_name": "Stump",
        "id": 1,
        "email": "joe@joestump.net"
    }
} 

Error Codes

  • 404 If product_id or item_number are invalid or unknown.

  • 403 If the user making the request is not a member of the product_id.

  • 400 If body argument is missing.

/api/products/{product_id}/items/{item_number}/comments/{comment_id}.json

Returns the given comment_id.

Arguments

This endpoint takes no arguments.

Example Response

 
{
    "body": "These mockups look amazing. However, I think we should make the running guy glow when the AJAX queries are running instead of the 'Working...' header we have.",
    "type": "comment",
    "id": 445,
    "created_by": {
        "first_name": "Joe",
        "last_name": "Stump",
        "id": 1,
        "email": "joe@joestump.net"
    }
}

Error Codes

  • 404 If the comment_id is invalid or unknown.

  • 403 If the user making the request is not a member of the product_id.

DELETE

Delete the comment specified by comment_id. NOTE: You cannot delete code commits via the API.

Arguments

This endpoint takes no arguments.

Example Response

 
{
    "body": "These mockups look amazing. However, I think we should make the running guy glow when the AJAX queries are running instead of the 'Working...' header we have.",
    "type": "comment",
    "id": 445,
    "created_by": {
        "first_name": "Joe",
        "last_name": "Stump",
        "id": 1,
        "email": "joe@joestump.net"
    }
} 

Error Codes

  • 404 If the comment_id is invalid or unknown.

  • 403 If the comment_id is a code commit or the requesting user is not the original author of the commit.

Did this answer your question?