Gaurav Bordoloi
Gaurav Bordoloi

Reputation: 63

Wordpress REST API link shows 403 error

I am using WP REST API in my wordpress blog. I am getting all the post using this link and it works fine. http://www.gmonetix.com/blog/wp-json/wp/v2/posts

But when I want to get a particular post by id such as http://www.gmonetix.com/blog/wp-json/wp/v2/posts/1122 , it shows 403: Error - access to the resource in this server is denied. Please give a solution for it.

Upvotes: 2

Views: 6378

Answers (2)

Dumindu Madushanka
Dumindu Madushanka

Reputation: 504

I had the same issue. You can try disabling mod_security on your server or making an exception for mod_security for the REST endpoints. Also you can try WordPress on your local server and confirm issue.

Upvotes: 0

Prabu
Prabu

Reputation: 530

You can retrieve single post by id like, this should work,

http://demo.wp-api.org/wp-json/wp/v2/posts/?filter[p]=1122

This URL gives response,

http://www.gmonetix.com/blog/wp-json/wp/v2/posts/?filter[p]=1122

Upvotes: 1

Related Questions