GET attachments/list

Available from CRM.COM R11.0.0

This method returns the attachments related with a specific entity. Multiple attachments are returned by each call.

Resource URL

Parameters

Name

Type

Description

token

String

The token retrieved from the login method

entity

(mandatory)

String

The name of the entity related with the attachment. The supported entities are the following:

  • ACCOUNTSRECEIVABLE
  • ACTIVITIES
  • COMMUNICATIONS
  • COMMUNICATIONTEMPLATES
  • CONTACTINFORMATION
  • INSTALLEDITEMS
  • JOBS
  • LEADS
  • PRODUCTS
  • SERVICEREQUESTS
  • ATTACHMENTSLIBRARY

From CRM.COM R12.2.0, ATTACHMENTSLIBRARY is available

From CRM.COM R14.0.0, COMMUNICATIONTEMPLATES is available

entity_id

(mandatory on conditions)

String

The ID of the entity related with the attachment, which is mandatory only if the entity is not set to ATTACHMENTSLIBRARY

For releases prior CRM.COM R12.2.0, the entity ID is mandatory

From CRM.COM R12.2.0, the entity ID is mandatory on conditions

classification_identifier

(mandatory on conditions)

Attachments Classification Identifier

The classification identifier of the attachment, which is mandatory only if the entity is set to ATTACHMENTSLIBRARY. The allowed classification identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the attachment classification

name

(semi-optional)

String

The name of the attachment classification

alternative_code

(semi-optional)

String

The alternative code of the attachment classification

Available from CRM.COM R12.2.0

fields_set
(optional)

List of Strings, comma separated 

A list of fields that should be included in the results. If not specified then all the available fields will be returned

Restrictions

  • It is mandatory to specify at least one of the semi-optional parameters. Only one of those parameters is allowed to be specified.

Response Data

Name

Type

Description

id

String

The ID of the retrieved attachment

entityString

The name of the entity related with the attachment. The supported entities are the following:

  • ACCOUNTSRECEIVABLE
  • ACTIVITIES
  • COMMUNICATIONS
  • COMMUNICATIONTEMPLATES
  • CONTACTINFORMATION
  • INSTALLEDITEMS
  • JOBS
  • LEADS
  • PRODUCTS
  • SERVICEREQUESTS
  • ATTACHMENTSLIBRARY

From CRM.COM R12.2.0, ATTACHMENTSLIBRARY is available

From CRM.COM R14.0.0, COMMUNICATIONTEMPLATES is available

entity_idStringThe ID of the entity related with the attachment.
urlStringThe attached URL. This information is empty if the attachment is a file.
notesStringThe comments related with the retrieved attachment
classificationAttachments Classification Object

The classification of the attachment

Available from CRM.COM R12.2.0

fileFile ObjectThe information of the attached file. This information is empty if the attachment is a URL.
log_informationLog Information ObjectThe log information of the retrieved attachment

Referred Objects Response Data

 classification object response data

 

NameTypeDescription

id

String

The id of the retrieved attachment classification

name

String

The name of the retrieved attachment classification

alternative_code

String

The alternative code of the retrieved attachment classification

 file object response data

 

Name

Type

Description

file_nameStringThe name of the file
file_content_urlStringThe url that can be used to access the actual content of the file
file_mime_typeStringThe mime type of the attached file

 log_information object response data

Name

Type

Description

created_date

Date

The date that the retrieved record was created

updated_date

Date

The last date that the retrieved record was updated

created_by_unit

Unit Object

The unit that created the retrieved record

From CRM.COM R14.1.0 and onward, group_name and community_name attributes will be returned as empty, if the related legacy compatibility setting is disabled

Deprecated from CRM.COM R18.0.0

created_by_business_unit

Unit Object

The unit that created the retrieved record

From CRM.COM R14.1.0 and onward, group_name and community_name attributes will be returned as empty, if the related legacy compatibility setting is disabled

Available from CRM.COM R18.0.0

created_by_user

User Object

The user that created the retrieved record

From CRM.COM R14.1.0 and onward, person_name and email attributes will be returned as empty, if the related legacy compatibility setting is disabled

updated_by_unit

Unit Object

The last unit that updated the retrieved record

From CRM.COM R14.1.0 and onward, group_name and community_name attributes will be returned as empty, if the related legacy compatibility setting is disabled

Deprecated from CRM.COM R18.0.0

updated_by_business_unit

Unit Object

The last unit that updated the retrieved record

Available from CRM.COM R18.0.0

updated_by_user

User Object

The last user that updated the retrieved record

From CRM.COM R14.1.0 and onward, person_name and email attributes will be returned as empty, if the related legacy compatibility setting is disabled

Referred Objects Response Data

 unit object response data

Name

Type

Description

id

String

The ID of the retrieved unit

name

String

The name of the retrieved unit

group_name

String

The name of the group that the retrieved unit belongs to

community_name

String

The name of the community that the retrieved unit belongs to

alternative_code

String

The alternative code of the retrieved unit

description

String

The description of the retrieved unit

 business unit object response data

Name

Type

Description

id

String

The ID of the retrieved business unit

name

String

The name of the retrieved business unit

codeStringThe code of the retrieved business unit
unified_codeString

The unified code of the retrieved business unit

description

String

The description of the retrieved business unit

parent_business_unit_nameStringThe name of the parent business unit that the retrieved business unit belongs to

 user object response data

Name

Type

Description

id

String

The ID of the retrieved user

username

String

The user name of the retrieved user

person_name

String

The full name of the retrieved user

email

String

The email of the retrieved user

Examples

 Example 1

HTTP Method: GET

 

Request:

Response:

 {
  "data": [
    {
      "comments": "polina",
      "file": {
        "file_name": "bill subscriber error.txt",
        "file_content_url": "/crm/FileDownloadServlet?id=01239852D674447D88374321FD922E7A",
        "file_mime_type": "text/plain"
      },
      "log_information": {
        "created_by_unit": {
          "alternative_code": "adminunit",
          "name": "Admin Unit",
          "description": "admin unit",
          "id": "1"
        },
        "updated_by_unit": {
          "alternative_code": "adminunit",
          "name": "Admin Unit",
          "description": "admin unit",
          "id": "1"
        },
        "created_date": "2016-11-03T13:42:06",
        "updated_date": "2016-11-03T13:42:06",
        "updated_by_user": {
          "person_name": "MPAdministrator",
          "id": "1",
          "username": "MPAdministrator"
        },
        "created_by_user": {
          "person_name": "MPAdministrator",
          "id": "1",
          "username": "MPAdministrator"
        }
      },
      "id": "01239852D674447D88374321FD922E7A",
      "entity_id": "10A149D60365488AB53DCB889CFD98F8",
      "entity": "ACCOUNTSRECEIVABLE",
      "url": null
    },
    {
      "notes": "polina",
      "file": {
        "file_name": "bill subscriber error.txt",
        "file_content_url": "/crm/FileDownloadServlet?id=479FAB4E732B44EAA66B41522A5AE126",
        "file_mime_type": "text/plain"
      },
      "log_information": {
        "created_by_unit": {
          "alternative_code": "adminunit",
          "name": "Admin Unit",
          "description": "admin unit",
          "id": "1"
        },
        "updated_by_unit": {
          "alternative_code": "adminunit",
          "name": "Admin Unit",
          "description": "admin unit",
          "id": "1"
        },
        "created_date": "2016-11-03T13:34:29",
        "updated_date": "2016-11-03T13:34:32",
        "updated_by_user": {
          "person_name": "MPAdministrator",
          "id": "1",
          "username": "MPAdministrator"
        },
        "created_by_user": {
          "person_name": "MPAdministrator",
          "id": "1",
          "username": "MPAdministrator"
        }
      },
      "id": "479FAB4E732B44EAA66B41522A5AE126",
      "entity_id": "10A149D60365488AB53DCB889CFD98F8",
      "entity": "ACCOUNTSRECEIVABLE",
      "url": null
    },
    {
      "notes": "test",
      "file": {
        "file_name": "bill subscriber error.txt",
        "file_content_url": "/crm/FileDownloadServlet?id=0B8B13EFADF34D9899F633639F6D460E",
        "file_mime_type": "text/plain"
      },
      "log_information": {
        "created_by_unit": {
          "alternative_code": "adminunit",
          "name": "Admin Unit",
          "description": "admin unit",
          "id": "1"
        },
        "updated_by_unit": {
          "alternative_code": "adminunit",
          "name": "Admin Unit",
          "description": "admin unit",
          "id": "1"
        },
        "created_date": "2016-11-03T13:26:08",
        "updated_date": "2016-11-03T13:28:06",
        "updated_by_user": {
          "person_name": "MPAdministrator",
          "id": "1",
          "username": "MPAdministrator"
        },
        "created_by_user": {
          "person_name": "MPAdministrator",
          "id": "1",
          "username": "MPAdministrator"
        }
      },
      "id": "0B8B13EFADF34D9899F633639F6D460E",
      "entity_id": "10A149D60365488AB53DCB889CFD98F8",
      "entity": "ACCOUNTSRECEIVABLE",
      "url": null
    },
    {
      "notes": null,
      "file": {
        "file_name": "bill subscriber error.txt",
        "file_content_url": "/crm/FileDownloadServlet?id=927EEC9B3C16495B9A76B0D4219687C2",
        "file_mime_type": "text/plain"
      },
      "log_information": {
        "created_by_unit": {
          "alternative_code": "adminunit",
          "name": "Admin Unit",
          "description": "admin unit",
          "id": "1"
        },
        "updated_by_unit": {
          "alternative_code": "adminunit",
          "name": "Admin Unit",
          "description": "admin unit",
          "id": "1"
        },
        "created_date": "2016-11-02T13:21:04",
        "updated_date": "2016-11-02T13:21:06",
        "updated_by_user": {
          "person_name": "MPAdministrator",
          "id": "1",
          "username": "MPAdministrator"
        },
        "created_by_user": {
          "person_name": "MPAdministrator",
          "id": "1",
          "username": "MPAdministrator"
        }
      },
      "id": "927EEC9B3C16495B9A76B0D4219687C2",
      "entity_id": "10A149D60365488AB53DCB889CFD98F8",
      "entity": "ACCOUNTSRECEIVABLE",
      "url": null
    }
  ],
  "status": {
    "code": "OK",
    "description": "",
    "message": ""
  }
}

Note:

To retrieve or display the actual image you need to construct the following URL

{{server}}{{file_content_url}}&token={{token}}  

for example

https://r11qa.crm.com/crm/FileDownloadServlet?id=927EEC9B3C16495B9A76B0D4219687C2&token=B18ECEE5918442A0A29B7C1B2D0A4260