Address in Organization API

Hi,

I am working on API integration to export Organization and Person data from my product. I have been referencing the link https://developers.pipedrive.com/docs/api/v1/#!/Organizations/post_organizations for information. I want the JSON script for exporting the Address in the default ‘address’ field.

Thanks for your help.
Priya

Hi Priya,
What do you mean by “JSON script for exporting the Address in the default ‘address’ field”?

Hi Dani,

Yes, I filled my address details in address_route, address_sublocality, address_locality, address_admin_area_level_1, address_postal_code. I didn’t see it in the main address field for the organization. Now after some more testing I am planning to fill all the above fields, address_formatted_address and address field. Will that work ?

Thank you,
Priya

hi Priya.
You should just update the address field.
All the other subfields that you mentioned, will be filled in automatically :slight_smile:

Hello dani,

I have the similar problem updating the subaddress(e.g. address_route) fields of an organization, how can I guarantee, that this subfield ist updated right, using only the address field?

:wave: @DanielCandC
Have you had instances in which it was not updated correctly?

Hello dani,

thank you for your fast answer.
Well I try to put e.g.
https://api.pipedrive.com/v1/organizations/751?api_token=xx
and JSon Body
{
“name”: “Test Daniel 2”,
“visible_to”: “3”,
“address_route”: “Schwarzkircher Weg”,
“address_sublocality”: null,
“address_locality”: “Heusenstamm”,
“address_admin_area_level_1”: “Hessen”,
“address_admin_area_level_2”: “Darmstadt”,
“address_country”: “Deutschland”,
“address_postal_code”: “63150”,
“people_count”: 6
}
on https://entegaplusgmbh.pipedrive.com
but address_route isnt’t updated(still is “Weiskircher Weg”) , neither people_count is updated?

What am i Doing wrong?

Just to double-check, are you sure that “Schwarzkircher Weg” is correct? Can’t find it on Google Maps either :thinking:

Hello dani,

no, it was just an example, but even when I use Ringstraße, or “Im Sporken”, which are are valid streetnames, nothing is updated.

With a valid address, the concept should be the same: you update only the address field, and the subfields are updated automatically.

So for example, you send the updated info, with:

"address": "Tonkuhlenweg 11 37081 Göttingen, Germany"

And in the detail of the organization, you will see:

[...]
       "address": "Tonkuhlenweg 11 37081 Göttingen, Germany",
       "address_subpremise": null,
        "address_street_number": "11",
        "address_route": "Tonkuhlenweg",
        "address_sublocality": null,
        "address_locality": "Göttingen",
        "address_admin_area_level_1": "Niedersachsen",
        "address_admin_area_level_2": null,
        "address_country": "Germany",
        "address_postal_code": "37081",
        "address_formatted_address": "Tonkuhlenweg 11, 37081 Göttingen, Germany",
[...]

If it’s not working for some specific address, feel free to post it and we can see why.

Hello dani,

if I just use the address field for update, the update works, but the subfields aren’t updated or will be erased. How could we force the subfields to be updated also?

The Snippet of my response:
[…]
“address”: “Im Sporken 6, 63150 Heusenstamm, Germany”,
“address_subpremise”: null,
“address_street_number”: null,
“address_route”: null,
“address_sublocality”: null,
“address_locality”: null,
“address_admin_area_level_1”: null,
“address_admin_area_level_2”: null,
“address_country”: null,
“address_postal_code”: null,
“address_formatted_address”: null,
[…]

You will not see them updated right away inside the POST or PUT request response because it takes a moment to retrieve the info. If you do a GET request to see that organization’s data, you will probably see the other fields now :slight_smile:

:+1::grinning:
Thank you that was the problem, I thought it would be the same data.
But :grimacing: still have the problem with the customfiled people_count, which doesn’t get updated neither.
See the definition of the field:

people_count is not updated manually. It’s based on the persons linked to that organization.


To link a person to an organization you can pass org_id in the PUT request.

Ok , how can i recognize such fields? About the “edit_flag”: false entry in the definition of this field?
And how do I recognize on which other fields this fields are depending, like in this case the persons which are assigned to an organization?

{
“id”: 3995,
“key”: “people_count”,
“name”: “Kontakte”,
“order_nr”: 8,
“picklist_data”: null,
“field_type”: “double”,
“add_time”: “2017-08-15 09:58:44”,
“update_time”: “2017-08-15 09:58:40”,
“last_updated_by_user_id”: null,
“active_flag”: true,
“edit_flag”: false,
“index_visible_flag”: true,
“details_visible_flag”: false,
“add_visible_flag”: false,
“important_flag”: false,
“bulk_edit_allowed”: false,
“searchable_flag”: false,
“filtering_allowed”: true,
“sortable_flag”: true,
“mandatory_flag”: true
},

Exactly, via the edit_flag.

On which fields a field is dependent really depends on the specific case…
Most fields should be intuitive, but if some are a bit unclear, feel free to ask here in the community :slight_smile:

1 Like

I actually haven’t needed to updated addresses, but PD uses the Google Maps API.

So I would have thought you should just be updating the “address” field, and let the Google API updated the subfields.

Hello @micahsdad1402,

yes @dani gave me this hint yesterday, my problem was that I only watched data in the response, instead of getting the updated record.:grimacing:

@dani , I’m not finding anywhere the pattern to use in the address field so that the subfields can be updated automatically. For example, wich field represents the information “apartment 14”?