1. Home
  2. GLU.Guide
  3. Integration Builder
  4. Unmarshalling and Marshalling
  5. Unmarshalling an Array or a Class to Store it as an Object

Unmarshalling an Array or a Class to Store it as an Object

You may have a payload with Classes where you are only really interested in the Class as a whole with all it’s underlying Attributes i.e. you have no interest in what those underlying Attributes are. In this case, when unmarshalling your payload you can click on the ‘Store as Object’ box. When you do so, the Attribute Name box will disappear (as you are not dealing with an Attribute, you’re dealing with the full Object) and you can then define a name for your Object in the ‘Object / Collection’ path as per example below.

If the Object is nested within an array(s) or a class(es), you can set your Object / Collection Path to reference the full path to the Object you are interested in e.g.

1 – array :


2 -class :


Classes, Objects and Arrays – the basics

Arrays and Objects are two data structures used in API Request and Response messages to organize data.

An Array is a collection of similar data items stored in a single variable. Each item in the array has an index number that starts from 0, and you can access each item by its index number. For example, an array of numbers could be [1, 2, 3, 4, 5].

An Object is a collection of key-value pairs where each key is a string and each value can be of any data type (numbers, strings, arrays, objects, etc.). You can access the values in an object by their keys. For example, an object could be: { “name”: “John”, “age”: 30, “city”: “New York” }

In the context of API Request and Response messages, Arrays and Objects can be used to structure data that is being sent or received, making it easier to access and manage.

An Object and a Class are related concepts in object-oriented programming (OOP), but they are not the same thing.

A Class is a blueprint or a template for creating objects. It defines the properties and methods that the objects created from that class will have. Classes are typically used to model real-world objects, and each object created from the class represents an instance of that class.

An Object, on the other hand, is an instance of a class. It has the properties and methods defined by the class, and can be used to store and manipulate data. An object is created from a class by calling the constructor of the class.

So, to summarize, a Class is a definition of a type of object, while an Object is an instance of that type of object.

Here’s an example in JSON API Response message that represents a list of books:

api_response = {
“books”: [
“title”: “The Great Gatsby”,
“author”: “F. Scott Fitzgerald”,
“year”: 1925
“title”: “To Kill a Mockingbird”,
“author”: “Harper Lee”,
“year”: 1960

In this example, Book is a Class that defines a type of object representing a book. It has three properties title, author, and year.

The API Response message is a JSON object that has an array of books, each represented by an object with properties title, author, and year. The code loops through the array of books in the API response and creates instances of the Book class for each book, storing them in the books list. The code then loops through the books list and prints the properties of each Book object.

“books” in the api_response is an array of objects. Each object in the “books” array represents a book and has properties title, author, and year.

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support
Fill the form and we’ll contact you shortly

    I agree with

    We uses cookies to make your experience on this website better. Learn more
    Accept cookies