Skip to content

Instantly share code, notes, and snippets.

@jamesvidler
Created August 15, 2019 20:39
Show Gist options
  • Select an option

  • Save jamesvidler/d1d3bb4e0c1c27ec32aaf6f9859705f3 to your computer and use it in GitHub Desktop.

Select an option

Save jamesvidler/d1d3bb4e0c1c27ec32aaf6f9859705f3 to your computer and use it in GitHub Desktop.
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",
"itemOrder": 0
},
"fields": {
"title": "How this site works!",
"author": {
"contentID": 25,
"properties": {
"state": 2,
"modified": "2019-08-14T13:07:25.99",
"versionID": 142,
"referenceName": "postauthors",
"definitionName": "Author",
"itemOrder": 0
},
"fields": {
"name": "James Vidler",
"image": {
"label": null,
"url": "https://046a1a87-cdn.agilitycms.cloud/Attachments/NewItems/P6150353_small_20190814170433_0.jpg",
"target": null,
"filesize": 26738,
"pixelHeight": "433",
"pixelWidth": "577",
"height": 433,
"width": 577
}
}
},
"authorID": "25",
"details": "<p>Here is some dummy content for the post details...</p>",
"relatedPostsIDs": "27,16",
"relatedPosts": [
{
"contentID": 16,
"properties": {
"state": 2,
"modified": "2019-08-15T16:28:01.053",
"versionID": 167,
"referenceName": "posts",
"definitionName": "Post",
"itemOrder": 1
},
"fields": {
"title": "How to handle SEO with a JS app",
"image": {
"label": null,
"url": "https://046a1a87-cdn.agilitycms.cloud/Attachments/NewItems/jamstack-acronym_20190326190136_0.png",
"target": null,
"filesize": 67338,
"pixelHeight": "660",
"pixelWidth": "966",
"height": 660,
"width": 966
},
"details": "<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>"
},
"seo": null
},
{
"contentID": 27,
"properties": {
"state": 2,
"modified": "2019-08-14T17:12:07.21",
"versionID": 161,
"referenceName": "posts",
"definitionName": "Post",
"itemOrder": 2
},
"fields": {
"title": "Sample post",
"author": { "contentid": 26 },
"authorID": "26",
"details": "<p>Sample content for sample post</p>"
},
"seo": null
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment