Help Page Home - Attachments
GET InvoiceAttachment/id
Returns the attachment with the given attachment Id.
Request Information
URI Parameters
| Name | Description | Type | Additional information |
|---|---|---|---|
| WsAccessKey | The Web Service access key for this user and file which allows access to the API for the associated file (found in File - Settings). Using OAuth authentication mechanism is the preferred method to allow API access. | string |
Optional. Legacy authentication method and only required if not using OAuth. OAuth is preferred. |
| FileId | Specifies the file id of the file to perform the operation upon. | integer |
Required |
| id | Attachment Id | integer |
Required |
Body Parameters
None.
Response Information
Resource Description
FileAttachment| Name | Description | Type | Additional information |
|---|---|---|---|
| AttachmentData | This is an array of bytes and represents the data of the attachment (ie. the attachment itself). You must convert the file you want to attach into a byte array. This is usually done programmatically which our client code does for you. This process is called serialisation and more information on this can be found here - http://en.wikipedia.org/wiki/Serialization | Collection of byte |
None. |
| AllowExistingAttachmentToBeOverwritten | A flag that indicates if an attachment of the same name already exists, whether it can be overwritten or not when storing. | boolean |
None. |
| Name | Name of the attachment. | string |
None. |
| Description | Description of the attachment. | string |
None. |
| ItemIdAttachedTo | The Id of the item/entity that this attachment is associated with or attached to. | integer |
None. |
| _links | Hypermedia links. Contains contextual links to possible next actions related to this resource. Only present in responses. This data is not to be sent to the server. | Collection of Link |
None. |
Response Formats
application/json, text/json
Sample:
{
"AttachmentData": null,
"AllowExistingAttachmentToBeOverwritten": false,
"Name": "Toy sale.doc",
"Description": "Toy sale invoice",
"ItemIdAttachedTo": 18616,
"_links": [
{
"rel": "self",
"href": "https://api.saasu.com/InvoiceAttachment/1?FileId=123",
"method": "GET",
"title": null
},
{
"rel": "list",
"href": "https://api.saasu.com/InvoiceAttachments?FileId=123",
"method": "GET",
"title": null
},
{
"rel": "update",
"href": "https://api.saasu.com/InvoiceAttachment/1?FileId=123",
"method": "PUT",
"title": null
},
{
"rel": "delete",
"href": "https://api.saasu.com/InvoiceAttachment/1?FileId=123",
"method": "DELETE",
"title": null
}
]
}
application/xml, text/xml
Sample:
<FileAttachment xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<_links>
<Link>
<rel>self</rel>
<href>https://api.saasu.com/InvoiceAttachment/1?FileId=123</href>
<method>GET</method>
</Link>
<Link>
<rel>list</rel>
<href>https://api.saasu.com/InvoiceAttachments?FileId=123</href>
<method>GET</method>
</Link>
<Link>
<rel>update</rel>
<href>https://api.saasu.com/InvoiceAttachment/1?FileId=123</href>
<method>PUT</method>
</Link>
<Link>
<rel>delete</rel>
<href>https://api.saasu.com/InvoiceAttachment/1?FileId=123</href>
<method>DELETE</method>
</Link>
</_links>
<Name>Toy sale.doc</Name>
<Description>Toy sale invoice</Description>
<ItemIdAttachedTo>18616</ItemIdAttachedTo>
<AllowExistingAttachmentToBeOverwritten>false</AllowExistingAttachmentToBeOverwritten>
</FileAttachment>