Addresses

Resource type: address

Outputs information from address records.

Use the parameter recordids to specify the desired addresses. Without this parameter, all addresses are output.

The parameter filterid can also be used to restrict the selection of addresses. With self-created filters you could output the last changed addresses for example.

All fields specified in the enterprise administration are valid here and are passed as elements of an array in the parameter data. Each parameter is returned with the corresponding value of the record.

Contact details (telephone, fax, e-mail) are returned like this: „<identifier><typ>__<id>“.

The parameters are followed by several example calls for different applications: reading out address data, reading out the addresses changed in the last 30 days via a filter, and querying the URL for the passport photo.

Parameter:

  • data
    ARRAY

    • (individually)
    • phone
      all phonebook entries except with type “mobile”
    • mobile
      all phone book entries with type “mobile”
    • fax
      all phone book entries with type “fax”
    • email
      all phone book entries with type “email”
    • defaultphone
      like phone, but only returns the record marked as default
    • defaultfax
      like fax, but only returns the record marked as default
    • defaultemail
      like email, but only returns the record marked as default
  • recordids
    ARRAY. Address IDs. Can be used if one or more than one record should be read, but not all.
  • filterid
    INTEGER. Filter ID. This parameter can also be used to restrict the selection of address data records via address filters created in enterprise. The filter IDs of your created filters can be read out via the API call Filter. Further information on filters can be found in our online help.
  • listlimit
    INTEGER. Maximum number of addresses in the list. Default value: 20, Maximum: 500.
  • listoffset
    INTEGER. Offset of the list, that means from which data record onwards the list should be output.
  • formatoutput
    BOOLEAN. Default = false. Enable formatted output. If set to true, the contents of the single- and multi-select fields (column content in the enterprise administration on tabs singleselect und multiselect) instead of the field (column field in the administration on tabs singleselect und multiselect) are outputted. With formatoutput false, multiselect values are seperated with pipes.
  • outputlanguage
    STRING. Output language. E.g. the contents of the single- and multi-select fields are output in the specified language. Parameter formatoutput must be set to true.
  • Example: Read address data

    ...
    "actions":[
    	{
    		"actionid":"urn:onoffice-de-ns:smart:2.5:smartml:action:read",
    		"resourceid":"",
    		"identifier":"",
    		"resourcetype":"address",
    		"parameters":{
    			"recordids":[32],
    			"data":[
    				"Briefanrede",
    				"Email",
    				"Land",
    				"Name",
    				"Ort",
    				"Plz",
    				"Strasse",
    				"Vorname",
    				"AGB_akzeptiert",
    				"imageUrl"
    			]
    		}
    	}
    ]
    ...
    

    Response: Read address data

    • (individuell)

    If the fields defaultphone, defaultemail or defaultfax have been requested, they will also be output separately in the same notation.

    ...
    "records":[
    	{
    		"id":32,
    		"type":"address",
    		"elements":{
    			"id":32,
    			"Briefanrede":"Sehr geehrter Herr Lustig,\nSehr geehrte Damen und Herren,",
    			"Email":"peter.lustig@onoffice.de",
    			"Land":"Deutschland",
    			"Name":"Lustig",
    			"Ort":"Lustigenstadt",
    			"Plz":"01805",
    			"Strasse":"L\u00f6wenzahnstr. 2",
    			"Vorname":"Peter",
    			"AGB_akzeptiert":"0"
    		}
    	}
    ]
    ...
    

    Example: Read out the addresses changed in the last 30 days via the filter

    ...
    "actions":[
        {
            "actionid":"urn:onoffice-de-ns:smart:2.5:smartml:action:read",
            "resourceid":"",
            "identifier":"",
            "resourcetype":"address",
            "parameters":{
                "filterid":102,
                "data":[
                    "Briefanrede",
                    "Vorname",
                    "Name",
                    "Strasse",
                    "Plz",
                    "Ort",
                    "Land",
                    "Email"
                ]
            }
        }
    ]
    ...
    

    The expression used in the filter is: ((`adressen`.`Status` = '1' AND `adressen`.`Aenderung` >= DATE_SUB(NOW(), INTERVAL 30 DAY) AND `adressen`.`Aenderung` <= NOW()) AND `adressen`.`Aenderung` >= DATE_SUB(NOW(), INTERVAL 30 DAY) AND `adressen`.`Aenderung` <= NOW() )

    Example: Query the URL to the passport photo (top left in an address record)

    ...
    "actions":[
        {
            "actionid":"urn:onoffice-de-ns:smart:2.5:smartml:action:read",
            "resourceid":"",
            "identifier":"",
            "resourcetype":"address",
            "parameters":{
                "recordids":[32],
                "data":[
                    "Name",
                    "Vorname",
                    "imageUrl"
                ]
            }
        }
    ]
    ...