Skip to content

Instantly share code, notes, and snippets.

curl https://046a1a87-api.agilitycms.cloud/fetch/en-us/item/28
--header "APIKey: defaultlive.2b7f3a91559d794bedb688358be5e13af2b1e3ae8cd39e8ed2433bbef5d8d6ac"
{
"contentID": 28,
"properties": {
"state": 2,
"modified": "2019-08-16T15:49:56.583",
"versionID": 173,
"referenceName": "dodgeblocklandingpage",
"definitionName": "LandingPage",
@jamesvidler
jamesvidler / get-post-w-posts.curl
Created August 15, 2019 20:39
Retrieve a Post that has a related posts field using a searchlistbox
curl https://046a1a87-api.agilitycms.cloud/fetch/en-us/item/15?contentLinkDepth=1
--header "APIKey: defaultlive.2b7f3a91559d794bedb688358be5e13af2b1e3ae8cd39e8ed2433bbef5d8d6ac"
{
"contentID": 15,
"properties": {
"state": 2,
"modified": "2019-08-15T16:22:34.45",
"versionID": 165,
"referenceName": "posts",
"definitionName": "Post",
@jamesvidler
jamesvidler / get-post-author-no-depth-response.json
Created August 14, 2019 21:55
Get a content item with a linked content dropdown field with a contentLinkDepth of 0
{
"contentID": 15,
"properties": {
"state": 2,
"modified": "2019-08-14T17:11:15.22",
"versionID": 159,
"referenceName": "posts",
"definitionName": "Post",
"itemOrder": 0
},
@jamesvidler
jamesvidler / get-post-author-w-depth-resp.curl
Last active August 14, 2019 21:57
A dropdown linked content response when resolved correctly
curl https://046a1a87-api.agilitycms.cloud/fetch/en-us/item/15?contentLinkDepth=1
--header "APIKey: defaultlive.2b7f3a91559d794bedb688358be5e13af2b1e3ae8cd39e8ed2433bbef5d8d6ac"
{
"contentID": 15,
"properties": {
"state": 2,
"modified": "2019-08-14T17:11:15.22",
"versionID": 159,
"referenceName": "posts",
"definitionName": "Post",
@jamesvidler
jamesvidler / get-post-author-no-depth.curl
Last active August 14, 2019 22:04
List a post with author details, with no contentLinkDepth set
curl https://046a1a87-api.agilitycms.cloud/fetch/en-us/item/15
--header "APIKey: defaultlive.2b7f3a91559d794bedb688358be5e13af2b1e3ae8cd39e8ed2433bbef5d8d6ac"
{
"contentID": 15,
"properties": {
"state": 2,
"modified": "2019-08-14T17:11:15.22",
"versionID": 159,
"referenceName": "posts",
"definitionName": "Post",
{
"items": [
{
"contentID": 25,
"properties": {
"state": 2,
"modified": "2019-08-14T13:07:25.99",
"versionID": 142,
"referenceName": "postauthors",
"definitionName": "Author",
@jamesvidler
jamesvidler / list-authors.curl
Last active August 14, 2019 22:27
Get Authors using the Agility CMS Content Fetch API
curl https://046a1a87-api.agilitycms.cloud/fetch/en-us/list/postauthors
--header "APIKey: defaultlive.2b7f3a91559d794bedb688358be5e13af2b1e3ae8cd39e8ed2433bbef5d8d6ac"
@jamesvidler
jamesvidler / sample-request.js
Last active August 13, 2019 15:58
Sample Request
import agility from '@agility/content-fetch'
const api = agility.getApi({
guid: '046a1a87',
apiKey: 'defaultlive.2b7f3a91559d794bedb688358be5e13af2b1e3ae8cd39e8ed2433bbef5d8d6ac',
isPreview: false
});
//use async to write cleaner code
let contentListResult = await api.getContentList({ referenceName: 'posts', languageCode: 'en-us' });
@jamesvidler
jamesvidler / list.curl
Last active August 14, 2019 22:28
Sample curl command
curl https://046a1a87-api.agilitycms.cloud/fetch/en-us/list/posts
--header "APIKey: defaultlive.2b7f3a91559d794bedb688358be5e13af2b1e3ae8cd39e8ed2433bbef5d8d6ac"
{
"items": [
{
"contentID": 15,
"properties": {
"state": 2,
"modified": "2019-07-18T13:16:41.033",
"versionID": 105,
"referenceName": "posts",
"definitionName": "Post",