Coder Social home page Coder Social logo

contenttools's Introduction

ContentTools .NET SDK

.Net SKD for ContentTools Rest API.

NuGet Package: https://www.nuget.org/packages/ContentTools.Net/

About ContentTools

It's a CMS platform to centralize content marketing operation: plan, manage, collaborate, publish. All in one place giving up email threads, spreadsheets, and lack of data.

Further information: https://contentools.com

About Contentools Integration API Version 1

With Contentools Integration API, one can make requests to our software through a defined endpoint and retrieve data from their project. As of the API version 1, it is only possible to retrieve data through GET requests as long as it is an authenticated request. The request should be filled in the following format, adjusting with the company name as present in the software URL and desired endpoint.

For instance: https://[accountname].contentools.com/api/v1/[endpoint] Every response will come in JSON format with the data organized in Javascript objects.

For more information see V1 API Documentation.

About ContentTools .NET SDK

It's a SDK Rest API developed in .Net Framework 4.6+ consuming Contentools API Version 1.

Dependencies

  • .Net framework 4.6.1
  • Newtonsoft.Json 12.0.2
  • RestSharp 106.6.10

How to setup it

Just call the method ContentToolClient(string baseUrl, string token, string emailAccount, int projectId) with the following parameters:

  • baseUrl = https://[accountname].contentools.com/api/v1/[endpoint]
  • token = The API Token that needs to configure on ContentTools platform. For more information see here.
  • emailAccount = Your email account on Content Tools platform.
  • projectId = Your content project id on Content Tools.

In ContentTools.Client console project there is a good example using appSettings keys.

Returning values

After setup, the object instanced ContentToolClient has the property Posts that connects to endpoint public_content. Using the method Get() it's enough to return contents from ContentTools.

ContentToolClient client = new ContentToolClient(baseUrl, token, emailAccount, projectId);
var posts = client.Posts.Get();

Using filters

Use the method AddFilter() with the following signatures to filter contents:

void AddFilter(ContentType contentType);
void AddFilter(Paginate paginate);
void AddFilter(bool getDeletedContents = true);
void AddFilter(Status status);
void AddFilter(DateTime? dategt, DateTime? datelt)
void AddFilter(int limit)

ContentType filter

A Enum with the following definations:

[Description("blog-post")]
blogpost,
[Description("page")]
page,
[Description("social-post")]
socialpost,
[Description("webinar")]
webinar,
[Description("ebook")]
ebook,
[Description("Newsletter")]
newsletter

Paginate filter

A class with two main properties that possibiliy paginate data. Limit to define how many contents should be returned and Offset a number of contents to skip.

public int Limit { get; set; }      
public int Offset { get; set; }

GetDeletedContents filter

A boolean property to able Rest API return deleted contents. False is default

bool getDeletedContents = false

Status filter

A Enum with the following definations:

[Description("In progress")]
InProgress = 1,
[Description("Finished")]
Finished = 2,
[Description("Archived")]
Archived = 3,
[Description("Published")]
Published = 4,
[Description("Delayed")]
Delayed = 5,
[Description("Scheduled")]
Scheduled = 6

DateTime filter

A date range with optional startDate and endDate.

DateTime? dategt, DateTime? datelt` 


contenttools's People

Contributors

aragostinho avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.