Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fetching actual data from Netsuite rather than HATEOAS links

While fetching the data from Netsuite using REST web Services. I am getting the following data as response. Is there any way where instead of HATEOAS links, I can get the actual data? I want to dump all the data to a file and in doing so I would have to make multiple calls with each id to get the data. Is there any way I can fetch all of the data with a single API call?

{
    "links": [
        {
            "rel": "next",
            "href": "https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/salesorder?limit=2&offset=2"
        },
        {
            "rel": "last",
            "href": "https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/salesorder?limit=2&offset=8"
        },
        {
            "rel": "self",
            "href": "https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/salesOrder/?limit=2"
        }
    ],
    "count": 2,
    "hasMore": true,
    "items": [
        {
            "links": [
                {
                    "rel": "self",
                    "href": "https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/salesorder/39"
                }
            ],
            "id": "39"
        },
        {
            "links": [
                {
                    "rel": "self",
                    "href": "https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/salesorder/40"
                }
            ],
            "id": "40"
        }
    ],
    "offset": 0,
    "totalResults": 8
}
like image 306
ROBCROSS Avatar asked Sep 02 '25 15:09

ROBCROSS


1 Answers

Use the expandSubResources parameter as part of your get request. Set it to true to expand subitems and sublists.


hat tip @johny for the assist!

like image 60
2ps Avatar answered Sep 05 '25 16:09

2ps