akslal 3 Posted October 1, 2017 Report Share Posted October 1, 2017 Hello, I am wondering if anyone knows how to create a WordPress post by using core REST API. I could not pass authentication in ubot and get 401 error when "POST example.com/wp-jason/wp/v2/posts" I'll highly appreciate if someone can help. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted October 2, 2017 Report Share Posted October 2, 2017 How are you trying to access it, via the http post plugin? There is a plugin by the way that does the hard work for you: http://ubotplugin.com/product/advanced-wordpress/ Quote Link to post Share on other sites
akslal 3 Posted October 3, 2017 Author Report Share Posted October 3, 2017 Hi,Thanks for your reply. I checked the plugin but I could not figure out if it was based on REST API. I just need to pass the POST requesthttps://developer.wordpress.org/rest-api/reference/posts/#create-a-post However, the problem seems to be that I could not do authentication.https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/ Here this fellow in ubot forum using the OAuth in curl.http://network.ubotstudio.com/forum/index.php/topic/17798-using-http-post-plugin-with-woocommerce-restful-api/ I would be happy to pay 50$ if someone can help. Thank you Quote Link to post Share on other sites
HelloInsomnia 1103 Posted October 3, 2017 Report Share Posted October 3, 2017 Hi,Thanks for your reply. I checked the plugin but I could not figure out if it was based on REST API. I just need to pass the POST requesthttps://developer.wordpress.org/rest-api/reference/posts/#create-a-post However, the problem seems to be that I could not do authentication.https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/ Here this fellow in ubot forum using the OAuth in curl.http://network.ubotstudio.com/forum/index.php/topic/17798-using-http-post-plugin-with-woocommerce-restful-api/ I would be happy to pay 50$ if someone can help. Thank you I think it may have been using the XML RPC but it may use both now because he has updated the plugin a lot over the years. You can always ask him, this is his forum profile: http://network.ubotstudio.com/forum/index.php/user/5560-pash/ For creating post requests your best bet is to use the HTTP Post Plugin but there is also a free plugin which may be able to do everything you need so you may want to try that first: http://network.ubotstudio.com/forum/index.php/topic/20002-free-heopas-custom-plugin-thread-lock-sqlite-thread-variables-email-ini-clipboard/ Quote Link to post Share on other sites
akslal 3 Posted October 4, 2017 Author Report Share Posted October 4, 2017 Hi I was passing nonce in the header and simply doing post request after that. Like explained here, http://wiki.ubotstudio.com/wiki/Socket_add_parameter Quote Link to post Share on other sites
HelloInsomnia 1103 Posted October 4, 2017 Report Share Posted October 4, 2017 Hi I was passing nonce in the header and simply doing post request after that. Like explained here, http://wiki.ubotstudio.com/wiki/Socket_add_parameter The socket commands are generally avoided because they were never really fully developed but if you are just doing a few simple things they may work for you. I would ensure the headers and everything are being set correctly by looking at the requests using Fiddler. I think Dan talks about using that as well as some other topics in this free course: http://www.bot-factory.com/http-plugin-tutorials/ He is using another plugin but the same theories apply to using the socket commands as well. Quote Link to post Share on other sites
jackluter 1 Posted October 5, 2017 Report Share Posted October 5, 2017 1 Quote Link to post Share on other sites
akslal 3 Posted October 10, 2017 Author Report Share Posted October 10, 2017 Thanks jackluter for the video. Actually currently I am using this plugin to create posts. But since REST API is core part of WordPress now, this plugin will be outdated soon. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.