This API is used for uploading incoming invoices and receipts. It is not associated to outgoing invoices (i.e. Invoices created through the InvoiceService).
To upload a new attachment, first send a request to Create, this creates a new ghost file that may be uploaded with AppendChunk. Then use AppendChunk or AppendChunkByLength to upload the remaining file chunks. Finally send a request to Save to make it a valid image file.
The AttachmentService has some references to older properties that are no longer in use, these are still referenced for backwards compatibility reasons, but can safely be ignored in your integration. You will find details and examples in the documentation below on how to submit images and image data.
Using the Save method
Once you have uploaded your image with AppendChunk you need to send a request to Save.
Save takes file and location as its arguments.
Can be set to either Retrieval or Journal. The option Scanning is not implemented and may not be used. If location is set to Retrieval the image will show up in the inbox in the Retrieval Module in 24SevenOffice and if it is set to Journal the image is posted directly as journal data and will skip the inbox.
Id – this is set to the Id you get in response from your request to Create Type – Set this to your image file type, e.g. Png StampNo – Not in use when saving data. StampNo is set in ImageFrameInfo (see below) StampMeta – Not in use when saving data. FrameInfo – Array of ImageFrameInfo
Id – Should be set to 1.
Uri – Is not in use. Leave it unset.
StampNo – Should be set to the current Stamp Number you wish to use. If you’re adding images to an existing StampNo simply set the value. If you wish to store an image with a new Stamp Number you can get the next available StampNo with the GetStampNo method.
MetaData – An array of key value pairs with meta data about the image. Below is a list of useful metadata that can be added.
Please contact our support if you have any specific questions about meta data: firstname.lastname@example.org
metaData is useful when location is set to Retrieval. The meta data can then be used to populate the corresponding fields in the Retrieval Module. Please note that meta data is not automatically populated if you also specify a Stamp Number (StampNo), the image has to be moved from the inbox in the retrieval to the list of images that you are currently working on.
Status – Is not in use and does not need to be set. If your framework forces you to set a value here, simply set it to 0.
Below is a sample XML request to Save. The Id is set to the value returned from your previous request to Create, StampNo in ImageFrameInfo is set to 456 and the InvoiceOCR value is set to 12345678. Location is set to Retrieval, so the image will show up in the inbox in the Retrieval Module.
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap:Body> <Save xmlns="http://24sevenoffice.com/webservices/economy/accounting/"> <file> <Id>123</Id> <Type>Png</Type> <FrameInfo> <ImageFrameInfo> <Id>1</Id> <StampNo>456</StampNo> <MetaData> <KeyValuePair> <Key>InvoiceOCR</Key> <Value>12345678</Value> </KeyValuePair> </MetaData> </ImageFrameInfo> </FrameInfo> </file> <location>Retrieval</location> </Save> </soap:Body> </soap:Envelope>
|Method||Input type||Input Name||Return Type|