POST api/order/service/{OrderServiceID}/attachment
This API method sends a new attachment (including the file, uploaded as a byte array) in an order service. A path in PortalSettings must not be empty or null. If the PortalSettings does not exist then a path will be created.
When creating a new attachment, ensure that the Order Service supports the attachment.
When a file is attached to a service, the streamed attachment is converted to a file. When that file is requested, the file is opened and converted back into a stream.
Error Message
- 403/Forbidden - File contents must be populated
- 403/Forbidden - File Name must be populated
- 500/Internal - Server Error - Error retrieving order service record with id x
- 404/Not Found - No order service found with id x
- 403/Forbidden - OrderServiceID x does not support attachments
- 403/Forbidden - Attachment could not be saved at this time - invalid path
- 500/Internal Server Error - Error saving new attachment for order service record with id x
Request Information
URI Parameters
Name | Description | Type | Additional information |
---|---|---|---|
OrderServiceID | Order service ID | integer |
Required |
Body Parameters
CreateAttachmentName | Description | Type | Additional information |
---|---|---|---|
FileName | Referrence name of file to be attached | string |
Required String length: inclusive between 0 and 100 |
FileContents | Contents of the file to be attached as a Base64 encoded byte array | Collection of byte |
Required |
Request Formats
application/json, text/json
Sample:
{ "FileName": "sample string 1", "FileContents": "QEA=" }
application/xml, text/xml
Sample:
<CreateAttachment xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/aBILLity.API.Models"> <FileContents>QEA=</FileContents> <FileName>sample string 1</FileName> </CreateAttachment>
application/x-www-form-urlencoded
Sample:
Sample not available.
Response Information
Resource Description
CreateAttachmentResponse
CreateAttachmentResponseName | Description | Type | Additional information |
---|---|---|---|
AttachmentID | integer |
None. |
Response Formats
application/json, text/json
Sample:
{ "AttachmentID": 1 }
application/xml, text/xml
Sample:
<CreateAttachmentResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/aBILLity.API.Models"> <AttachmentID>1</AttachmentID> </CreateAttachmentResponse>