> 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/inside-operations.md).

# Inside operations

[WAK](https://www.assetstore.unity3d.com/en/#!/content/19663) operations define everything about an HTTP call.  The information on how to structure the class comes from the API’s documentation.

Let’s take a look at one of Instagram’s endpoints.

![Instagram Endpoint](/files/-LNwttx2-jC59G0IBLZC)

Let’s take a look at the URI:  [https://api.instagram.com/v1/tags/{tag-name}/media/recent?access\_token=ACCESS-TOKEN\&count=100](https://api.instagram.com/v1/tags/{tag-name}/media/recent?access_token=ACCESS-TOKEN\&amp;count=100)<br>

| **Base URI**                                           | **Resource Path**                                                                                            | **Query String**                      |
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------- |
| <https://api.instagram.com/v1/>                        | tags/{tag-name}/media/recent                                                                                 | ?access\_token=ACCESS-TOKEN\&count=10 |
| This is our entry point into Intagram’s version 1 API. | Notice the {tag-name}.  This is a URI Template that must be replaced and resolved before making the request. | Parameters as part of the URI.        |

From this information we can begin constructing our operation class.  Any operation class must inherit from `hg.ApiWebKit.core.http.HttpOperation`.

```
[HttpPath(null,"https://api.instagram.com/v1/tags/{$tag}/media/recent")]
[HttpGET]
public class InstagramRecentMediaForTag : hg.ApiWebKit.core.http.HttpOperation
{
    [HttpUriSegment("tag")]
    public string Tag = "gaming";
    
    [HttpQueryString("count")]
    public int Count = 10;
    
    [HttpQueryString]
    public string access_token = "abc123";
}
```

Notice that we are using C# attributes everywhere.  At runtime the URI in the \[HttpPath] attribute will be expanded by using the values from the class fields and will look like this:  [https://api.instagram.com/v1/tags/gaming/media/recent?access\_token=abc123\&count=10](https://api.instagram.com/v1/tags/gaming/media/recent?access_token=abc123\&amp;count=10)

Most attribute constructors in this example accept optional parameters and are really just key-value pairs.  By using the parameterless constructor you are defining the ‘Name’ to be the same as the field name, as seen in the ‘access\_token’ field.

* **Name**: the name of the parameter.  For example, the ‘Count’ field as is will evaluate to query string ‘count=10’.
* **Value**: static value of the parameter.  Instead of using the value of the ‘Count’ field during evaluation, you can force it to use a static value.  This would look like `[HttpQueryString("count", Value= "10")]`.
* **VariableName**: name of the parameter resolved from settings in the Configuration class.
* **VariableValue**: value of the parameter resolved from settings in the Configuration class.

Now we are ready to test our operation.  By adding `Configuration.SetSetting ("log-VERBOSE", true);` to the beginning of the Start method, you will see copious amounts of information in the Unity Console.

![Calling Instagram Endpoint](/files/-LNwvPCz-TtVoFG2pG3h)

If you have entered a valid access token you should see these entries in Unity’s Console breaking down the request and responses.

![Request](/files/-LNwvWcF7kmt90i0Mrnu)

![Response](/files/-LNwvZo1zbTvCbGSymw7)

The returned text is raw JSON and is pretty useless to us at this point.

![Response Data](/files/-LNwvdiG-F3WMxu0hDvm)

In the next post we will take a look on how to make this JSON data accessible to us in Unity.<br>
