Attachments

Attachments_Create

Upload an attachment to a Customer account in Rev.io.

Required Inputs

  • FileData()As Byte – Byte Array of the file's content to be uploaded.
  • FileNameAs String – Name of the file (e.g. myfile.xls). 3 to 50 characters.\

Optional Inputs

  • CustomerIDAs Integer – a valid Rev.io Customer ID.
  • CustomTypeAs String – A custom attachment type. Must already exist in Rev.io as a valid attachment type.
  • Choice of one of the following:
  • AgentID As Integer – a valid Agent ID. When specifying the attachment is for an agent you cannot pass a CustomerID.
  • OrderID As Integer – a valid Order ID.
  • WorkOrderID As Integer – a valid Work Order ID.
  • TicketID As Integer – a valid Ticket ID.
  • TaskID As Integer – a valid Task ID.
  • DescriptionAs String – The description of the file.\

Output

  • IDAs Integer

Attachments_Delete

Delete an attachment in Rev.io.

Required Input

  • FileIDAs Integer – the valid unique attachment identifier in valid Rev.io.\

Output
None

Attachments_Query

📘

Note

Generally, this API function is used to download attachments / files from Rev.io.

Input

  • IDAs Integer – the Rev.io File ID to be queried (often obtained from an Rev.io report / in Rev.io / etc).\

Output

  • Attachment
  • IDAs Integer – The Rev.io File ID associated with the attachment.
  • DataAs Base64String – The file data as a base64-encoded string.
  • NameAs String – The name of the file.
  • FieldsAs CustomFieldItem – Custom fields related to the attachment.
  • DescriptionAs String – The description of the file.
  • FileSizeAs Long – The size of the attachment in bytes.
  • CreatedDateAs String – The date the attachment was added to Rev.io.

Attachments_Search

Use to retrieve attachments related to a Customer ID in Rev.io.

Input Fields

Field

Type

Notes

Required?

CustomerID

Integer

Customer ID in Rev.io

Required

Output Fields

Field

Type

Notes

Attachments

List

List of attachments related to Customer ID

Attachments > ID

Integer

ID identifier of the attachment

Attachments > Description

String

Description of the attachment

Attachments > Name

String

Name of the attachment

Attachments > FileSize

Long

The size of the attachment in bytes

Attachments > CreatedDate

Date

The date the attachment was added to Rev.io

Example Requests

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <Attachments_Search xmlns="http://api.myh2o.com/v20">
            <Request>
                <Credentials>
                    <Username>rev.io_username</Username>
                    <Password>rev.io_password</Password>
                    <Client>rev.io_client_code</Client>
                </Credentials>
                <CustomerID>1200</CustomerID>
            </Request>
        </Attachments_Search>
    </soap:Body>
</soap:Envelope>

Example Responses

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <Attachments_SearchResponse xmlns="http://api.myh2o.com/v20">
      <Attachments_SearchResult>
        <Header>
          <Success>true</Success>
          <SessionKey>ABC123939AkD9kD9303odfABC123939AkD9kD9303odf</SessionKey>
          <Impersonated>false</Impersonated>
        </Header>
        <Attachments>
          <Attachment>
            <ID>1200</ID>
            <Description>Description 1</Description>
            <Name>File_Name1.pdf</Name>
          </Attachment>
          <Attachment>
            <ID>1201</ID>
            <Description>Description 2</Description>
            <Name>File_Name2.pdf</Name>
            <FileSize>1.2</FileSize>
            <CreatedDate>2016-11-11</CreatedDate>
          </Attachment>
        </Attachments>
      </Attachments_SearchResult>
    </Attachments_SearchResponse>
  </soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <Attachments_SearchResponse xmlns="http://api.myh2o.com/v20">
      <Attachments_SearchResult>
        <Header>
          <Success>true</Success>
          <SessionKey>ABC123939AkD9kD9303odfABC123939AkD9kD9303odf</SessionKey>
          <Impersonated>false</Impersonated>
        </Header>
        <Attachments />
      </Attachments_SearchResult>
    </Attachments_SearchResponse>
  </soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <Attachments_SearchResponse xmlns="http://api.myh2o.com/v20">           
        <Attachments_SearchResult>
            <Header>
                <Success>false</Success>
                <Message>Invalid CustomerID: -1</Message>
                <Impersonated xsi:nil="true" />
                <Error_Code>S2010</Error_Code>
                <Error_Description>Invalid input received.</Error_Description>
            </Header>
        </Attachments_SearchResult>
    </Attachments_SearchResponse>
  </soap:Body>
</soap:Envelope>

AttachmentTypes_Query

Looks up attachment types.

Input
One of the following may be specified, or none specified to list all attachment types.

  • IDAs Integer – a Rev.io attachment type id.
  • DescriptionAs String – a Rev.io attachment description.\

Output

  • Types - List of attachment types.
  • Type - A single attachment type.
    • IDAs Integer – The attachment type id.
    • DescriptionAs String – The attachment type description.