File upload

Resource type: uploadfile

Use this API call to upload a file to onOffice. The module and the data record ID specify where the file should be stored. It is possible to upload estate, address and agentslog files as well as files linked to task. This has to be specified in the parameter module.

You also can set tmpUpload as module, then you receive the ID of a cached file with which you can continue to work. See second example for usage.

Uploading files happens in two steps. In the first step you enter the data and the file name, and receive as a response a temporary ID and the file size. In the second step you specify in which module the file is uploaded and with which record it should be linked.

A temporary id can only be used once.
Please note that for estate files a document attribute can only be assigned once for every estate. The list of possible document attributes can be edited in the administration.

Parameters first step:

  • file
    Filename
  • data
    File content as base64-encoded binary data

Parameters second step:

  • tmpUploadId
    Temporary upload ID
  • relatedRecordId
    Linked record number
  • Art
    Type of file.
    Possible picture types: Titelbild, Foto, Foto_gross, Grundriss, Lageplan,Stadtplan, Anzeigen, Epass_Skala, Finanzierungsbeispiel, QR-Code, Logo, Banner, Panorama
    Possible document types: Expose, Dokument, Aushang, Mietaufstellung, Energieausweis
    Possible link types: Link, Film-Link, Ogulo-Link, Objekt-Link
  • title
    File title
  • freetext
    Free text
  • documentAttribute
    Document attribute
  • module
    Possible values: estate, address, agentsLog, task or tmpUpload

Example first step: Specify file name and data

...
{
 	"actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:do",
 	"resourceid": null,
 	"resourcetype": "uploadfile",
 	"identifier": "",
 	"parameters": {
 	 	"data": "\/9j\/4AAQSkZJRgABAQEAS .....  FlkHx2crJPdFYS5EVuh9YT9Dwlirw3ZWFhOs\/\/9k=",
 	 	"file": "JPEG_example_JPG_RIP_025.jpg"
 	}
}
...

Response:

  • tmpUploadId
    Temporary upload id. It is needed for the second step
...
"records": [
 	{
 	 	"id": 0,
 	 	"type": "",
 	 	"elements": {
 	 	 	"filesize": 9407,
 	 	 	"tmpUploadId": "b09f36b0-7bf3-4691-e1c6-7a298f1fd1ed"
 	 	}
 	}
]
...

Example second step: module, data record to be linked and further information

...
{
 	"actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:do",
 	"resourceid": null,
 	"resourcetype": "uploadfile",
 	"identifier": "",
 	"parameters": {
 	 	"module": "estate",
 	 	"freetext": "Freitext",
 	 	"tmpUploadId": "375406cb-265a-48f2-959c-1eba3195709d",
 	 	"file": "JPEG_example_JPG_RIP_025.jpg",
 	 	"title": "Titel",
 	 	"Art": "Foto",
 	 	"documentAttribute": "document_reservation_list",
 	 	"relatedRecordId": 30
 	}
}
...

————

Example first step with module tmpUpload: Specify file name and data

Request:

...
{
    "actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:do",
    "resourceid": null,
    "identifier": "1",
    "resourcetype": "uploadfile",
    "parameters": {
        "data": "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAS10lEQVR42uWaCXhU5bnH\/zNn9pnMJBmSkEAAIwRZXOgFxYWiuNTdW7CWqnW5UBBBZXFHRQW9tlDB1q0KasWltloXKgheiygCWVgFyQYEs2eS2fflzH3fk8xkEibJhMRbn9vveb7nLHNm5vz+7\/K933eODP8P2\/7LLnvYWVe31FRQUCM3GLYGW1r++JPPP\/8u2bWyf\/XNDnQrmfGzG01q81seQZD5Gxuh12hgnDQp4v7uu5e9VVUPnF1a6klZgOHDh8upyfR6PTT0Qz\/GFo1GYFC5cUqmH5eMEC45x3HuR5GQqAkFg3CFQojs2oWQzQbjxInQnXbat46iomvOLSs73qsASqVSEwqFBtNudm9C\/RhaYT6Gfvi0Yl1WZKSpZdNpCLhDUHs8SHM4cJgEkFdXQyAjZlx44ffOQ4cu\/GlNzbEeBaBmon5eNBrd+K+G6635XPWo\/+ICmPVO6NMy4KqWofGtXGQ2eREgEVzkDU2jRiG8ZQsUdL1h7NjDnpqayRc7HM6eBEinPoUE+KSBYkkUo5DJZNTbdOt5C+nauMKyjr+RJe53+ay7c\/HzHT8S3w0H3Wj95mpkaasJPhORcBCNzQ789x8GYZ5VhzS3G34SwRMIoHHwYAiVlVDT9xRpaeumOZ2zUxKgvqGhW9g4aJdtqvtJRUoCmkwMUYygeeevYJbtQpoxk45F2O0uLHz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\/pSpSZfC+yoAw8fiP\/bCIwvBwyDDcwhxtl\/x1FNLS0tK144ZQ25fXHLS8P0SIBQK0rCl7hH4ZAXgzB8TgONfR6PF6NGF0ji\/9OGl95SXV\/ydEp5jz569\/YLvlwCpWPxkBZDe\/JIEsEv5YMTwYaiqqmhesnjJnY2NjV+cUlDgOPjtwX7D\/+gESBwC2QPsbH1TBg7vK62697775rucruL8YfmOivKKAYFPWQDO8IkAXdfgeoNMRYDEUYDrfQeFQVChwdaNH5csfeihxXTdQSpvHdXV1QMGn4oA59MffzqQf9i1SQJQD9OEh+v8INUC\/mAYbl9AXPfyC5+venr5MhpZyjPNZkdDff2AwvcoAFnHQDdXSLu54CdW\/\/eNXxSoo\/lBNU1pnZbm5gGH71EAUl2gykxLIgjo2VN+qBalewhotNoAzQl+EPgeBfh3af\/2AvwvbF+OQNe52mMAAAAASUVORK5CYII=",
        "file": "test.png"
    }
}
...

Response:

  • tmpUploadId
    Temporary upload id. It is needed for the second step
...
"records": [
 	{
 	 	"id": 0,
 	 	"type": "",
 	 	"elements": {
 	 	 	"filesize": 9407,
 	 	 	"tmpUploadId": "b09f36b0-7bf3-4691-e1c6-7a298f1fd1ed"
 	 	}
 	}
]
...

Example second step with module tmpUpload: Specify module and further information

Request:

...
{
	"actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:do",
	"resourceid": null,
	"identifier": "2",
	"resourcetype": "uploadfile",
	"parameters": {
		"file": "test.png",
		"title": "test.png",
		"tmpUploadId": "3e53c275-ea8b-4a32-0d04-6915acf945f6",
		"Art": null,
		"relatedRecordId": null,
		"module": "tmpUpload"
	}
}
...

Response:

  • tmpUploadId
    Temporary upload id.
  • cacheFileUuid
    Cache file uuid with which you can continue to work.
...
{
    "status": {
        "code": 200,
        "errorcode": 0,
        "message": "OK"
    },
    "response": {
        "results": [
            {
                "actionid": "urn:onoffice-de-ns:smart:2.5:smartml:action:do",
                "resourceid": "",
                "resourcetype": "uploadfile",
                "cacheable": false,
                "identifier": "2",
                "data": {
                    "meta": {
                        "cntabsolute": null
                    },
                    "records": [
                        {
                            "id": 0,
                            "type": "",
                            "elements": {
                                "filesize": 4880,
                                "tmpUploadId": "15fe4d69-241f-42c3-f5ac-6a8c39a3bb69",
                                "cacheFileUuid": "ec74c71e-fea4-47dd-8d84-dac7a83d69fd",
                                "success": "success"
                            }
                        }
                    ]
                },
                "status": {
                    "errorcode": 0,
                    "message": "OK"
                }
            }
        ]
    }
}
...