Create Addresses

Resource type: address

Creates a new address record if the user has the necessary rights.

The parameters of this action include all fields active in enterprise for address records. You can look up the field names in the administration of onOffice enterprise (Extras->Settings->Administration->Tab Input fields->Column field).

Contact details (telephone, fax, email) are created via fixed parameters.

In addresses, estates and other modules you can set relations like e.g. tenant, buyer, owner, contact person, estate units etc. These relations are not queried and set via estate or address calls, but this information is queried or set via the API calls “Create, Modify, Delete and Get relations”.

Note: Record number (Datensatznummer) and customer number (Kundennummer) are 2 different fields in addresses. The record number is the ID to be specified for the API.
Note: Mobile numbers are automatically set to the type “mobile”, even if “phone” was specified.

Parameter:

  • (individually)
  • phone
    Normal phone entry
  • phone_private
    Telephone entry with type “private”
  • phone_business
    Telephone entry with type “business”
  • mobile
    Telephone entry with type “mobile”
  • default_phone
    Default phone number. Sets one phone number as the main number. It must be set to the value of one of the phone numbers.
  • fax
    Normal fax entry
  • fax_private
    Fax entry with type “private”
  • fax_business
    Fax entry with type “business”
  • default_fax
    Default fax number. Sets one fax number as the main number. It must be set to the value of one of the fax numbers.
  • email
    Normal email entry
  • email_business
    Email entry with type “business”
  • email_private
    Email entry with type “private”
  • default_email
    Default email address. Sets one email address as the main address. It must be set to the value of one of the email addresses.
  • Benutzer
    STRING. Field “Betreuer” (“Support”). You need to specify the user name to set “Betreuer”. The user names can be found by queriying “Name” in the “data” parameter with the Read user call. In enterprise the user names are found under Extras >> Settings >> User.
  • Status
    TINYINT(1). “Active / Aktiv” = 1, “Archive / Archiviert” = 0.
  • newsletter_aktiv
    TINYINT(1). “No” = 0, “Yes” = 1, “Cancellation” = 2, “Double Opt-In pending” = 3, “not specified” = 4.
  • Land
    STRING. The country can be specified by name, e.g. “Frankreich”. Or as ISO 3166-1 alpha-3 value . The country abbreviations can also be queried via this call.
  • checkDuplicate
    BOOLEAN. Default: false. If true, a duplicate check is performed for the field “email”. Without the parameter noOverrideByDuplicate, the data of the already existing address is updated or overwritten. If there are several duplicates, the duplicate with the lowest ID will be updated.A duplicate check of the entire address database with further criteria such as name, postal code etc. can be carried out in enterprise. For further information on resolving duplicates visit the online help.
  • noOverrideByDuplicate
    BOOLEAN. Default: false. If true, the duplicate check with parameter checkDuplicate does not update or overwrite the data of the already existing address.
  • outlookSync
    DEPRECATED. BOOLEAN. Sets outlookSyncfor the logged in user. In order to set outlookSyncfor other users, please use Create relations with the relation type urn:onoffice-de-ns:smart:2.5:relationTypes:address:user:sync. The field is set per user and states whether the address should be synced for the user. To unset use Delete Relations.

Example:

{
	"actionid":"urn:onoffice-de-ns:smart:2.5:smartml:action:create",
	"resourcetype":"address",
	"resourceid":"",
	"identifier":"",
	"parameters": {
		"Anrede":"Herr",
		"Vorname":"Max",
		"Name":"Mustermann",
		"email":"m.mustermann@onoffice.de",
		"phone":"0241 12345",
		"phone_business":"0241 56789",
		"default_phone":"0241 12345",
		"Plz":"52074",
		"Ort":"Aachen",
		"Benutzer":"theotest",
		"HerkunftKontakt":["Suchmaschine","Newsletter"]
	}
}

Response:

...
"response":{
    "results":[
        {
            "actionid":"urn:onoffice-de-ns:smart:2.5:smartml:action:create",
            "resourceid":"",
            "resourcetype":"address",
            "identifier":"",
            "data":{
                "meta":{
                    "cntabsolute":null
                },
                "records":[
                    {
                        "id":181,
                        "type":"address",
                        "elements":[
                        ]
                    }
                ]
            },
            "status":{
                "errorcode":0,
                "message":"OK"
            }
        }
    ]
 }
...