Format of Sublists and Subrecords

REST web services do not automatically expand sublists and subrecords. You can use the expandSubResources query parameter to expand sublists and subrecords. If the query parameter is not used, the response contains only the body fields of the record, and the sublists and subrecords are represented by links. See the example in Getting a Record Instance.

The following is an example where the query parameter is used.

          GET https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer/107?expandSubResources=true 

        

In the response, note the expansion of the addressbookaddress subrecord.

          "accessTabChanged": false,
    "addressbook": {
        "links": [
            {
                "rel": "self",
                "href": "http://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer/107/addressbook"
            }
        ],
        "items": [
            {
                "links": [
                    {
                        "rel": "self",
                        "href": "http://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer/107/addressbook/39"
                    }
                ],
                "addressbookaddress": {
                    "links": [
                        {
                            "rel": "self",
                            "href": "http://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer/107/addressbook/39/addressbookaddress"
                        }
                    ],
                    "addr1": "417 Washington Blvd",
                    "addressee": "Glenrock General Hospital",
                    "addrText": "Alan Rath\nGlenrock General Hospital\n417 Washington Blvd\nGlenrock WY 82637",
                    "attention": "Alan Rath",
                    "city": "Glenrock",
                    "country": "US",
                    "dropdownstate": {
                        "links": [
                            {
                                "rel": "self",
                                "href": "http://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/"
                            }
                        ],
                        "id": "WY",
                        "refName": "Wyoming"
                    },
                    "id": "152",
                    "nKey": "152.0", 

        

Related Topics

General Notices