[SalesForce] How to access specific mailing address field on person account through API

I am trying to find out how to access each component of the mailing address on our person account object. The mailing address is on the contact but it's being display through the account. I'm having trouble finding the path for let's say the city field. Ie. Account.PersonMailingCity isn't working, nor is Contact.PersonMailingCity and not Contact.PersonMailingAddress.City either, etc.

Best Answer

You can retrieve the values on MailingAddress for Person Accounts as for other compound fields.

As an example using REST API, if I have the following request to retrieve values for one of my Person Accounts:

/services/data/v43.0/sobjects/Account/001xxxxxx?fields=Id,Name,PersonMailingStreet,PersonMailingCity

I get the response:

{
    "attributes": {
        "type": "Account",
        "url": "/services/data/v43.0/sobjects/Account/001xxxxx"
    },
    "Id": "001xxxxxx",
    "Name": "Jayant Das",
    "PersonMailingStreet": "1000 My Street",
    "PersonMailingCity": "My City"
}
Related Topic