REST Web Services Key Concepts
The following sections introduce the key concepts of REST web services.
HATEOAS
Hypermedia as the Engine of Application State is a key principle that should be respected in RESTful APIs.
In practice, this means that you can navigate to referenced resources without deeper knowledge of the system. A typical response includes "links" sections for each resource, which can be a sub-resource of a parent resource or other referenced resources. You can use these links to work with the resources.
For example, when you get sales order data, the response includes a customer reference field with a links section. You can then use the link to get data of the particular customer.
For more information, see the following resources:
Resource
A resource represents a uniquely identifiable piece of data. Each resource has a unique URL, and can reference other resources.
There are two main types of resources:
-
Singular resources
-
Collection resources that contain multiple singular resources
Resources can exist in hierarchy, and can form a tree structure, consisting of child and parent resources.
In NetSuite, the most important resource is a record. A record is a singular resource. However, there can be other resources in NetSuite as well.
A record usually references other resources -other records.
An example of a collection resource is a sublist because it contains multiple lines. Each line is a singular child resource, and the record is a parent resource.
A record with multiple sublists, each of them with multiple lines, forms a hierarchical resource.