What is a Resource?

REST APIs operate on resources that are defined within a REST interface file such as a Swagger specification. A resource is a representation of a thing (a noun) on which the REST APIs (verbs) operate. Some examples of a resource are a user, a book, or a pet. The REST operations, POST, GET, PUT, PATCH, and DELETE operate on a resource. Individual instances of a resource are identified by a unique identifier within the resource such as an ID or name.

A resource can be thought of as an entity which is expressed by a well-formed URI. In many ways it is similar to an instance of a class in the Java language. A resource has a type, one or more parameters, and some standard operations that allow you to manipulate or retrieve it from a remote location if you know its endpoint URL. The operations allowed on a resource are POST, GET, PUT, PATCH, and DELETE that correspond to the CRUD operations. A resource can exist independently or it can be a part of a homogeneous collection. All the information that is relevant to a resource is contained within the resource itself.

A resource is represented by an XML object in TIBCO Business Studio™ for BusinessWorks™ and a JSON object in a Swagger file.