[Blogs Connector] Wordpress Api Base URL

[Blogs Connector] Wordpress Api Base URL

  
Forge Component
(0)
Published on 2 Dec (13 days ago) by Nuno Reis
0 votes
Published on 2 Dec (13 days ago) by Nuno Reis

I tried my blog URL to get,

But it always shows 404 not found. 

Is there any specific way to find the URL of my wordpress?

What version is your WP? It only works in 4.7 and above.

I did it based in the documentation at http://v2.wp-api.org/ and it worked for 90% of the blogs I tested.

Can you share the blog URL?

Nuno Reis wrote:

What version is your WP? It only works in 4.7 and above.

I did it based in the documentation at http://v2.wp-api.org/ and it worked for 90% of the blogs I tested.

Can you share the blog URL?

Blog URL : https://sportsmadeeasy.blog

Above is my blog page URL and how to get blog posts from this?


Apparently while self-hosted blogs are

https://blog.nunoreis.pt/wp-json/wp/v2/

for blogs hosted at wordpress.com the URL is:

https://public-api.wordpress.com//wp/v2/sites/sportsmadeeasy.blog/

Similar to what Blogger has.

It can be done at the root.



You need to make a minor adjustment on each method for it to work and change to this format

https://public-api.wordpress.com/wp/v2/sites/sportsmadeeasy.blog/posts?

It means going on each of the methods and delete the start of the URL

Tomorrow I'll publish a fixed version that will guess if it is a wordpress.com or a wordpress.org.


Hi Keerthi.

It is now working. I published a new version and tested with several blogs wodpess.com including yours. There was a minor bug in the GetPages that prevented the correct usage in Example so I made a 2.0.1 version to fix it.

Thanks Nuno,


Will look at it and let you know : )