Update select Street Address fields on Person via API Patch

Hi All,

I'm (desperately!) trying to update select fields on a Person's street address, but so far no syntax has been successful for me.

Could somebody point me in the right direction? I've reading a bunch of posts in the forum, but none seem to adress specifically how to update select address fields on a person through a patch operation calling the Super Office API.

My (latest) syntax is as below:

[
{
"op": "replace",
"path": "Address/LocalizedAddress/Street/Line1",
"value": "@{variables('Address1')}"
}
]

 

Any help is greatly appreciated as I'm getting grey hairs by now :-D

Best Regards,

Henrik

RE: Update select Street Address fields on Person via API Patch

Hi Henrik,

Don't worry about the localized fields, just use the simplified street or postal paths..

PATCH https://sod.superoffice.com/Cust12345/api/v1/person/29 HTTP/1.1
Authorization: Bearer 8A:Cust12345.sdfsdfgibberush.moregibberish
Content-Type: application/json
Accept: application/json

[ 
    { 
        "op": "replace", 
        "path": "Address/Street", 
        "value": {
            "Address1": "225 Shattuck Hill Road C-1"
        }
    } 
]

Hope this helps!

Af: Tony Yates 13. nov 2020

RE: Update select Street Address fields on Person via API Patch

Hi Tony,
Thank you for your reply and suggestion.

It almost works: Out of the four address lines only the City is updated. I'm at a loss as to why as the syntax is the same for all four fields.

Here's the City field:

And here's the Address1 field:

The look identical, yet only City is uploaded through the API:

So I'm on my way, but in need of one last push, I think :-)

 

Best Regard,

Henrik

Af: Henrik Povlsen 13. nov 2020

RE: Update select Street Address fields on Person via API Patch

Hi Henrik,

You have to send the complete address fields together, otherwise it removes all the fields and only the last update wins.

    { 
        "op": "replace", 
        "path": "Address/Street", 
        "value": {
            "Address1": "225 Shattuck Hill Road C-1",
            "Address2": "C/O Tony Yates",
            "City": "Somewhere",
            "State": "OH",
            "Zipcode": "03823"
        }
    } 
]
Af: Tony Yates 13. nov 2020

RE: Update select Street Address fields on Person via API Patch

Amazing!

That did the trick - you learn something new every day!

Thank you so much for your help

 

Best Regards,

Henrik

Af: Henrik Povlsen 13. nov 2020

RE: Update select Street Address fields on Person via API Patch

The alternate PATCH syntax would be like this:

[
{
"op": "replace",
"path": "Address/Street/Address1",
"value": "foo"
},
{
"op": "replace",
"path": "Address/Street/Address2",
"value": "bar"
},
{
"op": "replace",
"path": "Address/Street/City",
"value": "quux"
}
]

This will leave the other address fields unchanged.

Af: Christian Mogensen 13. nov 2020