Get Attachment List

Method: GET

Url: /Attachments
Header: DPApiAuthenticationToken={YOUR_API_TOKEN}

Query String:

Parameter Name Data Type Description
Parameter Name:

IncidentID (required)

Data Type:

Integer

Description:

The ID of the Incident to get attachments for

Parameter Name:

AttachmentID (optional)

Data Type:

Integer

Description:

To filter attachments by specific AttachmentID
Default: -1

Parameter Name:

FileName (optional)

Data Type:

String

Description:

To filter attachments by File Name
Default: Empty String

Parameter Name:

ShortDescription (optional)

Data Type:

String

Description:

To filter attachments by Short Description
Default: Empty String

Parameter Name:

DateCreatedFrom (optional)

Data Type:

DateTime

Description:

To filter attachments by DateCreated starting from
Default: Null

Parameter Name:

DateCreatedTo (optional)

Data Type:

DateTime

Description:

To filter attachments by DateCreated ending with
Default: Null

Parameter Name:

JMS_Query (optional)

Data Type:

String

Description:

Any SQL-compliant string to filter the records as explained here.

If the query contains any special or reserved characters, it must be properly escaped

Default: Empty string
Example: FileName^=^''Test.jpg''

Parameter Name:

PageNumber (optional)

Data Type:

Integer

Description:

The number of page to retrieve considering the PageSize parameter.

Default: 1
Example: 4

Parameter Name:

PageSize (optional)

Data Type:

Integer

Description:

The number of records to retrieve per request.

The page size cannot exceed the limit set for your account by Dataprise, which is usually around 100 records per request.

Default: 20
Example: 25

Parameter Name:

SortBy (optional)

Data Type:

String

Description:

The field name to sort the response by.

Default: Empty string
Example: FirstName

Parameter Name:

SortOrder (optional)

Data Type:

String

Description:

Sort order. Can be either “ASC” or “DESC” or empty string denoting “ASC”.

Default: Empty string
Example: DESC

Parameter Name:

tbl_columns (optional)

Data Type:

String

Description:

A comma separated string containing the names of the columns to retrieve, instead of all columns.

Default: Empty string
Example: FirstName, LastName, EmailAddress

Request Examples:
Using Filter Parameters:
GET "https://api.dataprise.com/api/v1/Attachments/?IncidentID=1234

Header: "DPApiAuthenticationToken=abcxyz0123456789"
Using JMS_Query:
GET "https://api.dataprise.com/api/v1/Attachments/?IncidentID=1234&JMS_Query=FileName^=^''Test.jpg''"

Header: "DPApiAuthenticationToken=abcxyz0123456789"
Paging & Sorting:
GET "https://api.dataprise.com/api/v1/Attachments/?IncidentID=1234&PageNumber=2&PageSize=50&SortBy=FileName&SortOrder=ASC"

Header: "DPApiAuthenticationToken=abcxyz0123456789"

Response:

The API will return the list of matching attachments for the incidents for your organization in JSON format. The response will by default contain the following fields for each record, however you can change that using the “tbl_columns” request parameter as mentioned above.

Column Name Data Type Remarks
Column Name:

AttachmentID

Data Type:

Integer

Remarks:

The unique ID of the record.

Column Name:

IncidentID

Data Type:

Integer

Remarks:

The ID of the incident

Column Name:

FileName

Data Type:

String

Remarks:

The file name

Column Name:

FileType

Data Type:

String

Remarks:

The file type

Column Name:

FileUrl

Data Type:

String

Remarks:

The URL of the file

Column Name:

ShortDescription

Data Type:

String

Remarks:

Short description of the attachment

Column Name:

ImageThumbnail

Data Type:

String

Remarks:

A base64 string containing the image thumbnail if the file type is an image

Column Name:

TotalCount

Data Type:

Integer

Remarks:

Total number of records available for the specified query

Column Name:

CustomFields

Data Type:

List<CustomField>

Remarks:

List of custom fields (key-value pair) for this record

Sample Response:
{
    "TotalCount": 14,
    "Rows": [
    {
        "AttachmentID": 710,
        "FileName": "Test Orange.jpg",
        "DateCreated": "2020-01-02T16:19:41.447",
        "CreatedBy": "Eisner, D.",
        "File": "",
        "IncidentID": 342510,
        "ImageThumbnail": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYAooooA/9k=",
        "FileType": "image/jpeg",
        "FileURL": "https://jmsweb.dataprise.com/cc/filelibget.aspx?source=hd&FileLibID=710&",
        "ShortDescription": "Test orange by object from API",
        "TotalCount": 5,
        "CustomFields": null
    },
    {
        "AttachmentID": 709,
        "FileName": "Test Orange.jpg",
        "DateCreated": "2020-01-02T16:15:58.917",
        "CreatedBy": "Eisner, D.",
        "File": "",
        "IncidentID": 342510,
        "ImageThumbnail": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAooooA/9k=",
        "FileType": "image/jpeg",
        "FileURL": "https://jmsweb.dataprise.com/cc/filelibget.aspx?source=hd&FileLibID=709",
        "ShortDescription": "Test orange by object from API",
        "TotalCount": 5,
        "CustomFields": null
    },
    {
        "AttachmentID": 708,
        "FileName": "Test Blue.jpg",
        "DateCreated": "2020-01-02T16:14:36.79",
        "CreatedBy": "Bhatt, S.",
        "File": "",
        "IncidentID": 342510,
        "ImageThumbnail": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBAooooA/9k=",
        "FileType": "image/jpeg",
        "FileURL": "https://jmsweb.dataprise.com/cc/filelibget.aspx?FileLibID=708",
        "ShortDescription": "Test Blue.jpg",
        "TotalCount": 5,
        "CustomFields": null
    }
]
}