• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Edit
Show / Hide Table of Contents

getAttachment

Some tooltip text!
• 1 minute to read
 • 1 minute to read

Description

Retrieves an attachment either linked to a message or an FAQ entry. For attachment attached to public entries, you do not need a session key.

In parameters

Parameter Description
sessionKey A valid session key, or empty if the attachment Ds linked to a public FAQ entry.
attachmentId ID of the attachment to retrieve.

Out parameters

Parameter Description
errorCode See list of codes
attacmentName The file name of the attachment
contentType The mime-like content type of the file.

Popular content types:

  • "text/html" .md .md
  • "application/msword" .doc
  • "application/octet-stream" .bin .exe
  • "application/x-zip" .zip

Example

customer.customerService custService = new customer.customerService();
string sessionKey;

if(custService.login("test","test", out sessionKey) == "0")
{
  string attachmentId = "34";
  string attachmentName;
  string contentType;
  string data;
  string res = custService.getAttachment(sessionKey, attachmentId, out attachmentName, out contentType, out data);
  byte[] newData = System.Convert.FromBase64String(data);
}
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top