When testing the REST API, an unexpected result was returned:
REST API Endpoint: /wp-json/wp/v2/types/post?context=edit
REST API Response: (500) Internal Server Error
We are running on 8 GB on an isolated server so I don’t think it is a server issue in terms of capacity/memory.
I’ve tried the following: Disabling all of our plugins, activating them one at a time, clearing my cache and refreshing the site cache, updating the permalinks/refreshing (whatever you call it), using a plugin to disable the RESTful API, uninstalling that plugin and using a plugin to “extend the JSON”, when that didn’t work I disabled that plugin.
To make this more complex, we are using a reverse proxy configuration (we have to because of our business) – Reverse Proxy Guide – Apache HTTP Server Version 2.4. If I don’t edit ANYTHING in WordPress, the site works fine, but when I try to modify a page in the backend I’m booted out after like a minute and then this 500 error renders. Luckily I have a backup of the database but I’m wondering if anyone has any advice?
]]>
I am in the process of integrating a supplier’s APIs with my Woocommerce site, and I am trying to find a way to update pricing and stock as the product information is called (in a search or on a page). Initially I intended on writing a script in PHP to carry out this function, but have not been able to sort out how to trigger my script. I have researched webhooks, but have been unsuccessful in finding what I need.
Do you have any guidance on how I can approach this, or, am I approaching this all wrong to begin with? Any advice would be appreciated.
]]>This external website (mobileshop.bz) is basically a warehouse selling mobile phones. I have been able to import all the products using WP All Import pro quite easily and have setup cron jobs to update them and bring in new stock.
The issue I have is when someone checks out on the website while purchasing a product. The external website uses something called N.A.T.M or Needed At The Moment and what should happen is this… When someone purchases on my clients website the theme I am developing needs to create a reservation using what they call a ReserveArticle function.
After that my theme needs to create a Sales Order using what they call a CreateSalesOrder function based on all the reservations created that day. The external website has created documentation HERE and HERE
I am at my wits end trying to get these two functions to integrate into the theme I am developing let alone trying to make them work. Any help or advice is greatly appreciated.
Many thanks,
Phillip Dews
I am using the RESTful API to update (automated) periodically hundred of products in my woocommerce (still 3.9.3) store. Therefor I use the products/<id>
endpoint: https://woocommerce.github.io/woocommerce-rest-api-docs/#update-a-product
This works pretty fine but I found now out that
*woocommerce uploads a new image every time when a product update is done,
*the old image of the product remains in the wp-uploads folder,
*my webspace reaches its maximum after a while and
*this happens even if the referenced image is exactly the same, than before.
I will try out a cleanup plug-in to get over this issue. Nevertheless I would like to ask:
How to update/override product image via RESTful API?
]]>I am wondering if there is a way to get your own customized meta box values on post edit page in action hook ‘rest_after_insert_post’. I can save my meta box value in action ‘save_post’, but since I want to use the customized meta box values in aciton rest_after_insert_post, I would like to retrieve the $.POST jQuery method to get the $_POST data in rest_after_insert_post. Is there anyway to do this? Thank you!
]]>After migration to Godaddy, the API is not working. The new hosting has a PHP Version of 5.6 and mySQL Version is 5.6.44-cll-lve
Any idea?
]]>Currently, I have succeeded (outside of WP world) to POST an HTML form to the web service from a regular HTML page (it collect an email ID, and submit it together with two hidden values to the web service):
<form action="url-of-Restful-webservice" method=POST target="_self">
Email ID: <input type="email" name="email_id" value="Your Email Id">
<input type="hidden" name="account_id" value="some_value">
<input type="hidden" name="coupon_id" value="some_value">
<input type="submit" value="Email Coupon" style="background-color:#688A08;font-weight:bold;">
</form>
How do I achieve the same from WP forms, e.g. Contact-Form-7?
Thanks for your help and time
Regards
John Zhu
]]>