Agility CMS Sneak Peek: Content SDKs and APIs

All about programmatically accessing content from Agility CMS

Joel Varty
Joel Varty
Jan 22, 2020
About Agility CMS SDK API

Agility CMS provides a comprehensive set of methods for accessing the data in your Instance.

If you are building a website, we highly recommend using Javascript to do so. This enables you to use tools such as Gatsby and Next.js on top of the React framework to generate static sites.

What is API?

API is an abbreviation for an Application Programming Interface. As the name suggests, it is a request-based, programmable interface that relays data between the server and the client based on calls/requests. In the context of a Headless CMS, over the years, developers have envisioned novel ways to use custom APIs to extend the features and functions of Headless CMSs. But, the primary task of an API in all essentiality is to deliver content from your CMS service/platform (server) responsively to 3rd party applications and device platforms (client).

What is an SDK?

An SDK or a Software Development Kit is a veritable tool chest for developers that provides them every ingredient necessary for platform-specific programming. SDKs provide developers with an Integrated Development Environment that helps configure the Headless CMS as per bespoke requirements.

Benefits

Page Management

One of the main benefits of the Agility CMS Content API and the accompanying SDKs is Page Management. This doesn't refer to HTML pages on a website, but rather the JSON objects that represent all of the information on a page. Agility CMS allows your content editors to assemble the page object based on a template and set of modules, and then you can render that content using components in code. These components are reusable, allowing your developers to spend more time coding new functionality instead of re-creating existing features in new pages.

Content Relationships

Another benefit is the way content relationships are handled in the API. We call this content architecture, and the way that it's represented in the JSON output makes things a lot easier.

For example, if you request a content list of articles, and the articles on that list are linked to an authors list, you can specify a "depth" parameter to pull the author information as well.

Javascript SDK

Agility CMS provides a Javascript SDK and starter kits for both Gatsby and Next to help you get up and running. The SDK provides async method calls for all of the various areas where you need to pull data: shared content, content items, pages, sitemaps and galleries.

Each method call requires you to provide a GUID and API Key as authentications. You can also specify which language code you need content in, making multi-lingual sites easy to build.

Javascript Content Sync 

The Javascript SDK also includes methods to synchronize the content items and pages in your Agility CMS Instance. These calls allow you to pull everything you need down to your web server and to persist it locally. Syncing content and pages can greatly speed up your build time and will reduce the number of API calls you need to make.

REST API

The Javascript is essentially an ease-of-use layer on top of the raw REST API. If you are building a mobile app, or if you need to use a language other than Javascript, you can call the REST API directly. You can learn how to do this on our help site using our reference guide.

Ready to try? Try our Gatsby and Next.js blog starters here.

Keep Reading: 

If you want to learn more about Headless CMS, make sure you read these articles:

Free Workshop Recommended For You!

GraphQL Webinar
Back to All ResourcesBack to All Resources