# Testing on Swagger

> Source: https://agilitycms.com/docs/developers/testing-on-swagger

To view detailed documentation and to try out the API, [use the Swagger endpoint](https://api.aglty.io/swagger/index.html) to test using the API directly in the browser. You'll need your GUID, API Key, and API Type. 

## Getting Started

You first need to authorize Swagger by setting your API Key value. 

1. In Swagger, click the **Authorize Button** 

2. Enter your **API Key **in the **Value field** and click **Authorize **

![](https://cdn.aglty.io/agility-cms-docs/images/block-editor/swagger-1-07252023132736.png)

3. Click **Close**


## Making a Request

Now that you've set your API Key, you are ready to make a request. 

1. Expand the details of the request so we can see the input parameters and sample responses by **Clicking on the Request **you want to execute

![](https://cdn.aglty.io/agility-cms-docs/images/block-editor/swagger-2-07252023132941.png)

2. Review the information and then click **Try it out**, this will also display input fields for each of the request parameters 

![](https://cdn.aglty.io/agility-cms-docs/images/block-editor/swagger-3-07252023143725.png)

There are 2 common input parameters that are needed for ALL types of requests - **guid**, and **apitype**.  

- **guid **represents your Instance's unique identifier.  

- **apitype **parameter informs the API that you intend to retrieve preview content or fetch (live content only) - valid values are preview and fetch. 

You'll find that all the content-related API calls also require the locale parameter to be set. This is the locale code of your content. 

3. Once you've entered your parameter values, click the **Execute** button to execute the request which will execute the request, display a sample Curl snippet for the same request, show the Request URL, as well as the Response Body and Response Headers of the request. 

![](https://cdn.aglty.io/agility-cms-docs/images/block-editor/swagger-4-07252023143944.png)

![](https://cdn.aglty.io/agility-cms-docs/images/block-editor/swagger-5-07252023144013.png)

## Exploring API Models

Every API request returns a type of result. Each type is detailed under the Models area in Swagger, below the list of requests as well as within each request's response. 

## How to Determine What Type/Model an API Request will Return?

1. **Click to Select** and expand the API request you wish to inspect

2. Under Responses for the request, click the **Schema** link to view the definition of the API return type 

![](https://cdn.aglty.io/agility-cms-docs/images/block-editor/swagger-6-07252023144132.png)

**Further Reading**


- [Content Fetch API](https://agilitycms.com/docs/developers/content-fetch-api)
