Class ArticlesEndpoint
Provides all the methods required to make calls to the articles endpoint of the Hudu API.
Inheritance
Namespace: HuduAPI.Endpoints
Assembly: HuduAPI.dll
Syntax
public class ArticlesEndpoint
Remarks
The articles endpoint is a full CRUD endpoint and provides all methods required to create, read, update delete and archive.
Constructors
ArticlesEndpoint(String, String)
Initializes a new instance of the endpoint class ready to communicate with the Hudu API.
Declaration
public ArticlesEndpoint(string huduAPIKey, string huduBaseURL)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | huduAPIKey | The hudu API key. |
| System.String | huduBaseURL | The hudu base URL. |
Properties
HuduAPIKey
Gets or sets the hudu API key that will be used for all calls to this Endpoint.
Declaration
public string HuduAPIKey { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The hudu API key. |
HuduBaseURL
Gets or sets the hudu base URL that will be used for all calls to the Endpoint.
Declaration
public string HuduBaseURL { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The hudu base URL. |
Methods
Archive(ItemById, Boolean)
Archives or unarchives the Article with the supplied ID
Declaration
public Article Archive(ItemById parameters, bool archive)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemById | parameters | The parameters to use when making the call. |
| System.Boolean | archive | Should the item be archived? True will archive the item, fales will unarchive the item |
Returns
| Type | Description |
|---|---|
| Article | An object of type |
Create(CreateArticle)
Performs a Create method call on the Hudu API to create a new article
Declaration
public Article Create(CreateArticle parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateArticle | parameters | The parameters to use when making the call. |
Returns
| Type | Description |
|---|---|
| Article | An object of type Article that represents the created object in hudu |
Delete(ItemById)
Deletes the Article ID from hudu using the Hudu API endpoint for delete
Declaration
public void Delete(ItemById parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemById | parameters | The parameters to use when making the call. |
Get(GetArticles)
Performs a get call to the api/v1/articles/ endpoint on the Hudu API
Declaration
public Articles Get(GetArticles parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| GetArticles | parameters | The parameters to use when making the call. |
Returns
| Type | Description |
|---|---|
| Articles | A single Articles object containing a list of articles |
Get(ItemById)
Performs a get call to the api/v1/articles/:id endpoint on the Hudu API
Declaration
public Article Get(ItemById parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemById | parameters | The parameters to use when making the call. |
Returns
| Type | Description |
|---|---|
| Article | A single article object will be returned using the ID provided |
Exceptions
| Type | Condition |
|---|---|
| RecordNotFoundException | If the article is not found than an exception is raised |
Update(UpdateArticle)
Performs an update on the supplied Article ID using the parameters supplied.
Declaration
public Article Update(UpdateArticle parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateArticle | parameters | The parameters to use when making the call. |
Returns
| Type | Description |
|---|---|
| Article | An object of type Article that represents the created object in hudu |