Skip to main content
Kinetic Community

Uploads

This resource describes the process of uploading, deleting and fetching Uploads. In Kinetic Response an Upload is any file that is being attached to an issue. If the files being attached are images, Kinetic Response allows the client to download a thumbnail sized version of the image in addition to the actual image file.

Uploading an Upload

Uploads are uploaded as mulitpart/form-data.

HTTP Request

Method: POST

URL: api/v1/issues/<issue_guid>/uploads

Headers: Authorization Bearer <token>

Content:

Multi-part File : "upload[file]" This is the file to be uploaded.

Multi-part Parameter : "upload[description]" This is a text description of the file to be uploaded.

Parameters

 
Route Parameter Name Description Required / Optional

Multi-part File

upload[file] Required
Multi-part Parameter upload[description] Optional

HTTP Response

Response Type: application/json

Response Data:

A successful API response will contain a 200 response code and a JSON formatted response body corresponding to the newly created Upload.

 

Example Response:

{
    "id": 543,
    "user_id": 71,
    "issue_id": 376,
    "file_file_name": "15600563484_71654d0510_k.jpg",
    "file_content_type": "application/octet-stream",
    "created_at": "2015-04-01T16:06:29.778-05:00",
    "updated_at": "2015-04-01T16:06:29.778-05:00",
    "file_file_size": "1400331.0",
    "deleted_at": null,
    "status": "Active",
    "description": "some screenshot",
    "guid": "e62caff9-3685-415d-87ef-c5d8a41063e4",
    "file_processing": true,
    "width": null,
    "height": null
}

 

A failed API response will contain either a 400 or a 500 series response code based on the exception type, and a JSON formatted response body containing the exception message.  See the table below for the types of responses that may be encountered with this API web method.

 

Response Codes

Response Code Reason
200 Successful request.
401 The auth. token is invalid and needs to be refreshed.
404 If the provided URL was not found on this server.
500 If there was an unexpected server error.

 

Deleting an Upload

Edit section

HTTP Request

Edit section

Method: DELETE

URL: /api/v1/issues/<issue_guid>/uploads/<upload_guid>

Headers: Content-Type application/json AND Accept application/json AND Authorization Bearer <token>

 

HTTP Response

Edit section

Response Type: application/json

Response Data:

A successful API response will contain a 200 response code.

A failed API response will contain either a 400 or a 500 series response code based on the exception type, and a JSON formatted response body containing the exception message.  See the table below for the types of responses that may be encountered with this API web method.

 

Response Codes

Edit section
Response Code Reason
200 Successful request.
400 Bad Request. Json might have a field named incorrectly.
401 The auth. token is invalid and needs to be refreshed.
404 If the provided URL was not found on this server.
500 If there was an unexpected server error.
 

Fetching Uploads

A list of Uploads can be fetched for a particular issue. Note, these are the JSON descriptions of the Uploads that have been attached, not the actual files themselves.

HTTP Request

Method: GET

URL: /api/v1/issues/<issue_guid>/uploads

Headers: Content-Type application/json AND Accept application/json AND Authorization Bearer <token>

 

HTTP Response

Response Type: application/json

Response Data:

A successful API response will contain a 200 response code and a JSON formatted response body corresponding to an array of Uploads on an Issue that matches the <issue_guid>.

 

Example Response:

[
    {
        "id": 323,
        "user_id": 71,
        "issue_id": 92,
        "file_file_name": "JPEG_20140829_085501_-1352941551.jpg",
        "file_content_type": "image/png",
        "created_at": "2014-12-10T13:57:10.242-06:00",
        "updated_at": "2014-12-10T13:57:20.512-06:00",
        "file_file_size": "2848426.0",
        "deleted_at": null,
        "status": "Active",
        "description": "asdf",
        "guid": "a65485ee-e01f-4e5f-92ef-973538136d69",
        "file_processing": false,
        "width": 1944,
        "height": 2592
    }
]

 

A failed API response will contain either a 400 or a 500 series response code based on the exception type, and a JSON formatted response body containing the exception message.  See the table below for the types of responses that may be encountered with this API web method.

 

Response Codes

Response Code Reason
200 Successful request.
401 The auth. token is invalid and needs to be refreshed.
404 If the provided URL was not found on this server.
500 If there was an unexpected server error.

Fetching Specific Attachment

Edit section

A single Upload file can be fetched for a particular issue. This will return the actual file that was attached.

HTTP Request

Edit section

Method: GET

URL: /api/v1/issues/<issue_guid>/uploads/<upload_guid>

Headers: Authorization Bearer <token>

 

HTTP Response

Edit section

Response Type: File

Response Data:

A successful API response will contain a 200 response code and the Upload file.

A failed API response will contain either a 400 or a 500 series response code based on the exception type, and a JSON formatted response body containing the exception message.  See the table below for the types of responses that may be encountered with this API web method.

 

Response Codes

Edit section
Response Code Reason
200 Successful request.
401 The auth. token is invalid and needs to be refreshed.
404 If the provided URL was not found on this server.
500 If there was an unexpected server error.
 

Fetching Uploaded Image's Thumbnail

Edit section

If an Upload is an image file, the server will create a thumbnail of the image that can be fetched instead of fetching the entire image file.

HTTP Request

Edit section
Edit section

Method: GET

URL: /api/v1/issues/<issue_guid>/uploads/<upload_guid>?style=thumb

Headers: Authorization Bearer <token>

 

HTTP Response

Edit section

Response Type: File

Response Data:

The thumbnails are stored in an Amazon S3 bucket and a successful call consists of the Kinetic Response server receiving the initial request from the client, then responding with a 301 "Moved Permanently" response. Following this redirect will lead to the thumbnail file being downloaded. A 200 response indicates a successful download.

A failed API response will contain either a 400 or a 500 series response code based on the exception type, and a JSON formatted response body containing the exception message.  See the table below for the types of responses that may be encountered with this API web method.

 

Response Codes

Edit section
Edit section
Response Code Reason
200 Successful request.
301 Redirect that must be followed to retrieve the thumbnail.
401 The auth. token is invalid and needs to be refreshed.
404 If the provided URL was not found on this server.
500 If there was an unexpected server error.