Logo
Submit a request

Attachments (API)

* All attachment endpoints for attachments require calls to be made to the api.bluefolder.com domain

Adding an Attachment

URL

https://api.bluefolder.com/api/2.0/attachments/add.aspx

* this endpoint requires calls to be made to the api.bluefolder.com domain

Request

<request>
  <attachmentAdd>
    <contractId></contractId>
    <customerId></customerId>
    <equipmentId></equipmentId>
    <serviceRequestId></serviceRequestId>
    <isPublic></isPublic>
    <attachmentContent></attachmentContent>
    <attachmentFileName></attachmentFileName>
    <attachmentDescription></attachmentDescription>
    <attachmentContentType></attachmentContentType>
    <linkUrl></linkUrl>
  </attachmentAdd>
</request>
            

One of contractId, customerId, equipmentId, or serviceRequestId are required as the element to which the attachment will be uploaded. You must then provide an attachmentContent or linkUrl depending on whether or not you are uploading a document or attaching a link.

  • contractId - GUID, which is the unique Id for the contract that the items are attached to
  • customerId - numeric indicating the customer that the items are attached to
  • equipmentId - GUID, which is the unique Id for the equipment item that the items are attached to
  • serviceRequestId - numeric, unique service request identifier that the items are attached to
  • attachmentDescription - string, the description of the attachment that will be displayed in the attachments list, defaults to an empty string
  • isPublic - boolean, (true/false), defaults to false
  • attachmentContent (required to upload an attachment) - base64 encoded document, the content of the attachment that you wish to upload base64 encoded
  • attachmentFileName - string, name of the file displayed in the attachment list, (defaults to ‘api-attachment-upload-random-string’)
  • attachmentContentType - string, the content type of the attachment you are uploading (defaults to application/octet-stream)
  • linkUrl (required to attach a link) - string, url to the link that you wish to attach to the element

Response

<response status="ok">
  <attachmentToken></attachmentToken>
</response>        
  

Retrieving a List of Attachments

URL

https://api.bluefolder.com/api/2.0/attachments/list.aspx

* this endpoint requires calls to be made to the api.bluefolder.com domain

Request

<request>
  <attachmentList>
    <type></type>
    <contractId></contractId>
    <customerId></customerId>
    <equipmentId></equipmentId>
    <serviceRequestId></serviceRequestId>
    <includeExternalLinks></includeExternalLinks>
    <page></page>
    <perPage></perPage>
    <postedOn></postedOn>
  </attachmentList>
</request>
  • type - (Contract, Customer, Equipment, ServiceRequest) the type of object that this document is attached to
  • contractId - GUID, which is the unique Id for the contract that the items are attached to
  • customerId - numeric indicating the customer that the items are attached to
  • equipmentId - GUID, which is the unique Id for the equipment item that the items are attached to
  • serviceRequestId - numeric, unique service request identifier that the items are attached to
  • includeExternalLinks - boolean, (true/false, defaults to false)
  • page - numeric, indicating the page of data to return (defaults to page 1)
  • perPage - numeric, indicating the number of items to return per page (defaults to 100)
  • postedOn - date, indicating the date after which the item was uploaded

Response

<response status="ok">
  <attachments page="1" perPage="10" totalCount="148">
    <attachment>
      <attachmentId></attachmentId>
      <isExternalLink></isExternalLink>
      <fileName></fileName>
      <linkUrl></linkUrl>
      <parentType></parentType>
      <parentId></parentId>
      <postedOn></postedOn>
      <postedBy></postedBy>
      <private></private>
      <token></token>
    </attachment>
    …
  </attachments>
</response>
            

Downloading an Attachment

URL

https://api.bluefolder.com/api/2.0/attachments/download.aspx

* this endpoint requires calls to be made to the api.bluefolder.com domain

Request

<request>
    <attachmentDownload>
        <attachmentToken>xxxxxx</attachmentToken>
    </attachmentDownload>
</request>
            
  • attachmentToken - (required) GUID, which is the unique token for the attachment

Response

The response for this endpoint is a redirect to a link to download the requested attachment securely.

*This link is a signed URL that is valid for only 10 seconds.

Deleting an Attachment

URL

https://api.bluefolder.com/api/2.0/attachments/delete.aspx

Request

<request>
    <attachmentDelete>
        <attachmentToken>xxxxxx</attachmentToken>
    </attachmentDelete>
</request>
  • attachmentToken - (required) GUID, which is the unique token for the attachment

Response

<?xml version="1.0" ?>
<response status='ok'>
    <attachmentToken></attachmentToken>
</response>
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request