Title: WP rest api post requestq
Last modified: January 13, 2017

---

# WP rest api post requestq

 *  [Brijesh Borad](https://wordpress.org/support/users/brijesh2911/)
 * (@brijesh2911)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/wp-rest-api-post-requestq/)
 * Hello,
    I am using wordpress 4.7.1 and i want to use wordpress rest api that 
   came with latest version. WP Rest API is working fine with GET request but not
   POST request. I am not able create any post with the POST request. I am getting
   these response for every time i tried.
 *     ```
       {
         "code": "rest_cannot_create",
         "message": "Sorry, you are not allowed to create posts as this user.",
         "data": {
           "status": 401
         }
       }
       ```
   
 * Please help to solve this asap

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [K. Adam White](https://wordpress.org/support/users/kadamwhite/)
 * (@kadamwhite)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/wp-rest-api-post-requestq/#post-8653029)
 * Hello, and thanks for trying the rest API! You’ll need to authenticate your post
   request, so that WordPress knows the POST came from an authorized user. Check
   out this documentation: [https://developer.wordpress.org/rest-api/authentication/](https://developer.wordpress.org/rest-api/authentication/)
   and here’s another article walking through how you can embed nonces in an arbitrary
   JS script loaded by WordPress: [http://wp-api.org/node-wpapi/guides/2016/08/12/authenticating-with-cookies.html](http://wp-api.org/node-wpapi/guides/2016/08/12/authenticating-with-cookies.html)
 * Hope this helps
 * Edit: updated the first link, sorry for the bad mobile copy-paste!
    -  This reply was modified 9 years, 4 months ago by [K. Adam White](https://wordpress.org/support/users/kadamwhite/).
      Reason: pasted wrong link
 *  Thread Starter [Brijesh Borad](https://wordpress.org/support/users/brijesh2911/)
 * (@brijesh2911)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/wp-rest-api-post-requestq/#post-8655044)
 * Thanks [@kadamwhite](https://wordpress.org/support/users/kadamwhite/) for the
   response.
    I want to create post from another website and i have tried basic 
   authentication as well as integrate oauth1 and oauth2 authentication but none
   of these is working.
 * Have you any idea why it is not working?
 *  [K. Adam White](https://wordpress.org/support/users/kadamwhite/)
 * (@kadamwhite)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/wp-rest-api-post-requestq/#post-8665693)
 * [@brijesh2911](https://wordpress.org/support/users/brijesh2911/) Unfortunately
   without knowing anything about your site or the application from which you’re
   making the connection, it’s very hard to say. What language/environment are you
   sending the requests from? Can you provide more information?
 *  Thread Starter [Brijesh Borad](https://wordpress.org/support/users/brijesh2911/)
 * (@brijesh2911)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/wp-rest-api-post-requestq/#post-8670467)
 * [@kadamwhite](https://wordpress.org/support/users/kadamwhite/) Yes, sure.
    I 
   am using wordpress’ default wp rest api feature and [WP OAuth Server](https://wordpress.org/plugins/oauth2-provider/)
   plugin.I am getting access token when i tried to call endpoint to create post
   with POST request but still i am getting this response
 *     ```
       {
         "code": "rest_cannot_create",
         "message": "Sorry, you are not allowed to create posts as this user.",
         "data": {
           "status": 401
         }
       }
       ```
   
 * Access token is valid though i am not able to create post with json endpoint.
   I don’t know what is the issue. I have checked database,too and found that the
   access token is valid for the user who is administrator of site.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘WP rest api post requestq’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/json-rest-api_2e3641.svg)
 * [WP REST API (WP API)](https://wordpress.org/plugins/json-rest-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-rest-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-rest-api/)
 * [Active Topics](https://wordpress.org/support/plugin/json-rest-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-rest-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-rest-api/reviews/)

## Tags

 * [post](https://wordpress.org/support/topic-tag/post/)
 * [request](https://wordpress.org/support/topic-tag/request/)
 * [wp rest api](https://wordpress.org/support/topic-tag/wp-rest-api/)

 * 4 replies
 * 2 participants
 * Last reply from: [Brijesh Borad](https://wordpress.org/support/users/brijesh2911/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/wp-rest-api-post-requestq/#post-8670467)
 * Status: not resolved