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.
- FileName As String – Name of the file (e.g. myfile.xls). 3 to 50 characters.
Optional Inputs
- CustomerID As Integer – a valid Rev.io Customer ID.
- CustomType As 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.
- Description As String – The description of the file.
Output
- ID As Integer
Attachments_Delete
Delete an attachment in Rev.io.
Required Input
- FileID As 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
- ID As Integer – the Rev.io File ID to be queried (often obtained from an Rev.io report / in Rev.io / etc).
Output
- Attachment
- ID As Integer – The Rev.io File ID associated with the attachment.
- Data As Base64String – The file data as a base64-encoded string.
- Name As String – The name of the file.
- Fields As CustomFieldItem – Custom fields related to the attachment.
- Description As String – The description of the file.
- FileSize As Long – The size of the attachment in bytes.
- CreatedDate As 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.
- ID As Integer – a Rev.io attachment type id.
- Description As String – a Rev.io attachment description.
Output
- Types - List of attachment types.
- Type - A single attachment type.
- ID As Integer – The attachment type id.
- Description As String – The attachment type description.
Updated over 6 years ago