Agility package to pull content from Agility instance via Fetch API.
Updated for 2.0 and .Net 8
IsPreview
is now a parameter set on EACH method call.- Added support for GraphQL Content Items.
- Removed the
Shared
andCore
projects, unifying into 1 assembly.
-
Clone Agility CMS .NET Fetch API repo at https://github.com/agility/agilitycms-dotnet-fetch-api
-
Clone and configure Agility CMS .NET Starter at https://github.com/agility/agilitycms-dotnet-starter
-
Open Agility CMS .NET Starter and add the project Agility CMS .NET Fetch API to your solution
-
Finally add a dependency by right clicking 'Dependencies' under Agility.NET.Starter
-
Select 'Add Project Reference' and check Agility.NET.FetchAPI
The Fetch API supports the following calls.
Function | Parameters | Description |
---|---|---|
GetContentItem | GetItemParameters |
Get a single content item |
GetContentList | GetListParameters |
Get a content list |
GetGallery | GetGalleryParameters |
Get a gallery |
GetPage | GetPageParameters |
Get a page |
GetSitemapFlat | GetSitemapParameters |
Get a flat sitemap |
GetSitemapNested | GetSitemapParameters |
Get a nested sitemap |
GetUrlRedirections | GetUrlRedirectionsParameters |
Get URL redirections |
GetSyncContent | GetSyncParameters |
Grab all content using a sync token |
GetSyncPages | GetSyncParameters |
Get all pages using a sync token |
public class GetItemParameters
{
public string Locale { get; set; }
public int ContentId { get; set; }
public int ContentLinkDepth { get; set; }
public bool ExpandAllContentLinks { get; set; }
}
public class GetListParameters
{
public string Locale { get; set; }
public string ReferenceName { get; set; }
public string Fields { get; set; }
public int Take { get; set; }
public int Skip { get; set; }
public string Filter { get; set; }
public string Sort { get; set; }
public string Direction { get; set; }
public int ContentLinkDepth { get; set; }
public bool ExpandAllContentLinks { get; set; }
}
public class GetGalleryParameters
{
public int GalleryId { get; set; }
}
public class GetPageParameters
{
public string Locale { get; set; }
public int PageId { get; set; }
public int ContentLinkDepth { get; set; }
public bool ExpandAllContentLinks { get; set; }
}
public class GetSitemapParameters
{
public string Locale { get; set; }
public string ChannelName { get; set; }
}
public class GetUrlRedirectionsParameters
{
public DateTime? LastAccessDate { get; set; }
}
public class GetSyncParameters
{
public string Locale { get; set; }
public long SyncToken { get; set; }
public int PageSize { get; set; }
}