Modify 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.
  • Land
    STRING. Country. The country must be specified by name, e.g. “Frankreich”, “Deutschland” etc. The country names can be queried via this call. Country names depend on the API user’s language.

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. A parameters object may carry one action object per contact-data type, and several types may be combined in one request. 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.
  • recordid
    Internal ID of a single contact-data entry, used to identify the entry to be modified or deleted. Alternative to oldvalue, and the only reliable identifier if a record holds several entries with the same value. Accepted as an integer or as a string. Evaluated for action: modify and action: delete; silently ignored for action: add. See example “Modify phone number by recordid”.

    Caution: with action: delete, the entry is deleted regardless of its actual type, and no error is returned. With action: modify, the entry is updated and re-typed to the type given in the parameter name.

    The recordid of a contact-data entry is returned by Read addresses, where contact data appears under keys of the form <identifier><type>__<id> — the <id> segment is the value to pass as recordid.

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":"Deutschland",
			"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: Modify phone number by recordid

 {
     "actionid":"urn:onoffice-de-ns:smart:2.5:smartml:action:modify",
     "resourceid":32,
     "resourcetype":"address",
     "identifier":"",
     "parameters":{
         "phone":{"action":"modify", "recordid":13024, "newvalue":"0241 12345-99"}
     }
 }

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"}
        }
    }