Site Admin APIs

  1. Home
  2. Site Admin APIs
  3. Feedback API

Feedback API

This API provides access to the Koordinates feedback, including comments and tickets. 

Ticket Types

Comments: These are messages attached to other objects. They do not have a status and will appear under the commments filter in the feedback admin lists and as comments in the item comments pages. They do not have their own detail pages.

Tickets: A ticket has a status (intially open) and appears under the tickets filter in admin lists. A ticket will not appear in item comments pages - instead they have their own detail pages.

Note that a comment can become a ticket by setting the status of the comment to a non-blank value.

Updates

An update to feedback can change ticket properties and always adds a new update record. The update holds a user-supplied message and references to attachments and permalinks. The update also provides information about changes to feedback properties.

Feedback Collection

GET /comments/
List all feedback

Response 200

Headers

Content-Type: application/json

Body

[
    {
        "id": 125, 
        "created_at": "2013-11-17T19:28:55Z", 
        "created_by": {
            "id": 4, 
            "first_name": "Hamish", 
            "last_name": "Campbell", 
            "avatar_url": "https://secure.gravatar.com/avatar/87d83eb23f1f21156e536961004c098a?s=50&d=https%3A%2F%2Fhc.dev.kx.gd%2Fres%2Fmedia%2Fimages%2Fno_avatar.png"
        }, 
        "status": "open", 
        "sub_status": "", 
        "html_url": "/comm/125/", 
        "updated_at": "2013-11-18T10:01:34.086", 
        "assignee": null, 
        "mapstream": {
            "id": 4, 
            "name": "Hamish Campbell", 
            "html_url": "https://hc.dev.kx.gd/user/4/"
        }, 
        "ticketed_object": {
            "type": "layer", 
            "html_url": "/layer/22-erdas-auckland/", 
            "id": 22
        }, 
        "title": "Test comment against a...", 
        "description": "Test comment against a layer.", 
        "description_html": "<p>Test comment against a layer.</p>", 
        "tags": ""
    }
]
POST /comments/
Create feedback

Required fields:

  • description.

Optional fields:

  • title 
  • attachments
  • permalink_url
  • ticketed_object

Request

Headers

Content-Type: application/json

Body

{
    "title": "An optional title",
    "description": "The body description with *lots of detail* here.",
    "attachments": [16],
    "permalink_url":"https://koordinates.com/?mt=Streets",
}

Response 201

Headers

Content-Type: application/json

Body

{
    "id": 128,
    "created_at": "2013-11-17T21:59:21Z",
    "created_by": {
        "id": 4,
        "first_name": "Hamish",
        "last_name": "Campbell",
        "avatar_url": "..."
    },
    "title": "An optional title",
    "status": "open",
    "sub_status": "",
    "html_url": "/comm/128/",
    "updated_at": "2013-11-18T10:59:21.271",
    "assignee": null,
    "mapstream": null,
    "description": "The feedback body description with *lots of detail* here.",
    "description_html": "<p>The feedback body description with <i>lots of detail</i> here.</p>",
    "tags": "",
    "updates": [
        {
            "id": 461,
            "created_at": "2013-11-17T21:59:21Z",
            "created_by": {
                "id": 4,
                "first_name": "Hamish",
                "last_name": "Campbell",
                "avatar_url": "..."
            },
            "description": "The feedback body description with *lots of detail* here.",
            "description_html": "<p>The feedback body description with <i>lots of detail</i> here.</p>",
            "changes": {},
            "attachments": [
                {
                    "id": 16,
                    "title": "00500 1 1",
                    "license": {
                        "title": "Creative Commons Attribution 3.0",
                        "type": 1,
                        "type_name": "Creative Commons license"
                    },
                    "html_url": "https://hc.dev.kx.gd/document/16-00500-1-1/",
                    "download_url": "https://hc.dev.kx.gd/document/16-00500-1-1/download/",
                    "extension": "tif",
                    "file_size": 47064492,
                    "file_size_formatted": "44.0 MB"
                }
            ],
            "permalink_url": "https://koordinates.com/?mt=Streets",
            "is_internal": true
        }
    ]
}

Ticket

GET /comments/{id}/
Get detail about a Ticket

Response 200

Body

{
    "id": 128,
    "created_at": "2013-11-17T21:59:21Z",
    "created_by": {
        "id": 4,
        "first_name": "Hamish",
        "last_name": "Campbell",
        "avatar_url": "..."
    },
    "title": "An optional title",
    "status": "open",
    "sub_status": "",
    "html_url": "/comm/128/",
    "updated_at": "2013-11-18T10:59:21.271",
    "assignee": null,
    "mapstream": null,
    "ticketed_object": {
        "type": "warehouse",
        "html_url": "/",
        "id": 1
    },
    "description": "The feedback body description with *lots of detail* here.",
    "description_html": "<p>The feedback body description with <i>lots of detail</i> here.</p>",
    "tags": "",
    "updates": [
        {
            "id": 461,
            "created_at": "2013-11-17T21:59:21Z",
            "created_by": {
                "id": 4,
                "first_name": "Hamish",
                "last_name": "Campbell",
                "avatar_url": "..."
            },
            "description": "The feedback body description with *lots of detail* here.",
            "description_html": "<p>The feedback body description with <i>lots of detail</i> here.</p>",
            "changes": {},
            "attachments": [
                {
                    "id": 16,
                    "title": "00500 1 1",
                    "license": {
                        "title": "Creative Commons Attribution 3.0",
                        "type": 1,
                        "type_name": "Creative Commons license"
                    },
                    "html_url": "https://hc.dev.kx.gd/document/16-00500-1-1/",
                    "download_url": "https://hc.dev.kx.gd/document/16-00500-1-1/download/",
                    "extension": "tif",
                    "file_size": 47064492,
                    "file_size_formatted": "44.0 MB"
                }
            ],
            "permalink_url": "https://koordinates.com/?mt=Streets",
            "is_internal": true
        }
    ]
}
PUT /comments/{id}/
Add a simple update

An example of updating feedback without changing properties.

Request

Headers

Content-Type: application/json

Body

{
    "is_internal": false,
    "description": "test",
}

Response 200

Body

{
    "id": 571,
    "created_at": "2013-12-18T21:30:30Z",
    "created_by": {
        "id": 4,
        "first_name": "Hamish",
        "last_name": "Campbell",
        "avatar_url": "..."
    },
    "description": "test",
    "description_html": "<p>test</p>",
    "changes": {},
    "attachments": [],
    "permalink_url": null,
    "is_internal": false
}
PUT /comments/{id}/
Modify feedback properties

Update feedback with changes to properties.

Request

Headers

Content-Type: application/json

Body

{
    "status": "onhold",
    "description": "Waiting for further information",
    "is_internal": true,

}

Response 200

Body

{
    "id": 573,
    "created_at": "2013-12-19T22:34:05Z",
    "created_by": {
        "id": 4,
        "first_name": "Hamish",
        "last_name": "Campbell",
        "avatar_url": "..."
    },
    "description": "Waiting for further information.",
    "description_html": "<p>Waiting for further information.</p>",
    "changes": {
        "status": {
            "to": "onhold",
            "from": "open"
        }
    },
    "attachments": [],
    "permalink_url": null,
    "is_internal": true
}
DELETE /comments/{id}/
Delete feedback

Response 204