Home
> Uncategorized > #Nuget #Package for #WordPress.com #API
#Nuget #Package for #WordPress.com #API
If you want to automate processes based on the WordPress API – especially in situations where you want to do so without user interaction (i.e. server side / unattended / without oAuth), and you know C# / .NET, then this nuget package is for you.
First, you install the package via Nuget package manager;
Install-Package WordPressAPI
Then, in order to authenticate yourself against WordPress, You will need a wordpress username, password, and blog ID. Get your Blog ID by going to https://developer.wordpress.com/docs/api/console/ then Login and search /me/sites or /sites/hello.wordpress.com
And here is a simple code example
var strAccessToken = WordPressComAPI.Wordpress.Login(new WordPressComAPI.Wordpress.Credentials { Username = xxxxxx, Password = xxxxxx, blogId = xxxxx }); var strSite = https://public-api.wordpress.com/rest/v1.1/sites/blog.dotnetframework.org; var jSite = WordPressComAPI.Wordpress.Get(strSite,strAccessToken);
Categories: Uncategorized
Comments (0)
Trackbacks (0)
Leave a comment
Trackback