Content Fetch API

The Content Fetch API is a REST API endpoint for all of your Content and Pages in your Agility CMS instance. It is hosted and maintained by Agility and does not require any setup or other web hosts.

You can get started with the Content Fetch API for Free (forever) today.

  • Freedom - You can use any programming language or framework to get content from Agility CMS
  • It's fast! - API requests never hit your content database, won't affect your CMS users, and can handle millions of requests
  • Stable - API requests are handled by a global CDN using Fastly CDN
  • Write less, and better performant code - this API will auto-resolve linked content dependencies so you don't have to make multiple API calls to get/sort the content you need
  • It's flexible - Just want to use Shared Content to manage structured content? Sure, go ahead. Want a more dynamic approach using Pages? You can do that too.
  • Reduced complexity - You don't need to be a full-stack developer to integrate with our CMS.

Methods

  • Content Item - Gets the details of a content item by their Content ID.
  • Content List - Gets a list of content items by Reference Name.
  • Page - Gets the details of a page including its content zones, each module (and its properties).
  • Sitemap Flat - Gets the sitemap, returned in a flat list, where the dictionary key is the page path- ideal for implementing page routing.
  • Sitemap Nested - Gets the sitemap as an array in a nested format, ideal for generating menus.
  • Sync Content Items - Retrieves all content items in a paged format. Each call returns a syncToken that should be persisted and passed into subsequent requests to maintain sync state.
  • Sync Pages - Retrieves all pages items in a paged format. Each call returns a syncToken that should be persisted and passed into subsequent requests to maintain sync state.
  • Content Models - Returns the content models and page modules that are defined in the Agility CMS instance.
  • Gallery - Returns the requested gallery by ID.
  • URL Redirections - Returns the list of all URL Redirections since a particular date/time. Persist the lastAccessDate that is returned and use that value to maintain state on subsequent requests or don't pass-in a value to retrieve all URL Redirections.

Specifications

  • Open API standard using Swagger
  • All requests are GET methods
  • All responses are returned as JSON

Available SDKs

We provide SDKs (official and community-based) for a variety of frameworks and programming languages, and more will be added to this list over time.

We recommend using an official SDK to access your content where possible. Otherwise, you can use the REST API with any other programming language or framework.

Authenticating your Content Fetch API Calls

Whether you are hitting the Content Fetch REST API over HTTP directly or through an SDK, you'll need to know a few things about your instance in order to authenticate your requests, all of which can be found in the API Keys section.

Authentication Components

API URL - This is the URL where your API requests will be sent to. Some client SDKs, such as the Content Fetch JS SDK will resolve this automatically for you.

  • https://api.aglty.io/{guid}/{apitype}

GUID - This is your instance's unique identifier.

  • https://api.aglty.io/4582b5fa-u/{apitype}

API Type - There are two types of API Keys, preview and fetch. One for previewing content, and the other to view only published content.

  • https://api.aglty.io/4582b5fa-u/preview  

API Key - This is your secret API Key used for authentication that must be included in the header for each REST API request. It must support the apiType you are requesting. You can create as many API Keys as you see fit. API Keys may also have an optional expiry date.

Try the API (Swagger)

To view detailed documentation and to try out the API, use the Swagger endpoint to test using the API directly in the browser. You'll need your GUID, API Key, and API Type.

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

In Swagger, click the Authorize button:

Authorizing API for Agility CMS

Next, enter your API Key in the Value field:

Add API to value field for Agility CMS

Then, click Close:

Close API key on agilitycms.com/docsite

Making a Request

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

Click on the request you want to execute:

How to make an API request on agilitycms.com

This will expand the details of the request so we can see the input parameters and sample responses.

Input parameters for APIs on agilitycms.com
API request schema on agilitycms.com

Next, click the Try it out button:

Try it out API button on agilitycms.com

This will display input fields for each of the request parameters:

Request parameter inputs on agilitycms.com

There are 2 common input parameters that are required for ALL types of requests - guid, and apitype. The guid represents your Instance's unique identifier. The 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 of the content related API calls also require the locale parameter to be set. This is the locale code of your content.

Once you've entered your parameter values, click the Execute button to execute the request:

Executing API request on agilitycms.com

This 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.

Request URL and body on agilitycms.com

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?

Click to select and expand the API request you wish to inspect

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

Schema link for API return on agilitycms.com 

Retrieving your API Key(s), GUID, and API URL

Making a call to the Content Fetch API requires that you know your API Key, API URL (if calling the REST API directly over HTTP), or your GUID and Live/Preview API Keys if you are using an official SDK. 

Retrieving your Values

  1. Login to Agility CMS
  2. Access your API information from the Main Navigation by going to Settings > API Keys.
Retrieving API values on agilitycms.com

Managing Your API Keys

You can manage your API Keys by either Adding a new one or by Editing / Deleting an existing one.

Managing API keys on agilitycms.com
Enabling API keys on agilitycms.com

Try The API

To try out the API, click on the Try The API button to view your Live/Preview API URL's, the API Documentation, and to Test the API on Swagger.

Trying API keys on agilitycms.com
API URLs on agilitycms.com

Making your First API Call (cURL)

In order to make an Authenticated HTTP request to the Content Fetch API, you need the following values:

  1. API URL - the URL in which to make the request to
  2. API Key - the secret key that allows you to make a request to the API

The following example requests a List of content from Agility based on the reference name posts:

curl https://api.aglty.io/e13c7b01-u/preview/en-us/list/posts --header "APIKey: defaultpreview.fbe570b5cb1c8b2717fa01538d8ab43a0acad75a78c3620abd274c1186d12266"

The response for the request is provided in JSON format:

{
  "items": [
    {
      "contentID": 124,
      "properties": {
        "state": 2,
        "modified": "2021-04-01T10:15:59.907",
        "versionID": 916,
        "referenceName": "posts",
        "definitionName": "Post",
        "itemOrder": 3
      },
      "fields": {
        "title": "Virtual Tours - Ways to Travel From Home",
        "slug": "virtual-tours-ways-to-travel-from-home",
        "date": "2021-03-31T13:17:50+00:00",
        "category": {
          "contentID": 110,
          "properties": {
            "state": 2,
            "modified": "2021-03-23T09:24:26.82",
            "versionID": 710,
            "referenceName": "categories",
            "definitionName": "Category",
            "itemOrder": 1
          },
          "fields": { "title": "Travel Guide" }
        },
        "image": {
          "label": "Virtual Tour",
          "url": "https://cdn.aglty.io/blog-starter-2021-template/posts/virtual-tour_20210331171226_0.jpg",
          "target": null,
          "filesize": 279207,
          "pixelHeight": "1542",
          "pixelWidth": "2048",
          "height": 1542,
          "width": 2048
        },
        "content": "<p>Virtual tours can open up amazing and awe-inspiring locations around the world that may otherwise be inaccessible to you. You can experience the majesty of the Sistine Chapel, the wonder of the Great Wall of China, or the beauty of Hawaii from the comfort of your own home.</p>\r\n<h2>Picking the Right Virtual Tour for You</h2>\r\n<p>As you consider which virtual tour you want to take, try finding one that not only helps you explore a new place, but consider a place tied to your heritage. Learning more about your cultural heritage can help you become more resilient as you develop a deeper understanding of your story.</p>\r\n<h2>1. Vatican Museums</h2>\r\n<p><img src=\"https://cdn.aglty.io/gixkprai/posts/vatican-museum.jpg\" alt=\"Vatican Museum\" /></p>\r\n<p>This collection of virtual tours lets you see some of the masterpieces of the Renaissance, including the Sistine Chapel, Niccoline Chapel, Raphael&rsquo;s Room, and more.</p>\r\n<p><a href=\"http://www.museivaticani.va/content/museivaticani/en/collezioni/musei/tour-virtuali-elenco.html\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\"><em>Start the Tour</em></a><em></em></p>\r\n<h2>2. Great Wall of China</h2>\r\n<p><img src=\"https://cdn.aglty.io/gixkprai/posts/great-wall-of-china.jpg\" alt=\"Great Wall of China\" /></p>\r\n<p>The Great Wall is often regarded as a wonder of the world, making it a prime tourist attraction. By taking the tour online, you can skip the crowds and still experience the incredible view and Chinese history.</p>\r\n<p><a href=\"https://www.thechinaguide.com/destination/great-wall-of-china\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\"><em>Start the Tour</em></a></p>\r\n<h2>3. Louvre</h2>\r\n<p><img src=\"https://cdn.aglty.io/gixkprai/posts/louvre.jpg\" alt=\"Louvre\" /></p>\r\n<p>The Louvre, located in Paris, is the largest art museum in the world. Three of the museum&rsquo;s top exhibits are available online.</p>\r\n<p><a href=\"https://www.louvre.fr/en/visites-en-ligne#tabs\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\"><em>Start the Tour</em></a></p>\r\n<h2>4. Taj Mahal</h2>\r\n<p><img src=\"https://cdn.aglty.io/gixkprai/posts/taj-mahal.jpg\" alt=\"Taj Mahal\" /></p>\r\n<p>This ivory marble mausoleum in India is one of the most famous buildings in the world. Emperor Shah Jahan had it built in 1632 for his wife Mumtaz Mahal.</p>\r\n<p><a href=\"https://www.airpano.com/360photo/Taj-Mahal-India/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\"><em>Start the Tour</em></a></p>\r\n<h2>5. Create Your Own Virtual Tour</h2>\r\n<p><span>With the help of&nbsp;</span><a href=\"https://www.google.com/maps\" target=\"_blank\" rel=\"noopener\">Google Maps</a><span>&nbsp;or&nbsp;</span><a href=\"https://www.google.com/earth/\" target=\"_blank\" rel=\"noopener\">Google Earth</a><span>, you can explore almost any location in the world. If you need ideas of places to visit, use the opportunity to virtually&nbsp;</span><a href=\"https://www.familysearch.org/blog/en/heritage-tourism/\" target=\"_blank\" rel=\"noopener\">explore the places of your heritage</a><span>. Traveling to understand the past and particularly your ancestors will help you gain a connection to your&nbsp;</span><a href=\"https://www.familysearch.org/blog/en/what-is-heritage/\" target=\"_blank\" rel=\"noopener\">heritage</a><span>&nbsp;and a sense of your roots.</span></p>\r\n<p><span><a href=\"https://www.familysearch.org/blog/en/virtual-tours-travel-from-home/\" target=\"_blank\" rel=\"noopener\">Article Source</a></span></p>\r\n<p></p>",
        "categoryID": "110"
      },
      "seo": null
    },
    {
      "contentID": 113,
      "properties": {
        "state": 2,
        "modified": "2021-04-01T10:14:26.373",
        "versionID": 914,
        "referenceName": "posts",
        "definitionName": "Post",
        "itemOrder": 2
      },
      "fields": {
        "title": "Am-EH-zing Places to Visit in Canada!",
        "slug": "am-eh-zing-places-to-visit-in-canada",
        "date": "2021-03-23T13:38:00+00:00",
        "category": {
          "contentID": 110,
          "properties": {
            "state": 2,
            "modified": "2021-03-23T09:24:26.82",
            "versionID": 710,
            "referenceName": "categories",
            "definitionName": "Category",
            "itemOrder": 1
          },
          "fields": { "title": "Travel Guide" }
        },
        "image": {
          "label": "Visit the beautiful Alps in Switzerland",
          "url": "https://cdn.aglty.io/blog-starter-2021-template/posts/canadian.jpg",
          "target": null,
          "filesize": 143582,
          "pixelHeight": "830",
          "pixelWidth": "1200",
          "height": 830,
          "width": 1200
        },
        "content": "<p>Canada's cities and towns offer travelers a diverse choice of experiences, from chic, cosmopolitan centers to mountain resorts and maritime cities. Determining the best places to visit may depend on your interests and the type of trip you're hoping to create.</p>\r\n<h2 id=\"CDN-BC-BCV\" class=\"sitename\">1. Vancouver</h2>\r\n<p><img src=\"https://cdn.aglty.io/gixkprai/posts/vancouver.jpeg\" alt=\"Vancouver\" /></p>\r\n<p>For beauty, climate, a fun atmosphere, and plenty of things to do, you can't go wrong planning a trip to Vancouver. Set on the shores of the Pacific Ocean and backed by snow-capped mountains, this is an active city, where locals enjoy the outdoors year-round.</p>\r\n<p>Sunbathers can bask on the beaches in summer, and skiers can hit the nearby ski resorts in winter. At any time of year, you can walk the seawall or stroll through the towering trees in<span>&nbsp;</span><a href=\"https://www.planetware.com/vancouver/stanley-park-vancouver-cdn-bc-bcvsp.htm\" target=\"_blank\" rel=\"noopener\">Stanley Park</a>, enjoy fine dining or a casual meal while watching the sunset, or find fabulous shopping, from the markets of<span>&nbsp;</span><b>Granville Island</b><span>&nbsp;</span>to the high-end shops in the city center.</p>\r\n<h2 id=\"CDN-ON-ONNF\" class=\"sitename\">2. Niagara Falls</h2>\r\n<p><img src=\"https://cdn.aglty.io/gixkprai/posts/niagara-falls.jpeg\" alt=\"Niagara Falls\" /></p>\r\n<p>Canada's most famous natural attraction, the majestic Niagara Falls has been drawing sightseers almost since its discovery. The great wall of water pounding over the falls is an amazing sight, and the view and access afforded visitors is astounding. You can literally walk up to the edge of the falls, separated only by a cast-iron railing, and see the water as it disappears over the crest.</p>\r\n<p>The city that has developed here, also named Niagara Falls, has been greatly influenced by the people and atmosphere the falls have created. Stuntmen and daredevils have been tempting their fate on the falls throughout the decades, and as a result, a carnival-style atmosphere has come to define this unique city. Just a short drive from Toronto, Niagara Falls is easy to reach, and the city is a fun place to spend a day or two.</p>\r\n<h2>3. Toronto</h2>\r\n<p><img src=\"https://cdn.aglty.io/gixkprai/posts/toronto.jpeg\" alt=\"Toronto\" /></p>\r\n<p>As Canada's largest city, Toronto is the country's cultural hot spot, with ballet, opera, symphony, and Broadway shows. It's also home to the landmark<span>&nbsp;</span><strong>CN Tower</strong>. Add extraordinary shopping, fine dining, and fantastic museums, and there is no end to the entertainment.</p>\r\n<p>In recent years, Toronto's waterfront has experienced ongoing development and now boasts beautiful walking areas, restaurants, and in summer, outdoor concerts and cultural performances.</p>\r\n<p>Just outside the city center, in either direction from the city, are beautiful beaches, perfect on hot summer days. In winter, a public skating rink springs to life outside city hall, and unique winter events, including the popular<span>&nbsp;</span><b>Winterlicious</b>, add to the fun. You can find<span>&nbsp;</span><a href=\"https://www.planetware.com/canada/top-rated-ski-resorts-near-toronto-cdn-1-197.htm\" target=\"_blank\" rel=\"noopener\">ski resorts near Toronto<span>&nbsp;</span></a>as well.</p>\r\n<h2>4. Montreal</h2>\r\n<p><img src=\"https://cdn.aglty.io/gixkprai/posts/montreal.jpeg\" alt=\"Montreal\" /></p>\r\n<p>Montreal is a unique city, with a beautiful old historic district dating back to the 1600s and a modern city center with extensive underground shopping.<span>&nbsp;</span><b>Old Montreal</b><span>&nbsp;</span>is the main tourist hub, with cobbled streets and fantastic old buildings.</p>\r\n<p>Montreal is also home to a large number of fashion designers, and high-end boutiques line the historic streets, along with quaint hotels and restaurants. Located in the French-speaking<span>&nbsp;</span><a href=\"https://www.planetware.com/tourist-attractions-/quebec-province-cdn-qu-qu.htm\" target=\"_blank\" rel=\"noopener\">province of Qu&eacute;bec</a>, Montreal has its own cultural identity, but English-speaking visitors will have no trouble communicating with anyone in the tourist industry.</p>\r\n<h2>5. Banff</h2>\r\n<p><img src=\"https://cdn.aglty.io/gixkprai/posts/banff.jpeg\" alt=\"Banff\" /></p>\r\n<p>The charming mountain town of Banff, in the stunning<span>&nbsp;</span><b>Banff National Park</b>, is a must-visit destination for anyone looking to explore the Rocky Mountains and see some of the most beautiful scenery in Canada. This is undeniably a tourist town, catering to international travelers from all over the globe.</p>\r\n<p>Just a short distance from the town is&nbsp;Lake Louise Ski Resort&nbsp;and&nbsp;Sunshine Village Ski Resort, two of<span>&nbsp;</span><a href=\"https://www.planetware.com/canada/top-rated-ski-resorts-in-canada-cdn-1-65.htm\" target=\"_blank\" rel=\"noopener\">Canada's best ski resorts</a>. In summer, the nearby turquoise lakes, including Lake Louise, and glacier-capped mountains are a glorious sight.</p>\r\n<p>But you don't even need to leave the town to enjoy a gondola ride to the top of a mountain for dinner, soak in a hot spring-fed pool, find fabulous shopping, discover lovely walking trails, and possibly see elk and woodland caribou that frequently make their way into town.</p>\r\n<p><a href=\"https://www.planetware.com/canada/best-places-to-visit-in-canada-cdn-1-12.htm\" target=\"_blank\" rel=\"noopener\">Article Source</a></p>\r\n<p></p>",
        "categoryID": "110"
      },
      "seo": null
    },
    {
      "contentID": 112,
      "properties": {
        "state": 2,
        "modified": "2021-03-31T10:36:55.837",
        "versionID": 884,
        "referenceName": "posts",
        "definitionName": "Post",
        "itemOrder": 1
      },
      "fields": {
        "title": "Travel Photography Tips: 101",
        "slug": "travel-photography-101",
        "date": "2021-03-23T13:37:00+00:00",
        "category": {
          "contentID": 109,
          "properties": {
            "state": 2,
            "modified": "2021-03-23T09:24:14.623",
            "versionID": 708,
            "referenceName": "categories",
            "definitionName": "Category",
            "itemOrder": 0
          },
          "fields": { "title": "Travel Tips" }
        },
        "image": {
          "label": "Travel Photography 101",
          "url": "https://cdn.aglty.io/blog-starter-2021-template/posts/travel-photography_20210331143648_0.jpg",
          "target": null,
          "filesize": 293833,
          "pixelHeight": "2048",
          "pixelWidth": "2048",
          "height": 2048,
          "width": 2048
        },
        "content": "<p class=\"\">Photographs are often the best souvenir of your travels. But the worst thing is when they come out blurry, blown out, or just not all that exciting to look at.</p>\r\n<p class=\"\">If you want to learn how to take better pictures on your travels around the world, this article is packed with everything you need to improve your photography skills.</p>\r\n<h2>1. Set your camera to shoot in burst mode</h2>\r\n<p><img src=\"https://cdn.aglty.io/gixkprai/posts/whale-watching.jpg\" alt=\"Whale Watching\" /></p>\r\n<p class=\"\">Setting your camera to \"burst\" mode means that several shots will be taken with a single click of the shutter. This is especially helpful when you&rsquo;re trying to take an action shot, like a whale breaching the water&rsquo;s surface.&nbsp;</p>\r\n<p class=\"\">Also, burst mode is a good idea when handing your camera to a stranger to take your photo. You will get several to choose from, instead of just one where you&rsquo;re blinking and someone is photo-bombing in the background. I always have my camera set in burst mode so we can choose our favorite photo from a series.&nbsp;</p>\r\n<h2>2. Carry a small tripod</h2>\r\n<p><img src=\"https://cdn.aglty.io/gixkprai/posts/beach-sunset.jpeg\" alt=\"Beach Sunset\" /></p>\r\n<p class=\"\">A tripod will seriously up your photo-taking game. There are several reasons for this but one of the main reasons we carry a tripod is so we can get shots of epic landscapes with ourselves in the picture.&nbsp;</p>\r\n<p class=\"\">If you're in a remote location, there might not be anyone around to take your photo. And even when there are tons of people around, they might not take shots you&rsquo;re happy with. &nbsp;</p>\r\n<p class=\"\">When you travel with a tripod, you can always get a great photo of yourself because you are in control.</p>\r\n<h2>3. Shoot early and late</h2>\r\n<p><img src=\"https://cdn.aglty.io/gixkprai/posts/kyoto-sunset.jpeg\" alt=\"Kyoto Sunset\" /></p>\r\n<p class=\"\">No matter how talented of a photographer you may be, there are certain times of the day where your shot just won&rsquo;t look as good. For instance, during the middle of the day when the sun is at its peak in the sky, the light is harsh and your photos will tend to have strong shadows. Instead, aim to take photos when the sun is low in the sky and it'll cast a warm glow instead of harsh white light.</p>\r\n<p class=\"\">The most ideal times of the day to take photos are in the morning just after sunrise, and during that magical &ldquo;golden hour&rdquo; just before sunset. Try to arrive at locations you want to shoot during these times. Of course there are many times when you can&rsquo;t arrive at the ideal time, but it&rsquo;s a good rule to follow whenever possible.</p>\r\n<h2>4.&nbsp; Don&rsquo;t be afraid of a little rain (or clouds!)</h2>\r\n<p><img src=\"https://cdn.aglty.io/gixkprai/posts/raindrop-flowers.jpeg\" alt=\"Rain Droplets on Flowers\" /></p>\r\n<p class=\"\">Cloudy days can sometimes be disappointing when you&rsquo;re on vacation, but they often make for the most interesting photos. Clouds soften the sun&rsquo;s light, acting like a natural light box, and make it possible for you to get great shots even in the peak of the afternoon. They can also create a cool, moody effect and can make your pictures more interesting than if you have a clear blue sky.&nbsp;</p>\r\n<p class=\"\">Much the same, many people get nervous to take their camera out in the rain. But rainy shots can be super interesting.</p>\r\n<h2>5. Get a different perspective</h2>\r\n<p><img src=\"https://cdn.aglty.io/gixkprai/posts/taj-mahal-unique-prespective.jpeg\" alt=\"Taj Mahal Unique Prespective\" /></p>\r\n<p class=\"\">It can be a good idea to get inspiration by searching online for famous shots of iconic places. For instance, a quick Google search of &ldquo;Taj Mahal&rdquo; will show you the most famous angles this landmark is shot from.&nbsp;</p>\r\n<p class=\"\">But in order to really improve your photography skills, do the OPPOSITE. When everybody is taking pictures to the right, turn left. Look up. Look down. Don&rsquo;t be afraid to get down on the ground and shoot from below.</p>\r\n<p class=\"\">Walk to a less crowded side of the landmark and take a picture from that lesser-seen angle, like the photo of the Taj Mahal above.</p>\r\n<p class=\"\"><a href=\"https://www.twowanderingsoles.com/blog/32-easy-creative-travel-photography-tips\" target=\"_blank\" rel=\"noopener\">Article Source</a></p>",
        "categoryID": "109"
      },
      "seo": null
    }
  ],
  "totalCount": 3
}

URL Path Parameters

Each type of API request at least 3 mandatory parameters:

GUID, API Key, and API Type.

Since each type of API request is a GET request, all parameters (aside from the API Key) are set in the URL path.

All requests follow this pattern:

https://api.aglty.io/{guid}/{apitype}/{locale}/{requestType}/{requestParams}

  • Locale - The locale code for the content you are requesting.
  • Request Type - Represents the specific type of request you want to make (i.e. item, list, page, sitemap/flat, or sitemap/nested).
  • Request Params - The parameters specific to this request type, this is usually an identifier for the type of content you want to retrieve such as a reference name or id. Some requests types also accept additional parameters in the form of a query string such as the list method, which accepts a series of sort, filter, and pagination parameters.

Content States

When you request a Content Item or a Page, the properties object contains a state property which tells you what the current state of the Item is. This value is an integer. 

The following enum represent the actual state.

  • 1 = Staging
  • 2 = Published
  • 3 = Deleted
  • 4 = Approved
  • 5 = Awaiting Approval
  • 6 = Declined
  • 7 = Unpublished

API Rate Limits

Our API and assets are available via a content delivery network (CDN) which is distributed globally. The server closest to your user will serve all content and assets, thus minimizing latency and benefitting your website or application.

Basic API Information

Our API is available at:

api.aglty.io (for our USA Data Center)

or

ca-api.aglty.io (for our Canadian Data Center)

Our rate limits determine the number of requests a client can make to our API in a certain amount of time. All requests have a per-second rate limit.

If your response is cached on our CDN, it will not count towards your rate limit. Our API enforces a limit of 10 direct requests per 1 second.

  • When there are too many requests (more than 10 requests in a second), we will respond with a status code of 429: Too Many Requests.
  • When the request for a response times out after 30 seconds, we respond with a status code of 408: The request took too long to process.

Content Link Depth

When fetching content that contains Linked Content, you'll notice that the API may return a reference name instead of the actual content you were expecting. We do this to ensure you're not always over-fetching content.

Depending on how deeply linked your Content Architecture is, we provide a ContentLinkDepth query parameter for our API that lets you define how much Linked Content you would like to fetch.

The default value for ContentLinkDepth is 1, and the maximum value that can be passed is 5.

ContentLinkDepth works in conjunction with the query parameter ExpandAllContentLinks. If set to true, Linked Content will be expanded in the response.

Example 1

  • ContentLinkDepth = 1
  • ExpandAllContentLinks = false
https:/api.aglty.io/{GUID}/fetch/en-us/list/example?ContentLinkDepth=1&ExpandAllContentLinks=false

This request will return the following response:

{
  "items": [
    {
      "contentID": 94,
      "properties": {},
      "fields": {
        "field": {
          "referencename": "example1"
        }
      }
    }
  ],
  "totalCount": 1
}

Example 2

  • ContentLinkDepth = 1
  • ExpandAllContentLinks = true
https:/api.aglty.io/{GUID}/fetch/en-us/list/example?ContentLinkDepth=1&ExpandAllContentLinks=true

This request will return the following response:

{
  "items": [
    {
      "contentID": 94,
      "properties": {},
      "fields": {
        "field": [
          {
            "contentID": 95,
            "properties": {},
            "fields": {
              "field": {
                "referencename": "example2"
              }
            }
          }
        ]
      }
    }
  ],
  "totalCount": 1
}

Example 3

  • ContentLinkDepth = 2
  • ExpandAllContentLinks = true
https:/api.aglty.io/{GUID}/fetch/en-us/list/example?ContentLinkDepth=2&ExpandAllContentLinks=true

This request will return the following response:

{
  "items": [
    {
      "contentID": 94,
      "properties": {},
      "fields": {
        "field": [
          {
            "contentID": 95,
            "properties": {},
            "fields": {
              "field": [
                {
                  "contentID": 96,
                  "properties": {},
                  "fields": {
                    "field": {
                      "referencename": "example3"
                    }
                  }
                }
              ]
            }
          }
        ]
      }
    }
  ],
  "totalCount": 1
}

Bandwidth Restrictions

We have Bandwidth Restrictions set in place to monitor your total bandwidth of assets and API calls available per month. To view more information on Bandwidth Restrictions, refer to our Pricing page.