Stephen,
You have stumbled across one of the most ludicrous things I have found in the Velo API, and I have found many.
A contact looks like this, as you know:
{
"_createdDate": "Tue Dec 19 2023 12:19:40 GMT+0000 (Greenwich Mean Time)",
"_id": "a8456cf4-e9d5-444f-97a1-4510f1a8b52f",
"info": {
"emails": [
{
"_id": "f5f3f90a-fcea-42cb-9b16-c4e78127d6f1",
"tag": "UNTAGGED",
"email": "ergger@yyyy.co.uk",
"primary": true
}
],
"extendedFields": {
"contacts.displayByLastName": "XXXXXX YYYYY",
"invoices.vatId": "",
"emailSubscriptions.deliverabilityStatus": "VALID",
"members.membershipStatus": "APPROVED",
"emailSubscriptions.subscriptionStatus": "NOT_SET",
"emailSubscriptions.effectiveEmail": "xxxx@yyyyy.co.uk",
"contacts.displayByFirstName": "YYYYY XXXXXX"
},
"name": {
"first": "YYYYY",
"last": "XXXXXX"
},
"picture": {
"image": "https://images-wixmp-7ef3383b5fd80a9f5a5cc686.wixmp.com/171d9db8-7f64-446f-b290-37b9121d5b9c/1599229843526-IMG_1811.jpeg/v1/fill/w_320,h_320/file.jpg"
},
"profilePicture": "https://images-wixmp-7ef3383b5fd80a9f5a5cc686.wixmp.com/171d9db8-7f64-446f-b290-37b9121d5b9c/1599229843526-IMG_1811.jpeg/v1/fill/w_320,h_320/file.jpg"
},
"lastActivity": {
"activityDate": "Fri Sep 27 2024 10:53:16 GMT+0100 (British Summer Time)",
"activityType": "MEMBER_LOGIN",
"date": "Fri Sep 27 2024 10:53:21 GMT+0100 (British Summer Time)",
"description": "Logged in to your site",
"icon": {
"name": "UserJoin",
"url": "https://wixmp-8be454c954980f083caba37c.wixmp.com/activity-log/UserJoin.png"
}
},
"primaryInfo": {
"email": "xgserg@yyyyyy.co.uk"
},
"revision": 48,
"source": {
"appId": "eb377299-86b4-4a86-a1b5-774a2d1d374b",
"sourceType": "WIX_SITE_MEMBERS"
},
"_updatedDate": "Sun Sep 29 2024 08:21:52 GMT+0100 (British Summer Time)"
}
In the above JSON, you can see that the extended fields are not fully nested JSON objects and cannot be accessed as you have tried. You will find you can access them as follows:
firstItem.info.extendedFields.["emailSubscriptions.subscriptionStatus"]
Give this a try. If it works, then maybe you can persuade Code_Ninja to make a run at getting this referenced more clearly in the API.
Simon.