How to retrieve related record details in GET REST Method?

Hi everyone.

I am making the following query:

{
    "filter": [
        {
            "$and": [
                {
                    "send_to_dimensions_c" : 1
                },
                {
                    "a_project_code" : {"$is_null": "a_project_code"}
                }
            ]
            
        }
    ],
    "fields": [
        "id",
        "name",
        "database_c",
        "team_id",
        "account_id",
        "account_name",
        "amount",
        "opportunity_type",
        "sales_stage",
        {"name":"accounts","fields":["id","name","database_c"],"order_by":"date_closed:desc"}
    ],
    "max_num":"100",
    "offset": "0"
}
Against the URL:
URL/.../filter
I want the grab the field "database_c" from the linked account (Many to One relationship so only one), but whenever I query like the above it just returns:

"accounts": {
                "name": "Supplier Test 2",
                "id": "8199432e-4ed6-11ed-9c81-00163ef40625",
                "_acl": {
                    "fields": {
                        "business_center_name": {
                            "create": "no",
                            "write": "no",
                            "license": "no"
                        },
                        "business_center_id": {
                            "create": "no",
                            "write": "no",
                            "license": "no"
                        }
                    },
                    "_hash": "e376f7492abb281a71d6a0860441877a"
                }
            },
 
But doesn't add the field I've referenced. Has anyone been able to do this? I'd rather not do a second call to the account ID to get the data if possible.
Thanks,

Daniel
Parents Reply Children
No Data