# AttachmentService

This API is used for uploading incoming invoices and receipts. It is not associated to attachments for invoices created through the InvoiceService.

WARNING

Please note: 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.

PDF files are not supported.

Attachment Service (opens new window)
Attachment Service WSDL (opens new window)

Data types

# Guides

# Uploading attachments

  1. To upload a new attachment, first send a request to Create (opens new window), this creates a new ghost file that may be uploaded with AppendChunk (opens new window).
  2. Use AppendChunk (opens new window) or AppendChunkByLength (opens new window) to upload the remaining file chunks.
  3. Optionally send a request to GetStampNo (opens new window) to get the next available StampNo to be used with the file. GetStampNo (opens new window) does not reserve the StampNo returned, you have to complete the upload with a request to Save (opens new window). Otherwise the method will return the same StampNo.
  4. Once the file is uploaded send a request to Save (opens new window).
    Save (opens new window) takes File and Location as its arguments.

Below is a sample XML request to Save (opens new window). The Id is set to the value returned from the previous request to Create (opens new window), 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.

TIP

Please note: If you wish to upload several pages for the same StampNo, set the PageNo key under MetaData to the appropriate page number you want to add.

    <?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>PageNo</Key>
                <Value>1</Value>
              </KeyValuePair>
              <KeyValuePair>
                <Key>InvoiceOCR</Key>
                <Value>12345678</Value>
              </KeyValuePair>
            </MetaData>
          </ImageFrameInfo>
        </FrameInfo>
      </file>
      <location>Retrieval</location>
    </Save>
  </soap:Body>
</soap:Envelope>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

# Adding Pages

In order to add more files to a stamp number, you have to set the PageNo property. If you want add three files to a stamp number, you would add the following in each file upload:

	...

	<StampNo>123</StampNo>
	<MetaData>
		<KeyValuePair>
			<Key>PageNo</Key>
			<Value>1</Value>
		</KeyValuePair>
	</MetaData>

	...
	
	<StampNo>123</StampNo>
	<MetaData>
		<KeyValuePair>
			<Key>PageNo</Key>
			<Value>2</Value>
		</KeyValuePair>
	</MetaData>

	etc...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

# Methods

Method Input type Return Type Description
AppendChunk (opens new window) File AppendChunkResponse
AppendChunkByLength (opens new window) File AppendChunkByLengthResponse
Create (opens new window) Type CreateResult
DownloadChunk (opens new window) File DownloadChunkResult
GetCheckSum (opens new window) File GetCheckSumResult
GetFileInfo (opens new window) parameters GetFileInfoResult
GetMaxRequestLength (opens new window) GetMaxRequestLength
GetSize (opens new window) File GetSizeResult
Save (opens new window) File SaveResponse
GetStampNo (opens new window) -
GetApproverList (opens new window) - Get a list of approvers
GetSeries (opens new window) - Get stamp number series
GetSeriesStampNo (opens new window) - Get stamp number based on series ID