API resource document upload

POST https://service.runmyaccounts.com/api/latest/clients/{clientname}/belege

Upload documents for processing. Accepted content types are PDF and images. Upload accepts mime multipart data (Content-Type: multipart/form-data). File content musst be in parameter Filedata. And optional additonal parameter comment can be used to add instructions for processing.

Response codes

Die Schnittstelle antwortet mit dem HTTP Status Code 200. Folgende Fehlerfälle können auftreten:

Http Status Description
200 OK
403 Unsuccessful authentification, no or wrong API key.
415 Content-type not supported. Allowed are application/pdf, image/png, image/jpg, image/jpeg, image/gif.
413 The maximum allowed file size of 25mb has exceeded.
409 The same document has been uploaded before.
Field Description
id A unique ID assigned by Run my Accounts
comment The comment transferred with the upload.
checksum A CRC32 checksum of the file contents.
date_received Receipt date and time.
file_name The recognized file name.

Example

POST /api/latest/clients/apitest/belege?api_key=GEHEIM HTTP/1.1
Host: service.runmyaccounts.com
Connection: keep-alive
Content-Length: 27974
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryyik8WY7O6UcFUs4z
Accept-Encoding: gzip,deflate,sdch
Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4,fr;q=0.2,sv;q=0.2

------WebKitFormBoundaryyik8WY7O6UcFUs4z
Content-Disposition: form-data; name="comment"

Kontierung 4200
------WebKitFormBoundaryyik8WY7O6UcFUs4z
Content-Disposition: form-data; name="Filedata"; filename="test_dokument.pdf"
Content-Type: application/pdf

%PDF-1.4
...
%%EOF
------WebKitFormBoundaryAR3J3St4XvA6RGZa--

Response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<beleg_upload>
<id>112305</id>
<comment></comment>
<checksum>4084618730</checksum>
<date_received>2014-06-18T08:06:52.810+02:00</date_received>
<file_name>1400851148_invoice_R100007.pdf</file_name>
</beleg_upload>

 

War dieser Artikel hilfreich?
Dislike 0
Ansichten: 327
Scroll to Top