# Callback (ruian_fetch_address)

Load address details by RUIAN code from RUIAN

# Description

Tries to fetch address details by RUIAN code from API and adds those address fields to defined variable.

  • If config.code variable is of type JSON AND config.output is not specified, address field will be written to this config.code variable.
  • If config.output is specified, address field will be written to this variable.
  • If config.code variable is scalar, config.output must be set.

When RUIAN code is not found neither in scalar or json variable callback will not be executed.

# Config

ruian_fetch_address:

	config:

		# Required | Type: string | Default: null
		# DSN string with API URL and credentials
		#
		### Examples
		### - https://user:pass@ruian.ispalliance.cz/api/
		connection: "https://username:password@host"

		# Required | Type: string | Default: null
		# RUIAN address code
		#
		### Note
		### May be scalar or JSON variable, but must be JSON if config.variable is not set
		### If scalar variable, it should contain directly the RUIAN code
		### If JSON variable, it should contain the RUIAN code in "code" field (as used in Address panel)
		code: "ruian"

		# Required | Type: string | Default: null
		# Name of variable in which address fields should be stored
		#
		### Note
		### Must be JSON variable
		### If specified, address fields including the RUIAN code will be written to this variable
		output: "myvar"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27