> For the complete documentation index, see [llms.txt](https://haptixgames.gitbook.io/web-api-kit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://haptixgames.gitbook.io/web-api-kit/core/modeling-responses.md).

# Modeling responses

What we need to do with that JSON blob is to generate C# classes from it so that the response can be accessed in Unity.  The simplest way to go about this, even before creating our HTTP operation, is to get a sample of the response from tools such as the [APIGEE Console](https://apigee.com/console/instagram)(defunct) or use [Postman](https://www.getpostman.com/) for your own private APIs. &#x20;

* **Step 1: Get the JSON Blob**

Go to the [APIGEE Console for Instagram](https://apigee.com/console/instagram)(defunct) and select OAuth2 from the Authentication dropdown.  Then follow the prompts to allow APIGEE access to your Instagram account.  At this point the Authentication dropdown should say ‘instagram-AuthenticatedUser’.  From the API Method selection pick the method we have been working with: ‘tags/{tag-name}/media/recent’.  Directly in the Request URL you can replace ‘{tag-name}’ with ‘games’ and press Send.  Once a response arrives, click the Snapshot button.  At the Snapshot screen, click the View Raw link and copy all of the JSON data into the clipboard.

![Instagram Response](https://3160023044-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LNwokgSPBJBpAv87dWr%2F-LNwvl6IByT_i6El4INK%2F-LNwwFcNX7GC1FX9BuOo%2Fimage.png?alt=media\&token=70a3ad74-b860-47ce-92ae-f06ce6eaf58c)

* **Step 2: Generate C# Classes**

With the raw JSON text in our clipboard go to [JSONUtils.com](http://jsonutils.com/).  Clear out the ‘JSON Text or URL’ field and paste in your JSON text.  Click Submit.  You just generated a C# representation of the JSON data!

Copy the C# code found in the lower pane and paste it below your HTTP operation.  Notice that the generated class named ‘Example’ is the root class of the response.

*NOTE: Replace all instances of IList to either List or an array.*

**Step 3: Update Operation**

Let’s modify our operation a little and add the following class field.

> `[hg.ApiWebKit.mappers.HttpResponseJsonBody] public Example Response;`

The attribute \[HttpResponseJsonBody] evaluates the returned JSON text and maps it to an instance of the Example class.

![Instagram Model](https://3160023044-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LNwokgSPBJBpAv87dWr%2F-LNwvl6IByT_i6El4INK%2F-LNwwkwXhWL_wgfO_qVD%2Fimage.png?alt=media\&token=cc1b12a2-2f42-4bef-b2f6-5a5c0bd99211)

It is time to run our operation again.  Attach the debugger and place a breakpoint within the ‘on\_complete’ block.

Below is the response which we can now use within our app.

![Model Debugging](https://3160023044-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LNwokgSPBJBpAv87dWr%2F-LNwvl6IByT_i6El4INK%2F-LNwwq_2vq2eYexoMv4V%2Fimage.png?alt=media\&token=1f74ba48-d4a9-4e03-81d8-21c7af4dffa4)

In the next post we will take a look on how to send and receive data with assets such as BestHTTP, UniWeb, UnityHTTP, etc.
