Building a Blog with Agility Headless CMS

What is a Headless CMS

Step 1 — Open Up a Agility CMS Account

Step 2 — Create a Blog Model

Step 3 — Add some content

Step 4 — Retrieve the Data in your Javascript

$.AJAX

const guid = //get guid in the settings section under api keysconst apikey = // get apikey in the setting section under api keys$.ajax({
url: `https://api.aglty.io/${guid}/fetch/en-us/list/myblog`,
headers: {
accept: "application/json",
APIKey: apikey
}
})
.then((response) => {
console.log(response)
//use the data to populate your webpage from here
})

FETCH

const guid = //get guid in the settings section under api keysconst apikey = // get apikey in the setting section under api keysfetch(`https://api.aglty.io/${guid}/fetch/en-us/list/myblog`,{
headers: {
accept: "application/json",
APIKey: apikey
}
})
.then((response) => response.json())
.then((data) => {
console.log(data)
//use the data to populate your webpage from here
})

AXIOS

const guid = //get guid in the settings section under api keysconst apikey = // get apikey in the setting section under api keysaxios({
url: `https://api.aglty.io/${guid}/fetch/en-us/list/myblog`,
headers: {
accept: "application/json",
APIKey: apikey
}
})
.then((data) => {
console.log(data)
console.log(data.data) // <== This is the api data
//use the data to populate your webpage from here
})

Alex Merced is a Full Stack Developer, learn more about his work at AlexMercedCoder.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store