I cannot figure out how I can update the address field of an organization using API v2. (It works with API v1.)
I’ve tried these formats, but none of them works. They either give a validation error, or removes the existing address value:
‘address’ => [[‘value’ => $address]]
‘address’ => [$address]
‘address’ => $address
In V2 address is now an object with sub parameters so you need to pass the address to address.value (or the other fields available)
See my example below.
const body = {
"address": {
"value": "123 Example street, birmingham, B12 3AB",
"country": "UK",
"postal_code": "B12 3AB"
}
}
If you view the response schema from the get organisation request this is the same format required for create/update.
with value being required and everything else being optional (street_number, route, sublocality, locality, admin_area_level_1, admin_area_level_2, country, postal_code, formatted_address).