Addresses

Resource type: address

When editing an address, the same parameters are valid, which are valid when reading an address.

To change the contact data of an address record (telephone, fax, email) additional parameters are necessary (see examples below).

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”.

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).

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.

Parameters:

    • „field name“ (individually)

Name of the target field (key) and value to set (value).

  • 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.

Parameters (contact data):

    • „Type of contact data“

'phone' for normal telephone numbers,
'phone_business' for business phone numbers,
'phone_private' for private phone numbers,
'mobile' for mobile phone numbers,
'email', 'email_private', 'email_business ' for email addresses,
'fax', 'fax_private', 'fax_business' for fax numbers

  • action
    Type of change of contact data record. See examples of use below.

    • add
      Add a contact data record.
    • modify
      Modify a contact data record. Identification based on the old value. It must be ensured that the value is unique, otherwise the action is aborted with an error.
    • delete
      Delete a contact data record. Identification based on the old value. It must be ensured that the value is unique, otherwise the action will be aborted with an error.
  • oldvalue
    Old value of contact data record for identification.
  • newvalue
    New value of the contact record.
  • default
    Sets the entry as the default entry. Values true or false.
  • Land
    country as ISO 3166-1 alpha-3 value. The country abbreviations can also be queried via this call.

Example: Modify address data

	{
		"actionid":"urn:onoffice-de-ns:smart:2.5:smartml:action:modify",
		"resourceid":32,
		"resourcetype":"address",
		"identifier":"",
		"parameters":{
			"Vorname":"Peter",
			"Name":"Lustig",
			"Strasse":"Hauptstr. 2",
			"Land":"DEU",
			"Geburtsdatum":"2017-01-31 12:00:00",
			"newsletter_aktiv":"0",
			"HerkunftKontakt":["Suchmaschine","Newsletter"]
		}
	}

Example: Modify phone number

ResourceID is the ID of the address record, oldvalue is the number to change. Default sets the number as main number.

    {
        "actionid":"urn:onoffice-de-ns:smart:2.5:smartml:action:modify",
        "resourceid":32,
        "resourcetype":"address",
        "identifier":"",
        "parameters":{
			"phone":{"action":"modify", "oldvalue":"0049 641 43681-272", "newvalue":"0049 244 48453-311", "default":true}
        }
    }

Example: Add an email address

    {
        "actionid":"urn:onoffice-de-ns:smart:2.5:smartml:action:modify",
        "resourceid":6,
        "resourcetype":"address",
        "identifier":"",
        "parameters":{
			"email":{"action":"add", "newvalue":"max.mustermann982@beispiel.de"}
        }
    }

Example: Delete fax number

    {
        "actionid":"urn:onoffice-de-ns:smart:2.5:smartml:action:modify",
        "resourceid":6,
        "resourcetype":"address",
        "identifier":"",
        "parameters":{
			"fax":{"action":"delete", "oldvalue":"02419461785"}
        }
    }